Jump to content
Snyder90

Get orientation / pivot from packed prims (Transform Pieces)

Recommended Posts

Hey,

I simulated low res RBD pieces and am using a transform Pieces node to apply the position / rotation back onto the highres geo.

To get the orientation / pivot for the template points input of the transform pieces node I used a "dop import" node which is set to create points to represent objects. But I had to bake out the RBD objects and animate on top of em in Maya and brought em back to houdini.

I made sure the name attribute is exactly the same as on the highres geo again and packed it and currently just using an attribute wrangle to delete all prims so I only have points left. But those only come with P and name. How can I get the correct orientation / pivot back to align my highres geo correctly using the Transform Pieces node?

 

Thanks guys!

transformpieces.PNG

Share this post


Link to post
Share on other sites

Assuming you're using Alembic to get your primitives out of Maya and back into Houdini, you need to get the "packedfulltransform" intrinsic of each packed Alembic. In VEX you can use the "primintrinsic" function to get this matrix. However, points don't have primitive intrinsics, and so when you delete your primitives you're going to lose all your transform information except for @P. You'll want to keep the primitives loaded, unless you're manually converting the primitive intrinsic transforms to template point attributes.

To manually get an orient attribute from a packed Alembic:

matrix m = primintrinsic(0, "packedfulltransform", @primnum);
matrix3 m3 = matrix3(m);

p@orient = quaternion(m3);

To get the pivot:
 

vector3 pivot = primintrinsic(0, "pivot", @primnum);

v@pivot = pivot;

If you want to try the easy route, MOPs has built-in tools to handle this. Use MOPs Extract Attributes on your Alembic primitives, and it'll automatically pull an `orient` and `pivot` attribute out of your primitives (make sure to enable Extract Full Transform). You can then use Transform Pieces, or use MOPs Apply Attributes if your source and destination primitives have either the same sorting order or matching i@id attributes.

Edited by toadstorm

Share this post


Link to post
Share on other sites

You can also try Extract Transform - it can convert the geometry transforms to point representation.

Edited by rayman

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

×