Jump to content
Sign in to follow this  
agelosc

Packed Primitive mass, size or area attribute

Recommended Posts

Hi all,

I have a fractured geometry and I need to calculate a mass, size or area attribute for each piece. I'm using an assemble sop to create packed geometry and I animate each piece with a vex expression using the intrinsic transforms of the pieces. However I'd like the animation to be varied by an attribute that holds a relative size value. 

I know the measure sop calculates area, volume etc but how can I "promote" this value to the packed primitives?

A brute approach would be to get the number of points for each packed primitve. Is there any way to get that info from the packed primitive?

Thanks,

Share this post


Link to post
Share on other sites

In case anyone finds this useful,

 The way I solved this was by adding any measured data from the unpacked geometry to a primitive attribute on the packed geometry via a primitive wrangle. The class attribute value created by a connectivity sop corresponds to the primitive id after the assemble so I could compare the class attriute with the primnum. I've attached a simple example file. If however someone has a different solution I would still like to know difrerent ways of approaching something like this.

 

PackedPrimitiveMeasure.hipnc

Share this post


Link to post
Share on other sites

hey, so if i understood it correctly, you want to do this: pipe your packed geo to a foreach loop. within it, unpack and get whichever attributes you want (with a pointwrangle for example), repack. for something like volume, within the foreach, you add a measure sop, set it to volume, then add an attribute promote sop (attribute "volume", from primitive to detail, method sum), and lastly demote the volume (another attribute promote, "volume" detail to primitive).

hope this helps!
chris

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  

×