3dsmax Space to Houdini Space
917 6 1 galagast
 Member
 155 posts
 Joined:
 Offline
I'm getting the detail attribute hemax_translate, hemax_rotate, and hemax_scale from an object in 3dsmax through the engine.
How do to I convert these so that the values can be used in a Transform SOP?
Basically I just want to get the world space transform of an object in 3dsmax, and use that data to drive the transform on a geometry in my houdini asset.
Currently, I tried reading them directly using detail()
Switching rz with ry
But the results does not reflect what is in 3dsmax >_<
I also noticed, when using the debug options, houdni engine create two Objects in the houdini scene.
One with locked geometry, and one with a an object merge getting the locked geometry. both of these objects have transforms in them..
Will investigate further..
How do to I convert these so that the values can be used in a Transform SOP?
Basically I just want to get the world space transform of an object in 3dsmax, and use that data to drive the transform on a geometry in my houdini asset.
Currently, I tried reading them directly using detail()
Switching rz with ry
But the results does not reflect what is in 3dsmax >_<
I also noticed, when using the debug options, houdni engine create two Objects in the houdini scene.
One with locked geometry, and one with a an object merge getting the locked geometry. both of these objects have transforms in them..
Will investigate further..
 BrandonA
 Staff
 339 posts
 Joined: Aug. 2017
 Offline
Listed below is some pseudocode for going from 3ds Max's coordinate system to Houdini's coordinate system. Just a note that 3ds Max represents the rotation as a quaternion internally:
If there's a difference in units (e.g. 3ds Max isn't set to use meters), then the translation would have to be multiplied by the conversion factor.
The reason for 2 nodes being created when supplying an input to an object HDA is for some futureproofing. If for example, 2 separate HDAs are using the same input from 3ds Max, the locked geometry node will only be created once, which can then be shared amongst instances of HDAs using that input. The extra object merge will allow for transforms of inputs to be manipulated independently from the source geometry's transform, and will also allow for merging multiple geometries into a single input (and prevent having to remarshall the same data).
hou_position.x = hemax_translate.x
hou_position.y = hemax_translate.z
hou.position.z = hemax_translate.y
hou_quaternion.x = hemax_quaternion.x
hou_quaternion.y = hemax_quaternion.z
hou_quaternion.z = hemax_quaternion.y
hou_quaternion.w = hemax_quaternion.w
hou_scale.x = hemax_scale.x
hou_scale.y = hemax_scale.z
hou_scale.z = hemax_scale.y
If there's a difference in units (e.g. 3ds Max isn't set to use meters), then the translation would have to be multiplied by the conversion factor.
The reason for 2 nodes being created when supplying an input to an object HDA is for some futureproofing. If for example, 2 separate HDAs are using the same input from 3ds Max, the locked geometry node will only be created once, which can then be shared amongst instances of HDAs using that input. The extra object merge will allow for transforms of inputs to be manipulated independently from the source geometry's transform, and will also allow for merging multiple geometries into a single input (and prevent having to remarshall the same data).
Edited by BrandonA  Aug. 28, 2019 15:21:26
 galagast
 Member
 155 posts
 Joined:
 Offline
Hey Brandon, thank you for this info!
Regarding the information that I'm getting from 3dsmax, this is what the Details look like:
For comparison, here's the extracted transform information from 3dsmax:
And here's a table of the values:
The position values looks pretty straight forward.
But for the rotation, I'm not sure what the values represent, and how to use them >_<
Currently they are not in quat form.
Is it possible to maybe get matrix4?
The intention is to hopefully use it on a Transform SOP like so:
But using those values as is does not produce the same transformation result as in 3dsmax
Regarding the information that I'm getting from 3dsmax, this is what the Details look like:
For comparison, here's the extracted transform information from 3dsmax:
And here's a table of the values:
The position values looks pretty straight forward.
But for the rotation, I'm not sure what the values represent, and how to use them >_<
Currently they are not in quat form.
Is it possible to maybe get matrix4?
The intention is to hopefully use it on a Transform SOP like so:
But using those values as is does not produce the same transformation result as in 3dsmax
Edited by galagast  Aug. 28, 2019 22:37:10
 galagast
 Member
 155 posts
 Joined:
 Offline
 BrandonA
 Staff
 339 posts
 Joined: Aug. 2017
 Offline
The rotation values aren't as straightforward because the plugin converts the 3ds Max quaternion into Houdini's coordinate system and then converts it to Euler angles.
Would it help if it also attached the raw 3ds Max quaternion as a detail attribute? Something like hemax_quaternion. Then I believe you should be able to use the conversion in my previous post to create a quaternion in Houdini and also be able to convert it to Euler angles.
Would it help if it also attached the raw 3ds Max quaternion as a detail attribute? Something like hemax_quaternion. Then I believe you should be able to use the conversion in my previous post to create a quaternion in Houdini and also be able to convert it to Euler angles.
Edited by BrandonA  Aug. 30, 2019 15:25:11
 galagast
 Member
 155 posts
 Joined:
 Offline
Hey Brandon, yes i believe the raw values would be great, then we could just convert them to the Houdini equivalent.
Or maybe, just attach the full raw transform matrix of the object.. one on worldspace, and one on local space (in case it is in a hierarchy)?
Something like hemax_transform_world and hemax_transform_local.
Just note on the documentation that these values are raw. then add some code examples on how to extract and/or convert them using any of the houdini methods via vex, vops, hscript and/or python.
Or maybe, just attach the full raw transform matrix of the object.. one on worldspace, and one on local space (in case it is in a hierarchy)?
Something like hemax_transform_world and hemax_transform_local.
Just note on the documentation that these values are raw. then add some code examples on how to extract and/or convert them using any of the houdini methods via vex, vops, hscript and/or python.
 BrandonA
 Staff
 339 posts
 Joined: Aug. 2017
 Offline
Geometry inputs will now have 3 new detail attributes attached – hemax_quaternion, hemax_transform_world, and hemax_transform_local.
hemax_quaternion: this is the rotation (in Houdini's coordinate system) before it gets converted to Euler angles and placed in hemax_rotation.
hemax_transform_world: This is the raw world space transformation matrix of the 3ds Max node.
hemax_transform_local: This is the raw local space transformation matrix of the 3ds Max node.
This will be available in tomorrow's daily build.
hemax_quaternion: this is the rotation (in Houdini's coordinate system) before it gets converted to Euler angles and placed in hemax_rotation.
hemax_transform_world: This is the raw world space transformation matrix of the 3ds Max node.
hemax_transform_local: This is the raw local space transformation matrix of the 3ds Max node.
This will be available in tomorrow's daily build.
Edited by BrandonA  Sept. 4, 2019 14:07:50

 Quick Links