Notifications
Clear all

[Closed] Getting the world transform of a gizmo

Is there any straight forward way of getting the world position, scale and rotation of a gizmo? Or do I just have to calculate it by hand?

  • Neil
6 Replies
 PEN

You just have to calcuate it. gizmo.transform*inverse object.transform if memory serves me right.

Any modifier in particular?

$.modifiers[1].gizmo.transform

This works for all of the modifiers I tried. UVW map, Bend, Lathe, and a few more.

Stev

 PEN

That will return the parent space transform of the modifier not the world transform. I tried with a bend and I had a position value of 0,0,0 and it was not at world center.

Ooops. My mistake.

Thanks Paul.

Neil,
Look up Modifier Sub-Object Transform Properties in the Maxscript Help. First example shows getting and setting world coordinates.

To convert from local to world coordinates, you multiply the local coordinates by the node’s objecttransform matrix. To convert from world to local coordinates, you multiple the world coordinates by the inverse of the node’s objecttransform matrix.
-Eric

Thanks Eric, that works great.

  • Neil