Solaris convert 4x4Matrix to separate TRS transformation

   159   0   1
User Avatar
Member
7 posts
Joined: April 2025
Offline
Hi, I ran into some problems and stuck on it for a few days. Tried google it and posting on discord and forum, reddit. But did not get any helpful reply though.
So basically, it's an issue about converting 4x4 Matrix to Separate TRS.  In solaris, the default transformation generated by houdini was in the form of the  4x4 Matrix. Whichi looks like this

matrix4d xformOp:transform:xform = ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1) ) 
uniform token[] xformOpOrder = ["xformOp:transform:xform"]
since we want to do some simulation in Isaac Sim, which is software made by Nvidia. And Isaac Sim hates 4x4 Matrix and prefers separate TRS, which looks like this:

quatf xformOp:orient = (1, 0, 0, 0) float3 
xformOp:scale = (1, 1, 1) 
double3 xformOp:translate = (0, 0, 0) 
uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"]

We have to convert them inside houdini. After trying some python scripts, i cannot get a decent result. And here are two issues that I met
1 . Not all Xform will generate a default transform
2 . After converting to separate TRS, the original 4x4 matrix still there, though it won't affect the transform
 
i have also attached a hip file. So you could replicate it.
For issue 1,
If you inspect node configurelayer3, check out the layer and you will notice that prim  /World/body has no default transformation. /Wolrd has transformation seems to be the SOP create did some magic there, and /World/part_00 has transformation because i manually added a transform node. So, does it mean for every Xfrom i have to manually add a transform node to give them a default transformation?

For issue 2,  the python script do convert the matrix to separate TRS, but the original still there 

Any suggestion or help would be appreciate. I think there should be a more elegant way to achieve this.
Edited by richardbao - Dec. 11, 2025 07:49:55

Attachments:
temp_test.hiplc (136.0 KB)

  • Quick Links