Jump to content

packed point number on unpacked geo


fieryspoon

Recommended Posts

I have a bunch of rocks that I've got in a bullet simulation, and now I need to unpack the geometry and modify them based on some data on the packed points.  I want to get the packed point number after unpacking it.  Or, basically just figure out some way to associate the packed geo points with the unpacked geo.  How can I do that?

 

Thanks,

Ben

Link to comment
Share on other sites

For each unpacked piece, go through points. Get name attribute from each point (promote if it is set on prims), then use vex findattribvalue() function on packed geo. This way you can find packed point indexes associated with each name. When you have indexes, just use point() function to get point ids.

 

If you need more help, I can prepare you quick example.

 

Good Luck!

Link to comment
Share on other sites

Hi, thanks!

 

I don't have a 1 to 1 correspondence of packed points to unpacked name attributes.  I'm emitting the rock geo over time and re-using some of the rock models sometimes, and I think that due to a memory optimization, it's storing the points that refer to the same geometry under the same 'name' attribute when it unpacks it.  I'll put together an example of what I mean.

Link to comment
Share on other sites

The foreach would work for me.  Thanks very much! :-)

 

You're saying that if I want to emit packed objects, the best way would be to:

unpack it before adding it

add the ID

repack it

add it to the sim

 

?

 

I feel like the unpack sop should have the option of adding the original packed point number as an attribute.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...