- Main Page
- Related Pages
- Modules
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Member Functions

# MFnTransform Class Reference

# OpenMaya - API module for common classes | FunctionSet classes

This reference page is linked to from the following overview topics: Overview of custom transforms.

Search for all occurrences

## Detailed Description

Create and access transform nodes.

The MFnTransform function set provides access to transformation DAG nodes called transforms.

DAG nodes are separated into two types, transforms and geometry nodes. All DAG nodes that are not transform nodes must exist as a child of a transform node. Only transforms provide transformation information. Transforms are also commonly used as parent nodes for the purpose of hierarchical grouping.

The transformation in the node is represented as a 4x4 transformation matrix. This function set allows access to the whole matrix, or the individual components (eg scale, rotation, shear, etc) of the transformation. The transform node is made up of many components that make up the final transformation matrix. This breakdown provides animators fine control over the animation of these parameters. Therefore, it is necessary to describe the order in which these attributes are applied to build the final matrix attribute.

A transformation matrix is composed of the following components, all components with units will be in maya's internal units (radians for rotations and centimeters for translations):

- Scale pivot point point around which scales are performed [Sp]
- Scale scaling about x, y, z axes [S]
- Shear shearing in xy, xz, yx [Sh]
- Scale pivot translation translation introduced to preserve existing scale transformations when moving pivot. This is used to prevent the object from moving when the objects pivot point is not at the origin and a non-unit scale is applied to the object [St].
- Rotate pivot point point about which rotations are performed [Rp]
- Rotation orientation rotation to orient local rotation space [Ro]
- Rotation rotation [R]
- Rotate pivot translation translation introduced to preserve exisitng rotate transformations when moving pivot. This is used to prevent the object from moving when the objects pivot point is not at the origin and the pivot is moved. [Rt]
- Translate translation in x, y, z axes [T]

The matrices are post-multiplied in Maya. For example, to transform a point P from object-space to world-space (P') you would need to post-multiply by the worldMatrix. (P' = P x WM)

The transformation matrix is then constructed as follows:

         -1                       -1
      [Sp]x[S]x[Sh]x[Sp]x[St]x[Rp]x[Ro]x[R]x[Rp]x[Rt]x[T]

where 'x' denotes matrix multiplication and '-1' denotes matrix inversion

         Sp = |  1    0    0    0 |     St = |  1    0    0    0 |
              |  0    1    0    0 |          |  0    1    0    0 |
              |  0    0    1    0 |          |  0    0    1    0 |
              | spx  spy  spz   1 |          | sptx spty sptz  1 |

         S  = |  sx   0    0    0 |     Sh = |  1    0    0    0 |
              |  0    sy   0    0 |          | shxy  1    0    0 |
              |  0    0    sz   0 |          | shxz shyz  1    0 |
              |  0    0    0    1 |          |  0    0    0    1 |

         Rp = |  1    0    0    0 |     Rt = |  1    0    0    0 |
              |  0    1    0    0 |          |  0    1    0    0 |
              |  0    0    1    0 |          |  0    0    1    0 |
              | rpx  rpy  rpz   1 |          | rptx rpty rptz  1 |

         Ro = AX * AY * AZ

         AX = |  1    0    0    0 |     AY = |  cy   0   -sy   0 |
              |  0    cx   sx   0 |          |  0    1    0    0 |
              |  0   -sx   cx   0 |          |  sy   0    cy   0 |
              |  0    0    0    1 |          |  0    0    0    1 |

         AZ = |  cz   sz   0    0 |     sx = sin(rax), cx = cos(rax)
              | -sz   cz   0    0 |     sy = sin(ray), cx = cos(ray)
              |  0    0    1    0 |     sz = sin(raz), cz = cos(raz)
              |  0    0    0    1 |

         R  = RX * RY * RZ  (Note: order is determined by rotateOrder)

         RX = |  1    0    0    0 |     RY = |  cy   0   -sy   0 |
              |  0    cx   sx   0 |          |  0    1    0    0 |
              |  0   -sx   cx   0 |          |  sy   0    cy   0 |
              |  0    0    0    1 |          |  0    0    0    1 |

         RZ = |  cz   sz   0    0 |     sx = sin(rx), cx = cos(rx)
              | -sz   cz   0    0 |     sy = sin(ry), cx = cos(ry)
              |  0    0    1    0 |     sz = sin(rz), cz = cos(rz)
              |  0    0    0    1 |

         T  = |  1    0    0    0 |
              |  0    1    0    0 |
              |  0    0    1    0 |
              |  tx   ty   tz   1 |

Note that internally the Maya transform does not store the individual component values in matrices. It stores them in the data structure which makes the most sense for that component. For example, translation is stored as a vector. The accessor methods on MFnTransform provide the data in their native structure rather than as a matrix.

Additionally, each transform can save a temporary "rest position" matrix using the setRestPosition method. The rest position is not used internally by Maya. It is exclusively for use from the API as a temporary cache, which can be set and restored within a single Maya session. Note that the rest position is not saved with the scene.

Examples:

  closestPointOnNurbsSurfaceCmd.cpp, customAttrManip.cpp, footPrintManip.cpp, geometrySurfaceConstraint.cpp, intersectOnNurbsSurfaceCmd.cpp, lepTranslator.cpp, lineManip.cpp, lineManipContainer.cpp, moveNumericTool.cpp, moveTool.cpp, simpleSolverNode.cpp, squareScaleManip.cpp, squareScaleManipContext.cpp, surfaceBumpManip.cpp, and swissArmyManip.cpp.

`#include <MFnTransform.h>`

Inheritance diagram for MFnTransform:
[legend]

List of all members.

## Public Types
enum | LimitType { kScaleMinX, kScaleMaxX, kScaleMinY, kScaleMaxY, kScaleMinZ, kScaleMaxZ, kShearMinXY, kShearMaxXY, kShearMinXZ, kShearMaxXZ, kShearMinYZ, kShearMaxYZ, kRotateMinX, kRotateMaxX, kRotateMinY, kRotateMaxY, kRotateMinZ, kRotateMaxZ, kTranslateMinX, kTranslateMaxX, kTranslateMinY, kTranslateMaxY, kTranslateMinZ, kTranslateMaxZ }
| Limit types. More...
## Public Member Functions
virtual MFn::Type | type () const
| Function set type.
virtual | ~MFnTransform ()
| Destructor.
| MFnTransform ()
| Default constructor.
| MFnTransform (MObject &object, MStatus *ReturnStatus=NULL)
| Constructor.
| MFnTransform (const MDagPath &object, MStatus *ret=NULL)
| Constructor.
MObject | create (MObject parent=MObject::kNullObj, MStatus *ReturnStatus=NULL)
| Creates a new transformation node.
MTransformationMatrix | transformation (MStatus *ReturnStatus=NULL) const
| Retrieve the transformation matrix represented by this transform.
MStatus | set (const MTransformationMatrix &transform)
| Change this transform to equal the given matrix.
MStatus | getScale (double scale[3]) const
| Retrieve the scaling component of this transformation.
MStatus | setScale (const double scale[3])
| Set the scaling component of this transformation.
MStatus | scaleBy (const double scale[3])
| Relatively scale this transformation.
MStatus | getShear (double scale[3]) const
| Retrieve the shearing component of this transformation.
MStatus | setShear (const double shear[3])
| Set the shearing component of this transformation.
MStatus | shearBy (const double shear[3])
| Relatively shear this transformation.
MStatus | getRotation (MQuaternion &quaternion, MSpace::Space=MSpace::kTransform) const
| Retrieve the rotation component of this transformation as a quaternion.
MStatus | setRotation (const MQuaternion &quaternion, MSpace::Space=MSpace::kTransform)
| Change the rotation component of this transformation using a quaternion.
MStatus | rotateBy (const MQuaternion &quaternion, MSpace::Space=MSpace::kTransform)
| Relatively change the rotation of this transformation using a quaternion.
MStatus | getRotation (MEulerRotation &rotation) const
| Retrieve the rotation component of this transformation.
MStatus | setRotation (const MEulerRotation &rotation)
| Change the rotation component of this transformation.
MStatus | rotateBy (const MEulerRotation &rotation, MSpace::Space=MSpace::kTransform)
| Relatively change the rotation component of this transformation.
MStatus | getRotationQuaternion (double &x, double &y, double &z, double &w, MSpace::Space=MSpace::kTransform) const
| Retrieve the rotation component of this transformation as a quaternion.
MStatus | setRotationQuaternion (double x, double y, double z, double w, MSpace::Space=MSpace::kTransform)
| Change the rotation component of this transformation using a quaternion.
MStatus | rotateByQuaternion (double x, double y, double z, double w, MSpace::Space=MSpace::kTransform)
| Relatively change the rotation of this transformation using a quaternion.
MStatus | getRotation (double rotation[3], MTransformationMatrix::RotationOrder &order) const
| Retrieve the rotation component of this transformation.
MStatus | setRotation (const double rotation[3], MTransformationMatrix::RotationOrder order)
| Change the rotation component of this transformation.
MStatus | rotateBy (const double rotation[3], MTransformationMatrix::RotationOrder order, MSpace::Space=MSpace::kTransform)
| Relatively change the rotation component of this transformation.
MVector | getTranslation (MSpace::Space space, MStatus *ReturnStatus=NULL) const
| Retrieve the translation component of this transformation in centimeters.
MStatus | setTranslation (const MVector &vec, MSpace::Space space)
| Change the translation component of this transformation.
MStatus | translateBy (const MVector &vec, MSpace::Space space)
| Relatively change the translation component of this transformation.
MPoint | scalePivot (MSpace::Space space, MStatus *ReturnStatus=NULL) const
| Returns the pivot around which the scale is applied.
MStatus | setScalePivot (const MPoint &point, MSpace::Space space, bool balance)
| Set the pivot around which the scale is applied in centimeters.
MVector | scalePivotTranslation (MSpace::Space space, MStatus *ReturnStatus=NULL) const
| Returns the scale pivot translation in centimeters.
MStatus | setScalePivotTranslation (const MVector &vec, MSpace::Space space)
| Set the scale pivot translation in centimeters.
MPoint | rotatePivot (MSpace::Space space, MStatus *ReturnStatus=NULL) const
| Returns the pivot about which the rotation is applied.
MStatus | setRotatePivot (const MPoint &point, MSpace::Space space, bool balance)
| Set the rotate pivot in centimeters about which rotation is applied.
MVector | rotatePivotTranslation (MSpace::Space space, MStatus *ReturnStatus=NULL) const
| Return the rotate pivot translation in centimeters.
MStatus | setRotatePivotTranslation (const MVector &vec, MSpace::Space space)
| Set the rotate pivot translation in centimeters.
MQuaternion | rotateOrientation (MSpace::Space space, MStatus *ReturnStatus=NULL) const
| Returns the rotation used to orient the local rotation space.
MStatus | setRotateOrientation (const MQuaternion &quat, MSpace::Space space, bool balance)
| Set the rotation used to orient the local rotation space.
MTransformationMatrix::RotationOrder | rotationOrder (MStatus *ReturnStatus=NULL) const
| Returns the rotation order for the transform matrix - the order in which the Euler angles are applied to create the end rotation.
MStatus | setRotationOrder (MTransformationMatrix::RotationOrder order, bool reorder)
| Change the rotation order for the transform - the order in which the Euler angles are applied to create the end rotation.
MTransformationMatrix | restPosition (MStatus *ReturnStatus) const
| Retrieve the saved rest position of this transform.
MStatus | setRestPosition (const MTransformationMatrix &matrix)
| Change the saved rest position of this transform.
MStatus | resetFromRestPosition ()
| Reset the transform to its rest position.
MStatus | clearRestPosition ()
| Clear the saved rest position of this transform.
MStatus | getRotation (double rotation[3], MTransformationMatrix::RotationOrder &order, MSpace::Space) const
| This method is obsolete.
MStatus | setRotation (const double rotation[3], MTransformationMatrix::RotationOrder order, MSpace::Space)
| This method is obsolete.
MVector | translation (MSpace::Space space, MStatus *ReturnStatus=NULL) const
| This method is obsolete.
bool | isLimited (MFnTransform::LimitType type, MStatus *ReturnStatus=NULL) const
| Determine if the specified limit attribute is enabled or disabled.
double | limitValue (MFnTransform::LimitType type, MStatus *ReturnStatus=NULL) const
| Determine the current value of the specified limit.
MStatus | setLimit (MFnTransform::LimitType type, double value)
| Change the limit value for the specified limit type, and automatically enable the limit to be true.
MStatus | enableLimit (MFnTransform::LimitType type, bool flag)
| Enable or disable the limit value for the specified limit type.
| MFnTransform (const MObject &object, MStatus *ret=NULL)
| Constructor.
## Protected Member Functions
virtual const char * | className () const
| Class name.

## Member Enumeration Documentation

enum LimitType

Search for all occurrences

Limit types.

Enumerator:

  kScaleMinX | Search for all occurrences
  kScaleMaxX | Search for all occurrences
  kScaleMinY | Search for all occurrences
  kScaleMaxY | Search for all occurrences
  kScaleMinZ | Search for all occurrences
  kScaleMaxZ | Search for all occurrences
  kShearMinXY | Search for all occurrences
  kShearMaxXY | Search for all occurrences
  kShearMinXZ | Search for all occurrences
  kShearMaxXZ | Search for all occurrences
  kShearMinYZ | Search for all occurrences
  kShearMaxYZ | Search for all occurrences
  kRotateMinX | Search for all occurrences
  kRotateMaxX | Search for all occurrences
  kRotateMinY | Search for all occurrences
  kRotateMaxY | Search for all occurrences
  kRotateMinZ | Search for all occurrences
  kRotateMaxZ | Search for all occurrences
  kTranslateMinX | Search for all occurrences
  kTranslateMaxX | Search for all occurrences
  kTranslateMinY | Search for all occurrences
  kTranslateMaxY | Search for all occurrences
  kTranslateMinZ | Search for all occurrences
  kTranslateMaxZ | Search for all occurrences

## Constructor & Destructor Documentation

