class MFnTransform

Jump to documentation

: public MFnDagNode Create and access transform nodes. (OpenMaya) (OpenMaya.py)

Inheritance:

MFnTransform < MFnDagNode < MFnDependencyNode < MFnBase

public members:

MFnTransform ( const MObject & object, MStatus * ReturnStatus = NULL )
MObject create ( MObject parent = MObject::kNullObj , MStatus * ReturnStatus = NULL )
MTransformationMatrix transformation ( MStatus * ReturnStatus = NULL ) const
MStatus set ( const MTransformationMatrix & transform )
MStatus getScale ( double scale[3] ) const
MStatus setScale ( const double scale[3] )
MStatus scaleBy ( const double scale[3] )
MStatus getShear ( double scale[3] ) const
MStatus setShear ( const double shear[3] )
MStatus shearBy ( const double shear[3] )
MStatus getRotation ( MQuaternion &quaternion, MSpace::Space = MSpace::kTransform ) const
MStatus setRotation ( const MQuaternion &quaternion, MSpace::Space = MSpace::kTransform )
MStatus rotateBy ( const MQuaternion &quaternion, MSpace::Space = MSpace::kTransform )
MStatus getRotation ( MEulerRotation &rotation ) const
MStatus setRotation ( const MEulerRotation &rotation )
MStatus rotateBy ( const MEulerRotation &rotation, MSpace::Space = MSpace::kTransform )
MStatus getRotationQuaternion ( double &x, double &y, double &z, double &w, MSpace::Space = MSpace::kTransform ) const
MStatus setRotationQuaternion ( double x, double y, double z, double w, MSpace::Space = MSpace::kTransform )
MStatus rotateByQuaternion ( double x, double y, double z, double w, MSpace::Space = MSpace::kTransform )
MStatus getRotation ( double rotation[3], MTransformationMatrix::RotationOrder & order ) const
MStatus setRotation ( const double rotation[3], MTransformationMatrix::RotationOrder order )
MStatus rotateBy ( const double rotation[3], MTransformationMatrix::RotationOrder order, MSpace::Space = MSpace::kTransform )
MVector getTranslation ( MSpace::Space space, MStatus * ReturnStatus = NULL ) const
MStatus setTranslation ( const MVector & vec, MSpace::Space space )
MStatus translateBy ( const MVector & vec, MSpace::Space space )
MPoint scalePivot ( MSpace::Space space, MStatus * ReturnStatus = NULL ) const
MStatus setScalePivot ( const MPoint & point, MSpace::Space space, bool balance )
MVector scalePivotTranslation ( MSpace::Space space , MStatus * ReturnStatus = NULL ) const
MStatus setScalePivotTranslation ( const MVector & vec, MSpace::Space space )
MPoint rotatePivot ( MSpace::Space space , MStatus * ReturnStatus = NULL ) const
MStatus setRotatePivot ( const MPoint & point, MSpace::Space space, bool balance )
MVector rotatePivotTranslation ( MSpace::Space space, MStatus * ReturnStatus = NULL ) const
MStatus setRotatePivotTranslation ( const MVector & vec, MSpace::Space space )
MQuaternion rotateOrientation ( MSpace::Space space , MStatus * ReturnStatus = NULL ) const
MStatus setRotateOrientation ( const MQuaternion & quat, MSpace::Space space, bool balance )
MTransformationMatrix::RotationOrder rotationOrder ( MStatus * ReturnStatus = NULL ) const
MStatus setRotationOrder ( MTransformationMatrix::RotationOrder order, bool reorder )
MTransformationMatrix restPosition ( MStatus * ReturnStatus) const
MStatus setRestPosition ( const MTransformationMatrix & matrix )
MStatus resetFromRestPosition ()
MStatus clearRestPosition ()
MStatus getRotation ( double rotation[3], MTransformationMatrix::RotationOrder & order, MSpace::Space ) const
OBSOLETE
MStatus setRotation (const double rotation[3], MTransformationMatrix::RotationOrder order, MSpace::Space )
OBSOLETE
MVector translation ( MSpace::Space space, MStatus * ReturnStatus = NULL ) const
OBSOLETE
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
bool isLimited ( MFnTransform::LimitType type , MStatus * ReturnStatus = NULL ) const
double limitValue ( MFnTransform::LimitType type , MStatus * ReturnStatus = NULL ) const
MStatus setLimit ( MFnTransform::LimitType type , double value)
MStatus enableLimit ( MFnTransform::LimitType type , bool flag)

