fieryspoon Posted September 16, 2014 Share Posted September 16, 2014 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 Quote Link to comment Share on other sites More sharing options...
bandini Posted September 16, 2014 Share Posted September 16, 2014 (edited) The "name" attribute is used internally to associate groups of primitives with packed geometry. Edited September 16, 2014 by bandini Quote Link to comment Share on other sites More sharing options...
fieryspoon Posted September 16, 2014 Author Share Posted September 16, 2014 Unpacking it adds a 'piece*' primitive attribute, but the highest piece number is 312, but I have 650 points in the packed geometry, so I'm not sure how to build an association with that. I have 312 unique rock types in the sim, but I need to isolate them per rock, not per rock type. Quote Link to comment Share on other sites More sharing options...
rayman Posted September 16, 2014 Share Posted September 16, 2014 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! Quote Link to comment Share on other sites More sharing options...
fieryspoon Posted September 16, 2014 Author Share Posted September 16, 2014 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. Quote Link to comment Share on other sites More sharing options...
fieryspoon Posted September 16, 2014 Author Share Posted September 16, 2014 (edited) Here's an example of what I mean. packedpoints.hip Edited September 16, 2014 by fieryspoon Quote Link to comment Share on other sites More sharing options...
rayman Posted September 16, 2014 Share Posted September 16, 2014 Well, you can either use foreach after importing pieces, or create better emitter that handles proper names inside packed geo. packedpoints_v02.hipnc Quote Link to comment Share on other sites More sharing options...
fieryspoon Posted September 16, 2014 Author Share Posted September 16, 2014 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.