~MFnTransform | ( |  | ) | `[virtual]`

Destructor.

Class Destructor.

MFnTransform | ( | MObject & | object,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Constructor.

Class constructor that initializes the function set to the given MObject.

Parameters:

  [in] | object | The MObject to attach the function set to
  [out] | ReturnStatus | the return status

Status Codes:
  - MS::kSuccess if the function set is successfully attached
  - MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFnTransform | ( | const MDagPath & | object,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Constructor.

Class constructor that initializes the function set to the given constant MDagPath object.

Parameters:

  [in] | object | The const MDagPath to attach the function set to
  [out] | ReturnStatus | The return status

Status Codes:
  - MS::kSuccess if the function set is successfully attached
  - MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFnTransform | ( | const MObject & | object,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Constructor.

Class constructor that initializes the function set to the given MObject.

Parameters:

  [in] | object | The MObject to attach the function set to
  [out] | ReturnStatus | the return status

Status Codes:
  - MS::kSuccess if the function set is successfully attached
  - MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

## Member Function Documentation

MFn::Type type | ( |  | ) | const `[virtual]`

Search for all occurrences

Function set type.

Return the class type : MFn::kTransform.

Reimplemented from MFnDagNode.

Reimplemented in MFnCircleSweepManip, MFnCurveSegmentManip, MFnDirectionManip, MFnDiscManip, MFnDistanceManip, MFnFreePointTriadManip, MFnHikEffector, MFnIkEffector, MFnIkHandle, MFnIkJoint, MFnManip3D, MFnPointOnCurveManip, MFnPointOnSurfaceManip, MFnRotateManip, MFnScaleManip, MFnStateManip, and MFnToggleManip.

const char * className | ( |  | ) | const `[protected, virtual]`

Search for all occurrences

Class name.

Return the class name : "MFnTransform".

Reimplemented from MFnDagNode.

Reimplemented in MFnCircleSweepManip, MFnCurveSegmentManip, MFnDirectionManip, MFnDiscManip, MFnDistanceManip, MFnFreePointTriadManip, MFnHikEffector, MFnIkEffector, MFnIkHandle, MFnIkJoint, MFnManip3D, MFnPointOnCurveManip, MFnPointOnSurfaceManip, MFnRotateManip, MFnScaleManip, MFnStateManip, and MFnToggleManip.

MObject create | ( | MObject | parent = `MObject::kNullObj`,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Search for all occurrences

Creates a new transformation node.

The new node is placed in the DAG.

Parameters:

  [in] | parent | the parent of the transform to be created
  [out] | ReturnStatus | status code

Returns:
  The newly created transform node object

Status Codes:
  - MS::kSuccess operation successful
  - MS::kInsufficientMemory out of memory
  - MS::kInvalidParameter parent is not a DAG node
  - MS::kLicenseFailure application not licensed for attempted operation
  - MS::kFailure transform could not be added to DAG

Reimplemented in MFnHikEffector, MFnIkEffector, and MFnIkJoint.

MTransformationMatrix transformation | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Retrieve the transformation matrix represented by this transform.

Parameters:

  [out] | ReturnStatus | status code

Returns:
  The transformation matrix represented by this transform.

Status Codes:
  - MS::kSuccess success
  - MS::kFailure object error

MStatus set | ( | const MTransformationMatrix & | transform | ) |

Search for all occurrences

Change this transform to equal the given matrix.

Parameters:

  [in] | transform | the matrix to copy

Returns:
  status code

Status Codes:
  - MS::kSuccess success
  - MS::kFailure object error

MStatus getScale | ( | double | scale[3] | ) | const

Search for all occurrences

Retrieve the scaling component of this transformation.

Parameters:

  [out] | scale | Storage for the scale of the transform

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure object error

MStatus setScale | ( | const double | scale[3] | ) |

Search for all occurrences

Set the scaling component of this transformation.

Parameters:

  [in] | scale | The scale of the transform

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure object error

MStatus scaleBy | ( | const double | scale[3] | ) |

Search for all occurrences

Relatively scale this transformation.

Parameters:

  [in] | scale | The ratio by which to scale the transform

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure object error

MStatus getShear | ( | double | shear[3] | ) | const

Search for all occurrences

Retrieve the shearing component of this transformation.

Parameters:

  [out] | shear | Storage for the shear of the transform

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure object error

MStatus setShear | ( | const double | shear[3] | ) |

Search for all occurrences

Set the shearing component of this transformation.

Parameters:

  [in] | shear | The shear of the transform

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure object error

MStatus shearBy | ( | const double | shear[3] | ) |

Search for all occurrences

Relatively shear this transformation.

Parameters:

  [in] | shear | The ratio by which to shear the transform

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure object error

MStatus getRotation | ( | MQuaternion & | quaternion,
|  | MSpace::Space | space = `MSpace::kTransform`
| ) |  | const

Search for all occurrences

Retrieve the rotation component of this transformation as a quaternion.

The only valid transformation spaces for this method are MSpace::kTransform and MSpace::kWorld. All other spaces are treated as being equivalent to MSpace::kTransform.

Parameters:

  [out] | quaternion | the quaternion
  [in] | space | transform space in which to get the rotation

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kInvalidParameter invalid transform space
  - MS::kFailure object error

MStatus setRotation | ( | const MQuaternion & | quaternion,
|  | MSpace::Space | space = `MSpace::kTransform`
| ) |  |

Search for all occurrences

Change the rotation component of this transformation using a quaternion.

The only valid transformation spaces for this method are MSpace::kTransform and MSpace::kWorld. All other spaces are treated as being equivalent to MSpace::kTransform.

Parameters:

  [in] | quaternion | the quaternion
  [in] | space | transform space in which to perform the rotation

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kInvalidParameter invalid transform space
  - MS::kFailure object error

MStatus rotateBy | ( | const MQuaternion & | quaternion,
|  | MSpace::Space | space = `MSpace::kTransform`
| ) |  |

Search for all occurrences

Relatively change the rotation of this transformation using a quaternion.

Parameters:

  [in] | quaternion | the quaternion
  [in] | space | transform space in which to perform the rotation

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kInvalidParameter invalid transform space
  - MS::kFailure object error

MStatus getRotation | ( | MEulerRotation & | rotation | ) | const

Search for all occurrences

Retrieve the rotation component of this transformation.

The rotation is retrieved in MSpace::kTransform space.

Parameters:

  [out] | rotation | the euler rotation in radians

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure object error

MStatus setRotation | ( | const MEulerRotation & | rotation | ) |

Search for all occurrences

Change the rotation component of this transformation.

The rotation is set in MSpace::kTransform space.

Parameters:

  [in] | rotation | the euler rotation

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure object error

MStatus rotateBy | ( | const MEulerRotation & | rotation,
|  | MSpace::Space | space = `MSpace::kTransform`
| ) |  |

Search for all occurrences

Relatively change the rotation component of this transformation.

Parameters:

  [in] | rotation | the euler rotation
  [in] | space | transform space in which to perform the rotation

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kInvalidParameter invalid transform space
  - MS::kFailure object error

MStatus getRotationQuaternion | ( | double & | x,
|  | double & | y,
|  | double & | z,
|  | double & | w,
|  | MSpace::Space | space = `MSpace::kTransform`
| ) |  | const

Search for all occurrences

Retrieve the rotation component of this transformation as a quaternion.

The only valid transformation spaces for this method are MSpace::kTransform and MSpace::kWorld. All other spaces are treated as being equivalent to MSpace::kTransform.

Parameters:

  [out] | x | storage for the x component of the quaternion
  [out] | y | storage for the y component of the quaternion
  [out] | z | storage for the z component of the quaternion
  [out] | w | storage for the w component of the quaternion
  [in] | space | transform space in which to get the rotation

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kInvalidParameter invalid transform space
  - MS::kFailure object error

MStatus setRotationQuaternion | ( | double | x,
|  | double | y,
|  | double | z,
|  | double | w,
|  | MSpace::Space | space = `MSpace::kTransform`
| ) |  |

Search for all occurrences

Change the rotation component of this transformation using a quaternion.

The only valid transformation spaces for this method are MSpace::kTransform and MSpace::kWorld. All other spaces are treated as being equivalent to MSpace::kTransform.

Parameters:

  [in] | x | x component of the quaternion
  [in] | y | y component of the quaternion
  [in] | z | z component of the quaternion
  [in] | w | w component of the quaternion
  [in] | space | transform space in which to perform the rotation

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kInvalidParameter invalid transform space
  - MS::kFailure object error

MStatus rotateByQuaternion | ( | double | x,
|  | double | y,
|  | double | z,
|  | double | w,
|  | MSpace::Space | space = `MSpace::kTransform`
| ) |  |

Search for all occurrences

Relatively change the rotation of this transformation using a quaternion.

Parameters:

  [in] | x | x component of the quaternion
  [in] | y | y component of the quaternion
  [in] | z | z component of the quaternion
  [in] | w | w component of the quaternion
  [in] | space | transform space in which to perform the rotation

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kInvalidParameter invalid transform space
  - MS::kFailure object error

MStatus getRotation | ( | double | rotation[3],
|  | MTransformationMatrix::RotationOrder & | order
| ) |  | const

Search for all occurrences

Retrieve the rotation component of this transformation.

The rotation is retrieved in MSpace::kTransform space.

Parameters:

  [out] | rotation | storage for the rotation components
  [out] | order | storage for the order of rotation

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure object error

MStatus setRotation | ( | const double | rotation[3],
|  | MTransformationMatrix::RotationOrder | order
| ) |  |

Search for all occurrences

Change the rotation component of this transformation.

The rotation is set in MSpace::kTransform space.

Parameters:

  [in] | rotation | the new rotation components
  [in] | order | the order in which to apply the rotations

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure object error

MStatus rotateBy | ( | const double | rotation[3],
|  | MTransformationMatrix::RotationOrder | order,
|  | MSpace::Space | space = `MSpace::kTransform`
| ) |  |

Search for all occurrences

Relatively change the rotation component of this transformation.

Parameters:

  [in] | rotation | the relative rotation components
  [in] | order | the order in which to apply the rotations
  [in] | space | transform space in which to perform the rotation

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kInvalidParameter invalid transform space
  - MS::kFailure object error

MVector getTranslation | ( | MSpace::Space | space,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | const

Search for all occurrences

Retrieve the translation component of this transformation in centimeters.

Parameters:

  [in] | space | transform space in which to get the translation
  [out] | ReturnStatus | return status

Returns:
  Translation vector in centimeters

Status Codes:
  - MS::kSuccess operation successful
  - MS::kInvalidParameter invalid transform space
  - MS::kFailure object error

MStatus setTranslation | ( | const MVector & | vector,
|  | MSpace::Space | space
| ) |  |

Search for all occurrences

Change the translation component of this transformation.

Parameters:

  [in] | vector | the new translation vector in centimeters
  [in] | space | transform space in which to perform the translation

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kInvalidParameter invalid transform space
  - MS::kFailure object error

MStatus translateBy | ( | const MVector & | vector,
|  | MSpace::Space | space
| ) |  |

Search for all occurrences

Relatively change the translation component of this transformation.

Parameters:

  [in] | vector | the relative translation vector
  [in] | space | transform space in which to perform the translation

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kInvalidParameter invalid transform space
  - MS::kFailure object error

MPoint scalePivot | ( | MSpace::Space | space,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | const

Search for all occurrences

Returns the pivot around which the scale is applied.

The pivot will be in centimeters.

Parameters:

  [in] | space | space in which to get the pivot
  [out] | ReturnStatus | return status

Returns:
  Scale pivot point in centimeters

Status Codes:
  - MS::kSuccess success
  - MS::kInvalidParameter invalid space
  - MS::kFailure object error

MStatus setScalePivot | ( | const MPoint & | point,
|  | MSpace::Space | space,
|  | bool | balance
| ) |  |

Search for all occurrences

Set the pivot around which the scale is applied in centimeters.

If balance if true, then the overall transformation matrix will not change and a compensating transformation will be added to the scale pivot translation to to compensate for the new scale pivot.

Parameters:

  [in] | point | new scale pivot in centimeters
  [in] | space | transform space in which to set the scale pivot
  [in] | balance | whether to balance the matrix

Returns:
  Return status

Status Codes:
  - MS::kSuccess success
  - MS::kInvalidParameter invalid space
  - MS::kFailure object error

MVector scalePivotTranslation | ( | MSpace::Space | space,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | const

Search for all occurrences

Returns the scale pivot translation in centimeters.

This component is used as a compensation by maya when the user moves the scale pivot, or when the balance flag is set to true in the MfnTransform::setScalePivot method. The scale pivot translation serves as a compensation that allows existing transformations to be preserved when the scale pivot is modified. For the precise mathematics, refer to the transformation matrix details in the description section of MFnTransform.

Parameters:

  [in] | space | space in which to get the scale pivot translation
  [out] | ReturnStatus | return status

Returns:
  Scale pivot translation in centimeters

Status Codes:
  - MS::kSuccess success
  - MS::kInvalidParameter invalid space
  - MS::kFailure object error

MStatus setScalePivotTranslation | ( | const MVector & | vector,
|  | MSpace::Space | space
| ) |  |

Search for all occurrences

Set the scale pivot translation in centimeters.

This component is used internally by maya when the user moves the scale pivot, or when the balance flag is set to true in the MfnTransform::setScalePivot method. It serves as a compensation that allows existing transformations to be preserved when the scale pivot is modified. For the precise mathematics, refer to the transformation matrix details in the description section of MFnTransform.

Parameters:

  [in] | vector | new scale pivot translation in centimeters
  [in] | space | transform space in which to set the scale translation

Returns:
  Return status

Status Codes:
  - MS::kSuccess success
  - MS::kInvalidParameter invalid space
  - MS::kFailure object error

MPoint rotatePivot | ( | MSpace::Space | space,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | const

Search for all occurrences

Returns the pivot about which the rotation is applied.

Parameters:

  [in] | space | space in which to get the pivot
  [out] | ReturnStatus | return status

Returns:
  Rotation pivot point in centimeters

Status Codes:
  - MS::kSuccess success
  - MS::kInvalidParameter invalid space
  - MS::kFailure object error

MStatus setRotatePivot | ( | const MPoint & | point,
|  | MSpace::Space | space,
|  | bool | balance
| ) |  |

Search for all occurrences

Set the rotate pivot in centimeters about which rotation is applied.

If balance if true, then the overall transformation matrix will not change and a compensating transformation will be added to the rotate translate pivot to compensate for the pivot modification.

Parameters:

  [in] | point | new rotation pivot in centimeters
  [in] | space | transform space in which to set the pivot
  [in] | balance | whether to balance the matrix

Returns:
  Return status

Status Codes:
  - MS::kSuccess success
  - MS::kInvalidParameter invalid space
  - MS::kFailure object error

MVector rotatePivotTranslation | ( | MSpace::Space | space,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | const

Search for all occurrences

Return the rotate pivot translation in centimeters.

This component is used internally by maya when the user moves the rotate pivot, or when the balance flag is set to true in the MfnTransform::setRotatePivot method. It serves as a compensation that allows existing transformations to be preserved. For the precise mathematics, refer to the transformation matrix details in the description section of MFnTransform.

Parameters:

  [in] | space | space in which to get the pivot translation
  [out] | ReturnStatus | return status

Returns:
  Scale pivot translation in centimeters

Status Codes:
  - MS::kSuccess success
  - MS::kInvalidParameter invalid space
  - MS::kFailure object error

MStatus setRotatePivotTranslation | ( | const MVector & | vector,
|  | MSpace::Space | space
| ) |  |

Search for all occurrences

Set the rotate pivot translation in centimeters.

This component is used internally by maya when the user moves the rotate pivot, or when the balance flag is true in the MFnTransform::setRotatePivot method. It serves as a compensation that allows existing transformations to be preserved when the rotate pivot is modified. For the precise mathematics, refer to the transformation matrix details in the description section of MFnTransform.

Parameters:

  [in] | vector | new rotation pivot translation in centimeters
  [in] | space | transform space in which to set the rotation pivot translation

Returns:
  Return status

Status Codes:
  - MS::kSuccess success
  - MS::kInvalidParameter invalid space
  - MS::kFailure object error

MQuaternion rotateOrientation | ( | MSpace::Space | space,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | const

Search for all occurrences

Returns the rotation used to orient the local rotation space.

For the precise mathematics, refer to the transformation matrix details in the description section of MFnTransform.

Parameters:

  [in] | space | space in which to get the rotation orientation. This argument is currently ignored. The rotateOrientation is always returned in local space: MSpace::kTransform.
  [out] | ReturnStatus | return status

Returns:
  Rotateorientation

Status Codes:
  - MS::kSuccess success
  - MS::kInvalidParameter invalid space
  - MS::kFailure object error

MStatus setRotateOrientation | ( | const MQuaternion & | quat,
|  | MSpace::Space | space,
|  | bool | balance
| ) |  |

Search for all occurrences

Set the rotation used to orient the local rotation space.

For the precise mathematics, refer to the transformation matrix details in the description section of MFnTransform.

If balance if true, then the overall transformation matrix will not change and the rotation will be modified to achieve this.

Parameters:

  [in] | quat | new orientation as a quaternion
  [in] | space | transform space in which to set the rotateOrientation. This argument is currently ignored. The rotateOrientation always set in local space: MSpace::kTransform.
  [in] | balance | whether to balance the overall transformation matrix

Returns:
  Return status

Status Codes:
  - MS::kSuccess success
  - MS::kInvalidParameter invalid space
  - MS::kFailure object error

MTransformationMatrix::RotationOrder rotationOrder | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the rotation order for the transform matrix - the order in which the Euler angles are applied to create the end rotation.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  rotation order

Status Codes:
  - MS::kSuccess success
  - MS::kFailure object error

MStatus setRotationOrder | ( | MTransformationMatrix::RotationOrder | order,
|  | bool | reorder
| ) |  |

Search for all occurrences

Change the rotation order for the transform - the order in which the Euler angles are applied to create the end rotation.

Parameters:

  [in] | order | the order in which to apply rotations
  [in] | reorder | flag indicating whether or not rotations should be reordered.

Returns:
  status code

Status Codes:
  - MS::kSuccess success
  - MS::kFailure object error

MTransformationMatrix restPosition | ( | MStatus * | ReturnStatus | ) | const

Search for all occurrences

Retrieve the saved rest position of this transform.

Parameters:

  [out] | ReturnStatus | status code

Returns:
  The transformation matrix equivalent to the transform's rest position. This rest position will be identity unless the "setRestPosition" method has been called.

Status Codes:
  - MS::kSuccess success
  - MS::kFailure object error

MStatus setRestPosition | ( | const MTransformationMatrix & | matrix | ) |

Search for all occurrences

Change the saved rest position of this transform.

The rest position is not used internally by Maya. It is exclusively for use from the API as a temporary cache, which can be set and restored within a single Maya session. Note that the rest position is not saved with the scene.

Parameters:

  [in] | matrix | the new rest position for this transform

Returns:
  status code

Status Codes:
  - MS::kSuccess success
  - MS::kFailure object error

MStatus resetFromRestPosition | ( |  | ) |

Search for all occurrences

Reset the transform to its rest position.

Returns:
  status code

Status Codes:
  - MS::kSuccess success
  - MS::kFailure object error

MStatus clearRestPosition | ( |  | ) |

Search for all occurrences

Clear the saved rest position of this transform.

Returns:
  status code

Status Codes:
  - MS::kSuccess success
  - MS::kFailure object error

MStatus getRotation | ( | double | rotation[3],
|  | MTransformationMatrix::RotationOrder & | order,
|  | MSpace::Space | space
| ) |  | const

Search for all occurrences

This method is obsolete.

Deprecated:
  Use the other MFnTransform::getRotation method instead.

The transformation space argument was always treated as MSpace::kTransform regardless of the actual argument.

Retrieve the rotation component of this transformation.

Parameters:

  [out] | rotation | Storage for the rotation components.
  [out] | order | Storage for the order of rotation.
  [in] | space | Ignored.

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kInvalidParameter invalid transform space
  - MS::kFailure object error

MStatus setRotation | ( | const double | rotation[3],
|  | MTransformationMatrix::RotationOrder | order,
|  | MSpace::Space | space
| ) |  |

Search for all occurrences

This method is obsolete.

Deprecated:
  Use the other MFnTransform::setRotation method instead.

The transformation space argument was always treated as MSpace::kTransform regardless of the actual argument.

Change the rotation component of this transformation.

Parameters:

  [in] | rotation | The new rotation components.
  [in] | order | The order in which to apply the rotations.
  [in] | space | Ignored.

Returns:
  Status code

Status Codes:
  - MS::kSuccess operation successful
  - MS::kInvalidParameter invalid transform space
  - MS::kFailure object error

MVector translation | ( | MSpace::Space | space,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | const

Search for all occurrences

This method is obsolete.

Deprecated:
  Use the method MFnTransform::getTranslation instead.

Retrieve the translation component of this transformation in centimeters.

Parameters:

  [in] | space | Transform space in which to get the translation.
  [out] | ReturnStatus | Return status.

Returns:
  Translation vector in centimeters

Status Codes:
  - MS::kSuccess operation successful
  - MS::kInvalidParameter invalid transform space
  - MS::kFailure object error

bool isLimited | ( | MFnTransform::LimitType | type,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | const

Search for all occurrences

Determine if the specified limit attribute is enabled or disabled.

Parameters:

  [in] | type | type to query limit
  [out] | ReturnStatus | status code

Returns:
  True or false, true means the limit is enabled.

Status Codes:
  - MS::kSuccess success
  - MS::kFailure object error

double limitValue | ( | MFnTransform::LimitType | type,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | const

Search for all occurrences

Determine the current value of the specified limit.

Parameters:

  [in] | type | type to query limit
  [out] | ReturnStatus | status code

Returns:
  Current value of the specified limit as internal unit.

Status Codes:
  - MS::kSuccess success
  - MS::kFailure object error

MStatus setLimit | ( | MFnTransform::LimitType | type,
|  | double | value
| ) |  |

Search for all occurrences

Change the limit value for the specified limit type, and automatically enable the limit to be true.

Parameters:

  [in] | type | type to apply a limit
  [in] | value | new limit value as internal unit

Returns:
  status code

Status Codes:
  - MS::kSuccess success
  - MS::kFailure object error

MStatus enableLimit | ( | MFnTransform::LimitType | type,
|  | bool | flag
| ) |  |

Search for all occurrences

Enable or disable the limit value for the specified limit type.

Parameters:

  [in] | type | type to apply a limit
  [in] | flag | true or false to enable

Returns:
  status code

Status Codes:
  - MS::kSuccess success
  - MS::kFailure object error

MFnTransform MFnTransform MFnTransform MFnTransform MFnTransform MFnTransform MFnTransform MFnTransform MFnTransform MFnTransform
MFnTransform MFnTransform MFnTransform MFnTransform MFnTransform MFnTransform MFnTransform MFnTransform MFnTransform MFnTransform