Inherited from MFnDagNode:

public members:

kNextPos
MObject create ( const MTypeId &typeId, MObject & parent = MObject::kNullObj , MStatus * ReturnStatus = NULL )
MObject create ( const MTypeId &typeId, const MString &name, MObject & parent = MObject::kNullObj , MStatus * ReturnStatus = NULL )
MObject create ( const MString &type, MObject & parent = MObject::kNullObj , MStatus * ReturnStatus = NULL )
MObject create ( const MString &type, const MString &name, MObject & parent = MObject::kNullObj , MStatus * ReturnStatus = NULL )
unsigned int parentCount ( MStatus * ReturnStatus = NULL ) const
MObject parent ( unsigned int i, MStatus * ReturnStatus = NULL ) const
MStatus addChild ( MObject & child , unsigned int index = kNextPos , bool keepExistingParents = false )
MStatus removeChild ( MObject & child )
MStatus removeChildAt ( unsigned int index )
unsigned int childCount ( MStatus * ReturnStatus = NULL ) const
MObject child ( unsigned int i, MStatus * ReturnStatus = NULL ) const
MObject dagRoot ( MStatus * ReturnStatus = NULL )
bool hasParent ( const MObject & node, MStatus * ReturnStatus = NULL ) const
bool hasChild (const MObject & node, MStatus * ReturnStatus = NULL ) const
bool isChildOf (const MObject & node, MStatus * ReturnStatus = NULL ) const
bool isParentOf (const MObject & node, MStatus * ReturnStatus = NULL ) const
bool inUnderWorld ( MStatus * ReturnStatus = NULL ) const
bool inModel ( MStatus * ReturnStatus = NULL ) const
bool isInstanceable ( MStatus * ReturnStatus=NULL ) const
MStatus setInstanceable ( const bool how )
bool isInstanced ( bool indirect = true, MStatus * ReturnStatus = NULL ) const
bool isInstancedAttribute ( const MObject & attr, MStatus * ReturnStatus = NULL ) const
unsigned int instanceCount ( bool total, MStatus * ReturnStatus = NULL ) const
MObject duplicate ( bool instance = false, bool instanceLeaf = false, MStatus * ReturnStatus = NULL ) const
MStatus getPath ( MDagPath & path )
MStatus getAllPaths ( MDagPathArray & paths )
MString fullPathName ( MStatus *ReturnStatus = NULL)
MString partialPathName ( MStatus *ReturnStatus = NULL)
MMatrix transformationMatrix ( MStatus * ReturnStatus = NULL ) const
bool isIntermediateObject ( MStatus * ReturnStatus = NULL ) const
MStatus setIntermediateObject ( bool isIntermediate )
int objectColor ( MStatus * ReturnStatus = NULL ) const
MStatus setObjectColor ( int color )
bool usingObjectColor ( MStatus * ReturnStatus = NULL ) const
MStatus setUseObjectColor ( bool useObjectColor )
MBoundingBox boundingBox ( MStatus * ReturnStatus = NULL ) const
MDagPath dagPath ( MStatus * ReturnStatus = NULL ) const
virtual MStatus setObject ( const MDagPath & path )
virtual MStatus setObject ( MObject & object )
MObject model ( MStatus * ReturnStatus = NULL ) const
virtual MStatus setObject ( const MObject & object )

Inherited from MFnDependencyNode:

public members:

