Frame or Time in Magma

Is there a frame or time node/attr in Magma – to tie into noise, for instance?

Thank you in advance!

You have two options:
*You can create an InputValue > Float and keyframe it on the first and last frames with the values you want, e.g. 1.0 at time 1 and 48.0 on frame 48. Set the keys to linear and you have the time.

*Create an InputValue > Float, right-click the value field, Create Expression… and set the expression to the name of the attribute = currentTime -q, e.g.

PRTMagma1.InputValue_4_Property2_fValue_Float = `currentTime -q`

In my case, the InputValue has ID 4 (the 5th node created in the flow). YMMV.

In my test,
*I created an Output Color node by pressing Ctrl+Shift+C.
*Then I hit Alt+F for Function and B for Blend and a Blend op was connected to the output.
*Then I hit SHIFT+1 for Red color input - it got connected to socket 1 of the Blend.
*I reselected the Blend and hit SHIFT+3 to make a Blue color input - it got connected to socket 2 of the Blend.
*I reselected the Blend node again and hit Ctrl+1 to make a Float inputValue with a value of 1.0. It got connected to the 3rd input socket of the Blend.
*Then I hit the / key for Divide and entered 48.0 in the Divisor field.
*Then I selected the InputValue node with the value of 1.0 I made before and right-clicked the value field > Create Expression.
*I entered the above expression and created it.


Unfortunately, moving the time slider does not trigger Magma updates right now (known limitation), but moving the time slider and hitting UPDATE shows that on frame 1 we have red particles, on frame 24 we get violet (50/50 mix of red and blue), and at 48 we get pure blue. It should render correctly in an animation…

FYI, in 3ds Max, Krakatoa MX Magma exposes a Script node which lets you enter arbitrary MAXScript code to do similar stuff, e.g. (currentTime.frame as float). We did not feel like adding a MEL or Python node because you can already do a lot with Expressions in Maya…

Hope this helps.

P.S. My screenshot might look different, I am running a much newer build of Krakatoa MY (today’s build, obviously :slight_smile: ). But it should still work the same in the Beta build you have…

Awesome! Thank you… I will try.

This is now fixed internally. I added an event JobScript to update automatically when the Magma Editor is open. So this will work in the final release. :slight_smile: