Unless otherwise noted, the following transform properties are always interpreted with respect to the current working coordinate system as defined by the currently active coordsys context. The default coordsys is world. The pos, rotation, and scale properties of a node are aliases to the corresponding subcontroller for the node's transform controller. If the transform controller does not have one of these subcontrollers, accessing the corresponding node property will result in an "Unknown property" error message. For example, the LookAt controller does not have a Rotation subcontroller, and the IK controller does not have any subcontrollers. You can still access the transform values using the Matrix3 properties of the node's transform property, for example, objpos=obj.transform.translationpart.
: the Matrix3 value is decomposed into its
: position, rotation, and scale values, and these
: values are stored in the respective position,
: rotation, and scale controllers, if those
: controllers exist and can be written to.
Rotates node so that the node's Z axis points in the specified direction. The node is rotated around its Z axis such that the Y axis points as much as possible in the world -Z direction.
Getting and setting
Rotation in the internal transformation matrices is left-handed in contradiction to the 3ds Max user interface and MAXScript. Take care when mixing rotation derived from these matrices and rotation used in rotation-related functions or from rotation properties.
Node geometry's position, rotation, and scale offset from the pivot in world coordinates.
Node geometry's offset in world coordinates.
-- Setting a node's rotation relative to world space without
-- messing with its position:
fn setNodeWorldRotation theNode theRot =
in coordsys (transmatrix theNode.transform.pos)
theNode.rotation = theRot
setNodeWorldRotation $ (eulerangles 45 45 0)
Using Node Transform Properties