0
$\begingroup$

I've been trying to figure this out for a while, but I'm kind of stuck. I have an Object Instancer that duplicates an object a random number of times (between 5 and 30)

I want to have this number to stay constant for x amount of time before resetting (0) and then chooses a new random number.

I've gotten as far as to have the number of instances change every x frames (see attached Tree Node), but I can't figure out how to make it go to 0 before picking a new number.

Any help would be greatly appreciated.

Node Tree

$\endgroup$
2
  • $\begingroup$ Have you give a look to Add/Animation then TimeInfo, Delay, Repeat? $\endgroup$
    – lemon
    Commented Mar 24, 2018 at 12:10
  • $\begingroup$ yes I tried messing around with that, but didn't get it to do what I wanted to. $\endgroup$
    – oyztein
    Commented Mar 25, 2018 at 9:52

1 Answer 1

2
$\begingroup$

You can multiply the output of the Random Number Node with a value that is one for all frames except those that are multiple of $x$. We can detect if a value is a multiple of $x$ using modulo as follows:

Node Tree

Th result of the previous node tree is as follows:

Result

The number of objects briefly goes to zero and change into a random number every 10 frames.

$\endgroup$
4
  • $\begingroup$ Hi Omar, thank you for your answer. I'm not sure I understand how to implement this to achieve what I wanted. I want to generate a random number for the object instancer, this number to stay constant for x amount of time, then briefly go to 0 before generating a new random number that stays constant for x amount of time and so on. Could you show me in this example blender file? dropbox.com/s/am0pg7767m3hpsy/clone_test.blend?dl=0 $\endgroup$
    – oyztein
    Commented Mar 25, 2018 at 10:11
  • $\begingroup$ @oyztein, you can store information in an additional (hidden) object, for instance in its vertices. From that I think you can easily control when the value is to be changed depending on the current frame. $\endgroup$
    – lemon
    Commented Mar 25, 2018 at 10:30
  • $\begingroup$ @oyztein I added a full example in my answer. Is it more clear now? $\endgroup$
    – Omar Emara
    Commented Mar 25, 2018 at 14:11
  • $\begingroup$ @OmarAhmad Yes I got it now, thank you so much! $\endgroup$
    – oyztein
    Commented Mar 25, 2018 at 15:00

You must log in to answer this question.

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