Packed point data on unpacked geometry

   1851   2   1
User Avatar
Member
47 posts
Joined: Jan. 2014
Offline
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?
User Avatar
Staff
329 posts
Joined: July 2005
Offline
Ben Andersen
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?

Consider using the “name” attribute to define an associtation between the two geometries. There are some hscript and VEX methods that allow you to find elements with a given attribute value.

If you are using an Attribute Wrangle SOP to do the manipulation, try using the findattribval() function to find the point number in the second input where the name attribute has a particular value like this:

int index = findattribval(1, “point”, “name”, “piece42”);
User Avatar
Member
47 posts
Joined: Jan. 2014
Offline
Thanks Derrick!

The problem for me was that the name attribute isn't unique to each point. A point can share multiple ‘name’ geometries, because name just refers to the packed geometry type, which can be instanced to each point.

Someone at houdini support told me that the best way to do this right now is use two dop import nodes with one set to ‘fetch unpacked geometry’ with the ‘add DOP Object Name Attribute’ checked on, and then another set to ‘fetch packed geometry’ and build the association there via an attribute copy, which worked for me for the time being.
  • Quick Links