Object Trail (Someone wants to make an addon out of it?)

In the recent days i experimented with ways to create a trail behind objects. A typical example would be a swinging sword in some kind of game that indicates the speed/power/etc of the attack. I tried many things and did not find any suitable solution. So i wrote a script that is able to create a trail (separate mesh, continuously updated on frame change) behind an object. It also generates automatically an UV map to apply textures or gradients.



To make an object generate a trail it has to be a mesh containing one or more open or closed edge loops, but no faces (would give fancy results). Additionally it must have the custom property named “trail” (value doesn’t matter) and and optionally the property “trailLength” (integer) which defines how long (in frames) the trail can be. The trail itself has properties that shouldn’t be touched (might crash blender) and inherits the first material of the source object. (The bird like line thing in the first screenshot)

But i guess that is enough of explanation. Just download the file and press the play button in the timelime to see it in motion. The script registers itself on loading and shouldn’t be run again/manually (will be registered twice, which isn’t such good).

Since my time is limited i wanted at least to show what can/could be achieved. Maybe someone wants to pick up the idea and/or some code from it and make an addon out of it.

Attachments

trail.blend (74.4 KB)

awesome! i wondered 2 days ago, if this was possible and how it could be done - and this exactly what i imagined :slight_smile:

great job, should really be turned into addon. I’d like to help you with that.

But question: it works fine in 3d view, but can’t be rendered - or am i missing something? I tried bake action, did nothing. Internal render is empty, cycles has the trail mesh in black.

There seams to be an issue with Blender Internal. If i change the material then it works. My guess is that the material nodes don’t play along. But you could just use UV-Mapped textures (for alpha and stuff) instead at the moment. In Cycles it is black because there are no nodes for cycles. This are the BI nodes and both kind of nodes can’t coexist at the same time for one material.


PS: Could someone please give the developer, who uses color management on alpha channels, a clout? The current random all over the place color management annoys me for roughly a year right now. Somehow i would like to start a petition to remove it entirely and to reimplement it. It’s a ugly mess at the moment.

Color managment of alpha in nodes is getting worked on via OCIO ijmplementation I believe. There should be trickle down effects too.