virtual MFn::Type type () const
enum MAttrClass
kGlobalDynamicAttr
kLocalDynamicAttr
MObject create ( const MTypeId & typeId , MStatus * ReturnStatus = NULL )
MObject create ( const MTypeId & typeId , const MString & name , MStatus * ReturnStatus = NULL )
MObject create ( const MString & type , MStatus * ReturnStatus = NULL )
MObject create ( const MString & type , const MString & name , MStatus * ReturnStatus = NULL )
MTypeId typeId ( MStatus * ReturnStatus = NULL ) const
MString typeName ( MStatus * ReturnStatus = NULL ) const
MString name ( MStatus * ReturnStatus = NULL ) const
MString setName ( const MString & name , MStatus * ReturnStatus = NULL )
MStatus getConnections ( MPlugArray & array ) const
unsigned int attributeCount ( MStatus * ReturnStatus=NULL) const
MObject attribute ( unsigned int index, MStatus * ReturnStatus=NULL) const
MObject reorderedAttribute ( unsigned int index, MStatus * ReturnStatus=NULL) const
MObject attribute ( const MString & attrName, MStatus * ReturnStatus=NULL) const
MAttrClass attributeClass ( const MObject & attr, MStatus * ReturnStatus=NULL) const
MStatus getAffectedAttributes ( const MObject & attr, MObjectArray & affectedAttributes ) const
MStatus getAffectedByAttributes ( const MObject & attr, MObjectArray & affectedByAttributes ) const
MPlug findPlug ( const MObject & attr, bool wantNetworkedPlug, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MString & attrName, bool wantNetworkedPlug, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MObject & attr, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MString & attrName, MStatus * ReturnStatus=NULL) const
MStatus addAttribute ( const MObject & attr, MAttrClass type = kLocalDynamicAttr )
MStatus removeAttribute ( const MObject & attr, MAttrClass type = kLocalDynamicAttr )
MPxNode * userNode ( MStatus * ReturnStatus=NULL ) const
bool isFromReferencedFile ( MStatus * ReturnStatus=NULL) const
bool isShared ( MStatus * ReturnStatus=NULL) const
bool hasUniqueName ( MStatus * ReturnStatus=NULL) const
MString parentNamespace ( MStatus * ReturnStatus=NULL) const
bool isLocked ( MStatus * ReturnStatus=NULL) const
MStatus setLocked ( bool locked )
static MString classification ( const MString & nodeTypeName )
bool isNewAttribute ( const MObject & attr, MStatus * ReturnStatus=NULL) const
static unsigned int allocateFlag ( const MString pluginName, MStatus * ReturnStatus=NULL )
static MStatus deallocateFlag (const MString pluginName, unsigned int flag)
static MStatus deallocateAllFlags (const MString pluginName)
MStatus setFlag (unsigned int flag, bool state)
bool isFlagSet (unsigned int flag, MStatus * ReturnStatus=NULL) const
bool isDefaultNode ( MStatus * ReturnStatus=NULL) const
MStatus setDoNotWrite ( bool flag )
bool canBeWritten ( MStatus * ReturnStatus=NULL) const
bool hasAttribute (const MString & name , MStatus * ReturnStatus=NULL) const
MObject getAliasAttr (bool force, MStatus * ReturnStatus=NULL)
bool setAlias (const MString & alias,const MString & name , const MPlug & plug, bool add=true, MStatus * ReturnStatus=NULL)
bool findAlias (const MString & alias, MObject & attrObj, MStatus * ReturnStatus=NULL) const
bool getAliasList ( MStringArray & strArray, MStatus * ReturnStatus=NULL)
MString plugsAlias (const MPlug & plug, MStatus * ReturnStatus=NULL)
public
bool getPlugsAlias (const MPlug & plug, MString & aliasName, MStatus * ReturnStatus=NULL)

Inherited from MFnBase:

public members:

virtual MFn::Type type () const
bool hasObj ( MFn::Type ) const
bool hasObj ( const MObject & ) const
MObject object ( MStatus * ReturnStatus = NULL ) const
virtual MStatus setObject ( MObject & object )
virtual MStatus setObject ( const MObject & object )

Documentation

Methods for creating and accessing transform nodes.
Description

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):

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.

Functions

MFnTransform:: MFnTransform ()

Description

Default class constructor. The function set is not attached to an MObject.

MFnTransform:: MFnTransform ( MObject & object, MStatus * ReturnStatus )

Description

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

Arguments

  • object the MObject to attach the function set to
  • ReturnStatus the return status
    • 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:: MFnTransform ( const MObject & object, MStatus * ReturnStatus )

Description

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

Arguments

  • object the const MObject to attach the function set to
  • ReturnStatus the return status
    • 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:: MFnTransform ( const MDagPath & object, MStatus * ReturnStatus )

Description

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

Arguments

  • object the const MDagPath to attach the function set to
  • ReturnStatus the return status
    • 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

MFn::Type MFnTransform:: type () const

Description

Return the type of this function set.

Return Value

  • the constant MFn::kTransform

MFnTransform:: ~MFnTransform ()

Description

Class Destructor

MObject MFnTransform:: create ( MObject parent, MStatus * ReturnStatus )

Description

Creates a new transformation node. The new node is placed in the DAG.

Arguments

  • parent the parent of the transform to be created
  • ReturnStatus status code

Return Value

  • 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

MStatus MFnTransform:: getScale ( double scale[3] ) const

Description

Retrieve the scaling component of this transformation.

Arguments

  • scale Storage for the scale of the transform

Return Value

Status code

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure object error

MStatus MFnTransform:: setScale (const double scale[3] )

Description

Set the scaling component of this transformation.

Arguments

  • scale The scale of the transform

Return Value

Status code

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure object error

MStatus MFnTransform:: scaleBy ( const double scale[3] )

Description

Relatively scale this transformation.

Arguments

  • scale The ratio by which to scale the transform

Return Value

Status code

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure object error

MStatus MFnTransform:: getShear ( double shear[3] ) const

Description

Retrieve the shearing component of this transformation.

Arguments

  • shear Storage for the shear of the transform

Return Value

Status code

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure object error

MStatus MFnTransform:: setShear ( const double shear[3] )

Description

Set the shearing component of this transformation.

Arguments

  • shear The shear of the transform

Return Value

Status code

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure object error

MStatus MFnTransform:: shearBy ( const double shear[3] )

Description

Relatively shear this transformation.

Arguments

  • shear The ratio by which to shear the transform

Return Value

Status code

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure object error

MStatus MFnTransform:: getRotation ( MQuaternion &quaternion, MSpace::Space space ) const

Description

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.

Arguments

  • quaternion the quaternion
  • space transform space in which to get the rotation

Return Value

Status code

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter invalid transform space
  • MS::kFailure object error

MStatus MFnTransform:: setRotation ( const MQuaternion &quaternion, MSpace::Space space )

Description

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.

Arguments

  • quaternion the quaternion
  • space transform space in which to perform the rotation

Return Value

Status code

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter invalid transform space
  • MS::kFailure object error

MStatus MFnTransform:: rotateBy ( const MQuaternion &quaternion, MSpace::Space space )

Description

Relatively change the rotation of this transformation using a quaternion.

Arguments

  • quaternion the quaternion
  • space transform space in which to perform the rotation

Return Value

Status code

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter invalid transform space
  • MS::kFailure object error

MStatus MFnTransform:: getRotation ( MEulerRotation &rotation ) const

Description

Retrieve the rotation component of this transformation. The rotation is retrieved in MSpace::kTransform space.

Arguments

  • rotation the euler rotation in radians

Return Value

Status code

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure object error

MStatus MFnTransform:: setRotation ( const MEulerRotation &rotation )

Description

Change the rotation component of this transformation. The rotation is set in MSpace::kTransform space.

Arguments

  • rotation the euler rotation

Return Value

Status code

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure object error

MStatus MFnTransform:: rotateBy ( const MEulerRotation &rotation, MSpace::Space space )

Description

Relatively change the rotation component of this transformation.

Arguments

  • rotation the euler rotation

Return Value

Status code

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter invalid transform space
  • MS::kFailure object error

MStatus MFnTransform:: getRotationQuaternion ( double &x, double &y, double &z, double &w, MSpace::Space space ) const

Description

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.

Arguments

  • x storage for the x component of the quaternion
  • y storage for the y component of the quaternion
  • z storage for the z component of the quaternion
  • w storage for the w component of the quaternion
  • space transform space in which to get the rotation

Return Value

Status code

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter invalid transform space
  • MS::kFailure object error

MStatus MFnTransform:: setRotationQuaternion (double x, double y, double z, double w, MSpace::Space space )

Description

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.

Arguments

  • x x component of the quaternion
  • y y component of the quaternion
  • z z component of the quaternion
  • w w component of the quaternion
  • space transform space in which to perform the rotation

Return Value

Status code

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter invalid transform space
  • MS::kFailure object error

MStatus MFnTransform:: rotateByQuaternion (double x, double y, double z, double w, MSpace::Space space)

Description

Relatively change the rotation of this transformation using a quaternion.

Arguments

  • x x component of the quaternion
  • y y component of the quaternion
  • z z component of the quaternion
  • w w component of the quaternion
  • space transform space in which to perform the rotation

Return Value

Status code

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter invalid transform space
  • MS::kFailure object error

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

Description

Retrieve the rotation component of this transformation. The rotation is retrieved in MSpace::kTransform space.

Arguments

  • rotation storage for the rotation components
  • order storage for the order of rotation

Return Value

Status code

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure object error

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

Description

Change the rotation component of this transformation. The rotation is set in MSpace::kTransform space.

