Here we will learn how to be able to use the play button at the bottom left of the Houdini window. This will allow us to make animations.
You can press play or get used to use the arrow keys to play and manipulate the frame number.
Now we want to use the current frame number directly. Upon hitting play, Houdini will render each frame consecutively until the total frame number $NFRAMES is hit. The special character that encodes the frame number is:
and it is an integer. Optionally one can use
$FF as a float to make sub frame computations but we don’t need that right now. Another important character is
which gives you the times passed in seconds as a float. For Consistency use
$F if you want the program to run equally on every computer.
$T on the other hand is useful for real time applications.
Lets see what
$F does with a simple example. Create a geometry node and throw in a test geometry and add a transform node to it. Transform nodes handle rotation, translation, scaling etc.
Now go to the transform node and insert
$F into the final entry of the rotation line. Then click on the scene and hit play. With every frame update, the transform node will rerun with the new frame number it its rotational component.
Use the bottom right global animation button to adjust the number of frames per cycle. Set it to 360 and test out more complex functions such as 720*sin(\$F) in the transform node.
Important for VEX code:
In order to use global variables such as
$F inside Vex code of a wrangler an additional intermediate step is required. Refer to the parameter handling tutorial to understand this. Optionally you can also use @Time, @Frames inside the VEX code.