I'm trying to figure out how to make the number count to ten then go back down to 1.
3 Answers
If you are using Simulation zone just to get this result you can achieve it without using it. The node set up is similar just uses the Scene Time node to get the frame number:
-
$\begingroup$ Dooooh! :) I got locked into the question ... $\endgroup$– Robin Betts ♦Nov 3 at 20:30
-
-
This should do it:
it's set up to give you 1 on frame 1, and cycle back and forth between 1 and 10 thereafter.
This is more idiomatic than R. Betts' answer:
With an added benefit that it won't start malfunctioning after 16777216 frames (which I imagine you will never reach for multiple reasons, two of which are that it would take too much time to render that many frames, and that if you tried, Blender would probably crash before you reached that frame…)
However if your question isn't some simplified example of an actual problem, the real solution is to replace the entire simulation zone in Robin's answer with Scene Time: Frame node.
Also for a very similar reason to the 16777216 frames thing mentioned above, my setup can stop reversing if the counter exceeds that value (if the max value is higher).
-
$\begingroup$ Mind blown, but the range is from 1 to 10 and back to 1. No zeroes :) $\endgroup$ Nov 3 at 20:49
-
$\begingroup$ Hehe.... I must visit the country where this is an idiom....... are Blender floats 32 bit? $\endgroup$– Robin Betts ♦Nov 3 at 20:51
-
1$\begingroup$ Idiomatic, because it literally works (is implemented) as OP described it (except with the off-by-one error mentioned by Rumen, I'll leave correcting it as an exercise to the reader). @RobinBetts yes, not everywhere, but almost everywhere, including geonodes, it's "single precision" float32. $\endgroup$ Nov 3 at 20:54
-
1$\begingroup$ @MNB. Ahh. OK ..that's something I didn't appreciate. Thanks! $\endgroup$– Robin Betts ♦Nov 3 at 21:44