Jump to content
Sign in to follow this  
Mdonovan

Assigning random geo to particles

Recommended Posts

Hi,

 

I am trying to assign random geometry to particles for a debris. I have a system that is working using the particle $ID in the copy sop stamp (mygeo) and using that in my geometry file path to a geo cache.

 

PATH : ../_glass/debris_lib/debris.`floor(fit01(rand(stamp("../copy1","mygeo", 0)), 1, 240))`.bgeo

 

The problem is that when particles are getting deleted (i have a kill volume) the ID are getting shuffled and thus the geometry is changing on the particles. 

 

Can anyone tell me how to create an attribute on a particle that is basically a non changing particle id ?

 

Thanks

Edited by Mdonovan

Share this post


Link to post
Share on other sites

What if you don't kill the particles? Scale them to zero instead.

Share this post


Link to post
Share on other sites

That would work, I was just trying to be efficient. I figured that like like most simulation packages , Houdini would slow down once stray particles accused and got farther away from the main part of the sim.

I am coming from Softimage I thought there had to be something similar to the 'set data' node.

Share this post


Link to post
Share on other sites

It's strange, the $ID should be preserved even when the particle dies, as stated in the docs :

 

i@id

Default is -1.

A unique id for the particle that remains the same throughout a single simulation. Always use @id rather than @ptnum to avoid things changing when particles are deleted. Use findattribval() to look up the point number that corresponds with an id.

 

Are you using id or ptnum in your copy1 node ?

Share this post


Link to post
Share on other sites

Your particle ID's are unique. Just like a social security number, they should not be switching when a particle dies. Check your system again.

 

~Ilan

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
Sign in to follow this  

×