Jump to content
Sign in to follow this  
Skybar

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 :)

Share this post


Link to post
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

Share this post


Link to post
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...)

Share this post


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

Share this post


Link to post
Share on other sites

yup. That one. Have you seen Scott Keating´s Halloween tutorial at SESI´s site? If not you should. Wonderful info regarding the orient attribute and how to deal with it.

Edited by Netvudu

Share this post


Link to post
Share on other sites

Ah no I haven't, I'll try to do that when I have the chance. Thanks again :)

Share this post


Link to post
Share on other sites

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

Share this post


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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Are you getting non-identity values in the scale? You might also need those values as well.

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  

×