tyFlow Forum
How to control color by particles lifespan? - Printable Version

+- tyFlow Forum (https://forum.tyflow.com)
+-- Forum: tyFlow Discussion (https://forum.tyflow.com/forum-1.html)
+--- Forum: General Discussion (https://forum.tyflow.com/forum-2.html)
+--- Thread: How to control color by particles lifespan? (/thread-3096.html)



How to control color by particles lifespan? - CLF73 - 05-21-2022

Hi there
I am aware that I can control the color of particles based on time "age".
But it does not respect the actual lifespan of the particles .

Example:
if I make a flow which continuously shots out particles, and delete them after 50 frames.
I can then apply custom float and control the UV over time.
But I have to normalize the custom value to 50.

This seems fine and is exactly like the example scene.

Problem:
If I apply a variety of 20 to the delete operator, then some particles die long before they reach the end of the color ramp, while others lasts for several frames with the end ramp color.

Is there a way to have it respect the lifespan, instead of age?


RE: How to control color by particles lifespan? - tyFlow - 05-22-2022

Particles don't have a 'lifespan' in any deterministic sense. Yes, you can retroactively see that a particle is deleted in X frames, but preemptively trying to determine lifespan is a form of the halting problem.

A workaround would be to assign some custom float value to particles ahead of time (ie, assign a max age/lifespan value), then delete particles with a filter that checks if their age is greater than the assigned float value. Then you can also use that float value to normalize the UVWs, but you'd have to use a Script operator to do that normalization for now (it's easy, just something to be aware of).