Arguments

  • rotation the new rotation components
  • order the order in which to apply the rotations

Return Value

Status code

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure object error

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

Description

Relatively change the rotation component of this transformation.

Arguments

  • rotation the relative rotation components
  • order the order in which to apply the rotations
  • space transform space in which to perform the rotation

Return Value

Status code

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter invalid transform space
  • MS::kFailure object error

MVector MFnTransform:: translation ( MSpace::Space space, MStatus * ReturnStatus) const

Description

THIS IS AN OBSOLETE METHOD

Retrieve the translation component of this transformation in centimeters. This method has been replaced by MFnTransform::getTranslation and will be removed in a future Maya release.

Arguments

  • space transform space in which to get the translation
  • ReturnStatus return status

Return Value

Translation vector in centimeters

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter invalid transform space
  • MS::kFailure object error

MVector MFnTransform:: getTranslation ( MSpace::Space space, MStatus * ReturnStatus) const

Description

Retrieve the translation component of this transformation in centimeters.

Arguments

  • space transform space in which to get the translation
  • ReturnStatus return status

Return Value

Translation vector in centimeters

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter invalid transform space
  • MS::kFailure object error

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

Description

Change the translation component of this transformation.

Arguments

  • vector the new translation vector in centimeters
  • space transform space in which to perform the translation

Return Value

Status code

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter invalid transform space
  • MS::kFailure object error

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

Description

Relatively change the translation component of this transformation.

Arguments

  • vector the relative translation vector
  • space transform space in which to perform the translation

Return Value

Status code

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter invalid transform space
  • MS::kFailure object error

MPoint MFnTransform:: scalePivot ( MSpace::Space space, MStatus * ReturnStatus) const

Description

Returns the pivot around which the scale is applied. The pivot will be in centimeters.

Arguments

  • space space in which to get the pivot
  • ReturnStatus return status

Return Value

  • scale pivot point in centimeters

Status Codes

  • MS::kSuccess success
  • MS::kInvalidParameter invalid space
  • MS::kFailure object error

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

Description

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.

Arguments

  • point new scale pivot in centimeters
  • space transform space in which to set the scale pivot
  • balance whether to balance the matrix

Return Value

  • return status

Status Codes

  • MS::kSuccess success
  • MS::kInvalidParameter invalid space
  • MS::kFailure object error

MVector MFnTransform:: scalePivotTranslation ( MSpace::Space space, MStatus * ReturnStatus) const

Description

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.

Arguments

  • space space in which to get the scale pivot translation
  • ReturnStatus return status

Return Value

  • scale pivot translation in centimeters

Status Codes

  • MS::kSuccess success
  • MS::kInvalidParameter invalid space
  • MS::kFailure object error

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

Description

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.

Arguments

  • vector new scale pivot translation in centimeters
  • space transform space in which to set the scale translation

Return Value

  • return status

Status Codes

  • MS::kSuccess success
  • MS::kInvalidParameter invalid space
  • MS::kFailure object error

MPoint MFnTransform:: rotatePivot ( MSpace::Space space, MStatus * ReturnStatus) const

Description

Returns the pivot about which the rotation is applied.

Arguments

  • space space in which to get the pivot
  • ReturnStatus return status

Return Value

  • rotation pivot point in centimeters

Status Codes

  • MS::kSuccess success
  • MS::kInvalidParameter invalid space
  • MS::kFailure object error

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

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.

Arguments

  • point new rotation pivot in centimeters
  • space transform space in which to set the pivot
  • balance whether to balance the matrix

Return Value

  • return status

Status Codes

  • MS::kSuccess success
  • MS::kInvalidParameter invalid space
  • MS::kFailure object error

MQuaternion MFnTransform:: rotateOrientation ( MSpace::Space space, MStatus * ReturnStatus) const

Description

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.

Arguments

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

Return Value

  • rotateOrientation

Status Codes

  • MS::kSuccess success
  • MS::kInvalidParameter invalid space
  • MS::kFailure object error

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

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.

Arguments

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

Return Value

  • return status

Status Codes

  • MS::kSuccess success
  • MS::kInvalidParameter invalid space
  • MS::kFailure object error

MVector MFnTransform:: rotatePivotTranslation ( MSpace::Space space, MStatus * ReturnStatus) const

Description

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.

Arguments

  • space space in which to get the pivot translation
  • ReturnStatus return status

Return Value

  • scale pivot translation in centimeters

