Time functions

I think that has been brought up before and that the answer was no but I wanted to clarify to see if I missed something. Will we ever be able to get time/frame functions and/or store time variables in Magma or is it impossible with the way it’s setup? Seems the only time control you have is the loop op, correct?

Simplest possible example: Frame variable – greater than OP – output vector 1,0,0

The current time can be accessed thanks to the InputScript node. In fact, with the new ActiveType, you can simply hit ~ and type in “Frame” and a Script node with “CurrentTime.frame as float” as expression will be created. You can use it to make logical decisions or multiply values by it etc., but you cannot evaluate it once per iteration, it is evaluated only once per step.

What is currently not possible is querying data from a different time than the current time. In other words, you cannot request data of the current object or external objects to be evaluated a few frames back or later. In some cases, it this can be faked using a clone of the object with a time offset (e.g. an external PRT Loader can be cloned and set to an Offset to provide data from a few frames earlier or later, and the Mesher compound or XMesh could also be used to provide mesh info from a different time).

If you meant something else, please clarify.

Ah, nice, I’ll try that and see how far that will get me!

I haven’t started figuring this out yet, but my goal is to have one PRT Source’s color be set and then after some time fade off based on the proximity of particles in another PRT Source. In my mind I can see how it will be easy to set the color based on proximity but having control over the fading is what I’m concerned about. I’ll know more once I start putting it together.