Jump to content

extract rotation from alembic transform


Recommended Posts

Hi guys - relatively new Houdini user here...

I have an alembic animation of a flying cube which I want to copy a detailed model on. How do I access the rotation information from the alembic (maya transform, no shape deformation)?

When I import the alembic animation, there's rotation info in there, but I only see the P attribute. Ideally I'd like to get the rotation of the alembic point and put it into the orient attribute.

I'm not sure if I should go the orient() expression, lookat vex node, or some other route...

Any help appreciated :)

 

-Mike

 

 

locator_details.JPG

locator.JPG

locator2.JPG

Link to comment
Share on other sites

Mike!

Alembics store their orientation on a hidden intrinsic attribute on the prim; you can see this in the geo spreadsheet if you go to primitives, and use the 'instrinsics' dropdown to display 'packedfulltransform' or any of the other similarly named transformy attribs.

Anyway, to convert that to @orient means pulling out that 4x4 matrix, converting it to a orient quaternion, then promoting it dom from prim to point so you can drive a copy with it. This wrangle will do the first bit:

matrix m = primintrinsic(0,'packedfulltransform',@ptnum);
@orient = quaternion(matrix3(m));

And an attribpromote will do the second bit. I've attached a maya scene, houdini hip, alembic.

 

 

alembic_transform.zip

  • Like 2
Link to comment
Share on other sites

Matt!

I looked under prim intrinsics and it's pretty much zero'd out with no animation. Might be a weird alembic? It's just an animated cube in maya that I want to attach a model to...

I'll have a poke around your example scene though :)

 

 

intrinsics.JPG

Edited by mikethomson
crap spelling
Link to comment
Share on other sites

Hmmm, looking at your foo.abc I get the same zero/one in intrinsic / transform. Should I be seeing results in the geometry spreadsheet?

 

Ah, just re-checked. It seems intrinsic transform shows nothing, but packedfulltransform looks the goods. I'll try popping your point wrangle into my scene. Thanks!

 

-Mike

Link to comment
Share on other sites

  • 2 months later...

Hello,

 I'm trying to do the same (get rotation) following Matt's suggestion but for some reason, there is a weird flip at some point in my orient attribute. I know I'm missing something, it's just I'm not really familiar with vex. Already tried a couple alternatives but this one looks more clear to me.  

I just wanted to create constraints and one thing leads to another I guess :rolleyes:

test_constraint.zip

  • Like 1
Link to comment
Share on other sites

as Matt said. or in order to just attach or copy your model onto the alembic (without extracting the rotation matrix explicitly):
primintrinsic (Signature Matrix4, Intrinsic packedfulltransform) pointing to your alembic file -> multiply by P (coming from geovopglobal) -> P (into geovopoutput). done. 
(this help comes from my friend Martin Matzeder aka booyabase and saved me 1 mio times so far....)

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...