Status Codes

  • MS::kSuccess success
  • MS::kInvalidParameter invalid space
  • MS::kFailure object error

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

Description

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.

Arguments

  • vector new rotation pivot translation in centimeters
  • space transform space in which to set the rotation pivot translation

Return Value

  • return status

Status Codes

  • MS::kSuccess success
  • MS::kInvalidParameter invalid space
  • MS::kFailure object error

MTransformationMatrix::RotationOrder MFnTransform:: rotationOrder ( MStatus * ReturnStatus ) const

Description

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

Arguments

  • ReturnStatus return status

Return Value

rotation order

Status Codes

  • MS::kSuccess success
  • MS::kFailure object error

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

Description

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

Arguments

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

Return Value

status code

Status Codes

  • MS::kSuccess success
  • MS::kFailure object error

MTransformationMatrix MFnTransform:: transformation ( MStatus * ReturnStatus ) const

Description

Retrieve the transformation matrix represented by this transform.

Arguments

  • ReturnStatus status code

Return Value

The transformation matrix represented by this transform.

Status Codes

  • MS::kSuccess success
  • MS::kFailure object error

MStatus MFnTransform:: set ( const MTransformationMatrix & transform )

Description

Change this transform to equal the given matrix.

Arguments

  • transform the matrix to copy

Return Value

status code

Status Codes

  • MS::kSuccess success
  • MS::kFailure object error

MTransformationMatrix MFnTransform:: restPosition ( MStatus * ReturnStatus) const

Description

Retrieve the saved rest position of this transform.

Arguments

  • ReturnStatus status code

Return Value

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 MFnTransform:: clearRestPosition ()

Description

Clear the saved rest position of this transform.

Return Value

status code

Status Codes

  • MS::kSuccess success
  • MS::kFailure object error

MStatus MFnTransform:: setRestPosition ( const MTransformationMatrix & matrix )

Description

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.

Arguments

  • matrix the new rest position for this transform

Return Value

status code

Status Codes

  • MS::kSuccess success
  • MS::kFailure object error

MStatus MFnTransform:: resetFromRestPosition ()

Description

Reset the transform to its rest position.

Return Value

status code

Status Codes

  • MS::kSuccess success
  • MS::kFailure object error

bool MFnTransform:: isLimited ( MFnTransform::LimitType type , MStatus * ReturnStatus) const

Description

Determine if the specified limit attribute is enabled or disabled.

Arguments

  • type type to query limit
  • ReturnStatus status code

Return Value

True or false, true means the limit is enabled.

Status Codes

  • MS::kSuccess success
  • MS::kFailure object error

double MFnTransform:: limitValue ( MFnTransform::LimitType type , MStatus * ReturnStatus) const

Description

Determine the current value of the specified limit.

Arguments

  • type type to query limit
  • ReturnStatus status code

Return Value

Current value of the specified limit as internal unit.

Status Codes

  • MS::kSuccess success
  • MS::kFailure object error

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

Description

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

Arguments

  • type type to apply a limit
  • value new limit value as internal unit

Return Value

status code

Status Codes

  • MS::kSuccess success
  • MS::kFailure object error

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

Description

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

Arguments

  • type type to apply a limit
  • flag true or false to enable

Return Value

status code

Status Codes

  • MS::kSuccess success
  • MS::kFailure object error

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

Description

THIS IS AN OBSOLETE METHOD

This method will be removed in a future Maya release. The transformation space argument was always treated as MSpace::kTransform regardless of the actual argument. Please use the other MFnTransform::getRotation method for equivalent functionality.

Retrieve the rotation component of this transformation.

Arguments

  • rotation storage for the rotation components
  • order storage for the order of rotation
  • space transform space in which to get the rotation

Return Value

Status code

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter invalid transform space
  • MS::kFailure object error

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

Description

THIS IS AN OBSOLETE METHOD

This method will be removed in a future Maya release. The transformation space argument was always treated as MSpace::kTransform regardless of the actual argument. Please use the other MFnTransform::setRotation method for equivalent functionality.

Change the rotation component of this transformation.

Arguments

  • rotation the new rotation components
  • order the order in which to apply the rotations
  • space transform space in which to perform the rotation

Return Value

Status code

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter invalid transform space
  • MS::kFailure object error

Direct child classes:

- MFnManip3D
- MFnIkJoint
- MFnIkHandle
- MFnIkEffector
- MFnHikEffector

Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright