Jump to content

Transform/orient like Copy SOP?


Recommended Posts

Say I have a simulation of some Packed RBDs. In the middle of those there is a point which has some attributes like Trans, Orient, Pivot etc.

 

I then want to replace the simulated geometry with something else. If I use a Copy SOP it works fine, it copies my geo to the points and orients them properly. So right now I use a Foreach SOP to single out each point and each piece of my custom geo, and Copy SOP them. 

 

It works, sure. But it feels kinda "blackbox", I have no idea what is going on really. So I'm wondering how I could do this without the Copy SOP? What is it doing under the hood? I'm guessing it takes the Orient, Trans etc. attributes, but how could I do this manually in say a VOPSOP? If I only want the position it's kinda straightforward, but I want the rotation as well so that my custom geo matches the simulated ones exactly.

 

I'm only guessing but I believe the Orient attribute has something to do with the orientation (naturally, hehe). But that is a 4 float and I have no idea what those represent, or how to use it?

 

Cheers :)

Link to comment
Share on other sites

Have a look at the Transform Pieces SOP, which is designed to transform geometry according to the standard instancing attributes without any copying. It's just an asset that uses the Make Instance Transform VOP internally.  

  • Like 1
Link to comment
Share on other sites

Just to complement that info, the orient attribute is a quaternion or vector 4.  When you work with quaternions in VOPs you usually multiply them with a Quaternion Multiply. There is a help card that shows when and why the Copy SOP and Instances use those attributes (Orient first, otherwise, N and up, otherwise v, then rot, etc...)

Link to comment
Share on other sites

Just to complement that info, the orient attribute is a quaternion or vector 4.  When you work with quaternions in VOPs you usually multiply them with a Quaternion Multiply. There is a help card that shows when and why the Copy SOP and Instances use those attributes (Orient first, otherwise, N and up, otherwise v, then rot, etc...)

Thanks Javier. Was this what you were referring to? http://www.sidefx.com/docs/houdini13.0/copy/instanceattrs

Guess I need to delve deeper into the docs, lots of nice info like that I've probably missed.

Link to comment
Share on other sites

  • 2 months later...

How to convert the orient(4v) to rotation(3v) vector and get the same result? I tried using makeinstancexform and extractxform but something looks wrong, does not match with the result with when I copy the geometry on points using the orient.

 

*for some reason I can't have an attached example file. Get it from this link

Edited by cparliaros
Link to comment
Share on other sites

The file from Thomas is awesome but what I am looking is just to convert the orient in rotation vector. He is using rot which is a quaternion similar to orient to rotate geometry in vops but I want the actual vector with values in degrees to export it with point cloud for another software.

Link to comment
Share on other sites

  • 1 year later...

Quaternion to Matrix3 -> Extract Transform ... (might need a Matrix3 to Matrix4 in between)

I did this trying to get some RBD bullet geo converted for an fbx export to unreal.  It works, but there is horrible euler flipping going on.  How do I fix that?  My vop graph is simple.  getAttr(orient) > quattomatx > extractxform > parm(rotation).

 

The quaternion to extract transform has a dashed line, but adding a m3 to m4 conversion doesn't change anything. 

  • Like 1
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...