Jump to content

Get orientation / pivot from packed prims (Transform Pieces)


Snyder90

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

Link to comment
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
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...