Jump to content

Issue with timeshift in for-loop "stamp" workflow

Recommended Posts

Setting this up as a copy stamp for someone in the Houdini Facebook group asking how to use a time shift on objects copied to particles, yesterday, but I also tried to set it up with a for loop and ran into this issue. Seems, due to how the iterations are counted, the setup "breaks" after particles starts to get killed off and the number of iterations gets "stuck", looping, or how to describe it...

I'm probably missing some obvious solution, but I'm kinda stuck - so posting it here for someone with a brain to figure it out. :blink::D 



Share this post

Link to post
Share on other sites

It is normal for the iteration number per particle to change, if you delete particles in the foreach.

Instead of referencing the iteration, try referencing the id attribute of the particle for the random generator.
In your example the rx becomes: @Frame * 5 + fit01(rand(point("../foreach_begin1/", 0, "id", 0) + 65), 0, 100)

Share this post

Link to post
Share on other sites

Aah, of course - as I said, I'm probably missing some obvious solution - I was completely into using the current iteration... :blink:

Much appreciated. 

Oh, and if this is the first thing you've written here in three years, I will take public credit for provokating that response. ;)


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now