3
$\begingroup$

I'm trying to figure out how to make the number count to ten then go back down to 1.

enter image description here

$\endgroup$

3 Answers 3

7
$\begingroup$

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:

enter image description here

$\endgroup$
3
  • $\begingroup$ Dooooh! :) I got locked into the question ... $\endgroup$
    – Robin Betts
    Commented Nov 3, 2023 at 20:30
  • $\begingroup$ Still a very valid answer :) $\endgroup$ Commented Nov 3, 2023 at 20:33
  • $\begingroup$ here I am using #frame $\endgroup$ Commented Nov 3, 2023 at 22:07
6
$\begingroup$

This should do it:

enter image description here

it's set up to give you 1 on frame 1, and cycle back and forth between 1 and 10 thereafter.

$\endgroup$
5
$\begingroup$

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).

$\endgroup$
4
  • $\begingroup$ Mind blown, but the range is from 1 to 10 and back to 1. No zeroes :) $\endgroup$ Commented Nov 3, 2023 at 20:49
  • $\begingroup$ Hehe.... I must visit the country where this is an idiom....... are Blender floats 32 bit? $\endgroup$
    – Robin Betts
    Commented Nov 3, 2023 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$ Commented Nov 3, 2023 at 20:54
  • 1
    $\begingroup$ @MNB. Ahh. OK ..that's something I didn't appreciate. Thanks! $\endgroup$
    – Robin Betts
    Commented Nov 3, 2023 at 21:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .