Transformed asset to point instancer

   1170   4   3
User Avatar
Member
219 posts
Joined: Oct. 2015
Online
Hello,

I want to convert duplicated and transformed asset into a point instancer for further operations. I can get all positions but I don't know how to get back their orientations.

Cf. screenshot, on the left what I do manually and on the right when I try to get back in instancer, from source node "out_for_transform", the transformations.

Do you know how to do ?
(cf. simple scene file)
Thank you.

Attachments:
getTransform_01.hiplc (215.9 KB)
Try_to_convert_to_pointInstance.jpg (424.6 KB)

User Avatar
Staff
381 posts
Joined: Feb. 2008
Offline
orient should be a quaternion, not a matrix, and it should live on the (packed) points, not inside the packed geometry.

There is a much simpler way of doing this however - copy the usdxform attrib from the unpacked polys onto the packed USDs, rename it to transform and set the packed USD point positions back to the origin.

Here's an updated hip file.

Attachments:
getTransform_02.hiplc (136.9 KB)

User Avatar
Member
219 posts
Joined: Oct. 2015
Online
Hello @npetit,

Super, thank you for your explanation and solution.
That's simple to use and very useful.
User Avatar
Member
8675 posts
Joined: July 2007
Offline
alternatively you can just append Point Wrangle after your lopimport1

string stage = primintrinsic(0, "usdFileName", @primnum);
string path = primintrinsic(0, "usdPrimPath", @primnum);
3@transform = matrix3( usd_worldtransform(stage, path) );

Attachments:
getTransform_03.hipnc (134.0 KB)

Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
219 posts
Joined: Oct. 2015
Online
Wouahoo that's just one node !
Next step is only magic !

Thank you @tamte for this quick and short solution.
  • Quick Links