class MPxTransform

Jump to documentation

: public MPxNode Base class for user defined transforms. (OpenMaya) (OpenMayaMPx.py)

Inheritance:

MPxTransform < MPxNode

public members:

MPxTransform ()
MPxTransform ( MPxTransformationMatrix *)
virtual ~MPxTransform ()
virtual void postConstructor ()
virtual MPxNode::Type type () const
virtual MPxTransformationMatrix *createTransformationMatrix ()
virtual bool isBounded () const
virtual MBoundingBox boundingBox () const
const MPxTransformationMatrix &transformationMatrix () const
MPxTransformationMatrix *transformationMatrixPtr () const
virtual void resetTransformation (const MMatrix &)
virtual void resetTransformation ( MPxTransformationMatrix *)
virtual MStatus compute (const MPlug & plug, MDataBlock & data)
virtual MStatus computeLocalTransformation ( MPxTransformationMatrix *, MDataBlock &)
virtual MStatus clearLimits ()
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)
virtual MStatus validateAndSetValue (const MPlug &, const MDataHandle &, const MDGContext &)
virtual MMatrix getMatrix (const MDGContext & = MDGContext::fsNormal , MStatus *ReturnStatus = NULL)
virtual MMatrix getMatrixInverse (const MDGContext & = MDGContext::fsNormal , MStatus *ReturnStatus = NULL)
virtual MVector getTranslation ( MSpace::Space = MSpace::kTransform , const MDGContext & = MDGContext::fsNormal , MStatus *ReturnStatus = NULL)
virtual MStatus translateTo (const MVector &, MSpace::Space = MSpace::kTransform , const MDGContext & = MDGContext::fsNormal )
virtual MStatus translateBy (const MVector &, MSpace::Space = MSpace::kTransform , const MDGContext & = MDGContext::fsNormal )
virtual MQuaternion getRotation ( MSpace::Space = MSpace::kTransform , const MDGContext & = MDGContext::fsNormal , MStatus *ReturnStatus = NULL)
virtual MEulerRotation getEulerRotation ( MSpace::Space = MSpace::kTransform , const MDGContext & = MDGContext::fsNormal , MStatus *ReturnStatus = NULL)
virtual MStatus rotateTo (const MQuaternion &, MSpace::Space = MSpace::kTransform , const MDGContext & = MDGContext::fsNormal )
virtual MStatus rotateBy (const MQuaternion &, MSpace::Space = MSpace::kTransform , const MDGContext & = MDGContext::fsNormal )
virtual MStatus rotateTo (const MEulerRotation &, MSpace::Space = MSpace::kTransform , const MDGContext & = MDGContext::fsNormal )
virtual MStatus rotateBy (const MEulerRotation &, MSpace::Space = MSpace::kTransform , const MDGContext & = MDGContext::fsNormal )
virtual MVector getScale ( MSpace::Space = MSpace::kTransform , const MDGContext & = MDGContext::fsNormal , MStatus *ReturnStatus = NULL)
virtual MStatus scaleTo (const MVector &, MSpace::Space = MSpace::kTransform , const MDGContext & = MDGContext::fsNormal )
virtual MStatus scaleBy (const MVector &, MSpace::Space = MSpace::kTransform , const MDGContext & = MDGContext::fsNormal )
virtual MVector getShear ( MSpace::Space = MSpace::kTransform , const MDGContext & = MDGContext::fsNormal , MStatus *ReturnStatus = NULL)
virtual MStatus shearTo (const MVector &, MSpace::Space = MSpace::kTransform , const MDGContext & = MDGContext::fsNormal )
virtual MStatus shearBy (const MVector &, MSpace::Space = MSpace::kTransform , const MDGContext & = MDGContext::fsNormal )
virtual MPoint getScalePivot ( MSpace::Space = MSpace::kTransform , const MDGContext & = MDGContext::fsNormal , MStatus *ReturnStatus = NULL)
virtual MPoint getRotatePivot ( MSpace::Space = MSpace::kTransform , const MDGContext & = MDGContext::fsNormal , MStatus *ReturnStatus = NULL)
virtual MVector getScalePivotTranslation ( MSpace::Space = MSpace::kTransform , const MDGContext & = MDGContext::fsNormal , MStatus *ReturnStatus = NULL)
virtual MVector getRotatePivotTranslation ( MSpace::Space = MSpace::kTransform , const MDGContext & = MDGContext::fsNormal , MStatus *ReturnStatus = NULL)
virtual MStatus setScalePivot (const MPoint &, MSpace::Space = MSpace::kTransform , bool balance = true, const MDGContext & = MDGContext::fsNormal )
virtual MStatus setScalePivotTranslation (const MVector &, MSpace::Space = MSpace::kTransform , const MDGContext & = MDGContext::fsNormal )
virtual MStatus setRotatePivot (const MPoint &, MSpace::Space = MSpace::kTransform , bool balance = true, const MDGContext & = MDGContext::fsNormal )
virtual MStatus setRotatePivotTranslation (const MVector &, MSpace::Space = MSpace::kTransform , const MDGContext & = MDGContext::fsNormal )
virtual MStatus setRotationOrder ( MTransformationMatrix::RotationOrder ro, bool reorder = true, const MDGContext & apiContext = MDGContext::fsNormal )
virtual MQuaternion getRotateOrientation ( MSpace::Space apiSpace = MSpace::kTransform , const MDGContext &apiContext = MDGContext::fsNormal , MStatus *ReturnStatus = NULL)
virtual MStatus setRotateOrientation (const MQuaternion &q, MSpace::Space apiSpace = MSpace::kTransform , bool balance = true, const MDGContext &apiContext = MDGContext::fsNormal )
void updateMatrixAttrs (const MDGContext & apiContext = MDGContext::fsNormal )
MStatus updateMatrixAttrs ( MObject &attr, const MDGContext &context = MDGContext::fsNormal )
static void mustCallValidateAndSet ( MObject &)
static MStatus setNonAffineMatricesEnabled (bool)
static bool isNonAffineMatricesEnabled ( MStatus *ReturnStatus)
virtual void copyInternalData ( MPxNode * )
static MObject nodeBoundingBox
bounding box attribute
static MObject nodeBoundingBoxMin
bounding box minimum point
static MObject nodeBoundingBoxMinX
X component of nodeBoundingBoxMin
static MObject nodeBoundingBoxMinY
Y component of nodeBoundingBoxMin
static MObject nodeBoundingBoxMinZ
Z component of nodeBoundingBoxMin
static MObject nodeBoundingBoxMax
bounding box maximum point
static MObject nodeBoundingBoxMaxX
X component of nodeBoundingBoxMax
static MObject nodeBoundingBoxMaxY
Y component of nodeBoundingBoxMax
static MObject nodeBoundingBoxMaxZ
Z component of nodeBoundingBoxMax
static MObject nodeBoundingBoxSize
bounding box size vector
static MObject nodeBoundingBoxSizeX
X component of nodeBoundingBoxSize
static MObject nodeBoundingBoxSizeY
Y component of nodeBoundingBoxSize
static MObject nodeBoundingBoxSizeZ
Z component of nodeBoundingBoxSize
static MObject center
object center attribute
static MObject boundingBoxCenterX
X component of the bounding box center
static MObject boundingBoxCenterY
Y component of the bounding box center
static MObject boundingBoxCenterZ
Z component of the bounding box center
static MObject matrix
matrix attribute
static MObject inverseMatrix
inverse matrix attribute
static MObject worldMatrix
world matrix attribute
static MObject worldInverseMatrix
Inverse world matrix attribute
static MObject parentMatrix
Parent matrix attribute
static MObject parentInverseMatrix
Inverse parent matrix attribute
static MObject visibility
Visibility attribute
static MObject intermediateObject
Intermediate object attribute
static MObject isTemplated
Template attribute
static MObject ghosting
Ghosting attribute
static MObject instObjGroups
Instances object group info attribute
static MObject objectGroups
Object groups attributes
static MObject objectGrpCompList
Component in object groups attribute
static MObject objectGroupId
Group id attribute
static MObject objectGroupColor
Group id attribute
static MObject useObjectColor
Controls choice of wireframe dormant object color
static MObject objectColor
The per object dormant wireframe color
static MObject drawOverride
static MObject overrideDisplayType
static MObject overrideLevelOfDetail
static MObject overrideShading
static MObject overrideTexturing
static MObject overridePlayback
static MObject overrideEnabled
static MObject overrideVisibility
static MObject overrideColor
static MObject lodVisibility
static MObject renderInfo
Obsolete attribute
static MObject identification
Obsolete attribute
static MObject layerRenderable
Obsolete attribute
static MObject layerOverrideColor
Obsolete attribute
static MObject renderLayerInfo
Render layer attribute
static MObject renderLayerId
Render layer attribute
static MObject renderLayerRenderable
Render layer attribute
static MObject renderLayerColor
Render layer attribute
static MObject translate
translate attribute
static MObject translateX
translateX attribute
static MObject translateY
translateY attribute
static MObject translateZ
translateZ attribute
static MObject rotate
rotate attribute
static MObject rotateX
rotateX attribute
static MObject rotateY
rotateY attribute
static MObject rotateZ
rotateZ attribute
static MObject rotateOrder
Rotate order attribute
static MObject scale
scale attribute
static MObject scaleX
scaleX attribute
static MObject scaleY
scaleY attribute
static MObject scaleZ
scaleZ attribute
static MObject shearXY
shearXY attribute
static MObject shearXZ
shearXZ attribute
static MObject shearYZ
shearYZ attribute
static MObject rotatePivot
rotate pivot attribute
static MObject rotatePivotX
rotate pivot X attribute
static MObject rotatePivotY
rotate pivot Y attribute
static MObject rotatePivotZ
rotate pivot Z attribute
static MObject rotatePivotTranslate
rotate pivot translate attribute
static MObject rotatePivotTranslateX
rotate pivot translate X attribute
static MObject rotatePivotTranslateY
rotate pivot translate Y attribute
static MObject rotatePivotTranslateZ
rotate pivot translate Z attribute
static MObject scalePivot
scale pivot attribute
static MObject scalePivotX
scale pivot X attribute
static MObject scalePivotY
scale pivot Y attribute
static MObject scalePivotZ
scale pivot Z attribute
static MObject scalePivotTranslate
Scale pivot translate attribute
static MObject scalePivotTranslateX
scale pivot translate X attribute
static MObject scalePivotTranslateY
scale pivot translate Y attribute
static MObject scalePivotTranslateZ
scale pivot translate Z attribute
static MObject rotateAxis
Rotate orientation attribute
static MObject rotateAxisX
rotate orientation X attribute
static MObject rotateAxisY
rotate orientation Y attribute
static MObject rotateAxisZ
rotate orientation Z attribute
static MObject transMinusRotatePivot
translate minus rotate pivot attribute
static MObject transMinusRotatePivotX
translateX minus rotate pivotX attribute
static MObject transMinusRotatePivotY
translateY minus rotate pivotY attribute
static MObject transMinusRotatePivotZ
translateZ minus rotate pivotZ attribute
static MObject minTransLimit
Minumum translation limits attribute
static MObject minTransXLimit
Minimum translate X limit attribute
static MObject minTransYLimit
Minimum translate Y limit attribute
static MObject minTransZLimit
Minimum translate Z limit attribute
static MObject maxTransLimit
Maximum translation limits attribute
static MObject maxTransXLimit
Maximum translate X limit attribute
static MObject maxTransYLimit
Maximum translate Y limit attribute
static MObject maxTransZLimit
Maximum translate Z limit attribute
static MObject minTransLimitEnable
Enable the mimimum translation limits attribute
static MObject minTransXLimitEnable
Enable the minimum translate X limit attribute
static MObject minTransYLimitEnable
Enable the minimum translate Y limit attribute
static MObject minTransZLimitEnable
Enable the minimum translate Z limit attribute
static MObject maxTransLimitEnable
Enable the maximum translation limits attribute
static MObject maxTransXLimitEnable
Enable the maximum translate X limit attribute
static MObject maxTransYLimitEnable
Enable the maximum translate Y limit attribute
static MObject maxTransZLimitEnable
Enable the maximum translate Z limit attribute
static MObject minRotLimit
Minimum rotation limits attribute
static MObject minRotXLimit
Minimum rotate X limit attribute
static MObject minRotYLimit
Minimum rotate Y limit attribute
static MObject minRotZLimit
Minimum rotate Z limit attribute
static MObject maxRotLimit
Maximum rotation limits attribute
static MObject maxRotXLimit
Maximum rotate X limit attribute
static MObject maxRotYLimit
Maximum rotate Y limit attribute
static MObject maxRotZLimit
Maximum rotate Z limit attribute
static MObject minRotLimitEnable
Enable minimum rotation limits attribute
static MObject minRotXLimitEnable
Enable minimum rotate X limit attribute
static MObject minRotYLimitEnable
Enable minimum rotate Y limit attribute
static MObject minRotZLimitEnable
Enable minimum rotate Z limit attribute
static MObject maxRotLimitEnable
Enable maximum rotation limits attribute
static MObject maxRotXLimitEnable
Enable maximum rotate X limit attribute
static MObject maxRotYLimitEnable
Enable maximum rotate Y limit attribute
static MObject maxRotZLimitEnable
Enable maximum rotate Z limit attribute
static MObject minScaleLimit
Minimum scale limit attribute
static MObject minScaleXLimit
Minimum scale X limit attribute
static MObject minScaleYLimit
Minimum scale Y limit attribute
static MObject minScaleZLimit
Minimum scale Z limit attribute
static MObject maxScaleLimit
Maximum scale limit attribute
static MObject maxScaleXLimit
Maximum scale X limit attribute
static MObject maxScaleYLimit
Maximum scale Y limit attribute
static MObject maxScaleZLimit
Maximum scale Z limit attribute
static MObject minScaleLimitEnable
Enable minimum scale limit attribute
static MObject minScaleXLimitEnable
Enable minimum scale X limit attribute
static MObject minScaleYLimitEnable
Enable minimum scale Y limit attribute
static MObject minScaleZLimitEnable
Enable minimum scale Z limit attribute
static MObject maxScaleLimitEnable
Enable aximum scale limit attribute
static MObject maxScaleXLimitEnable
Enable maximum scale X limit attribute
static MObject maxScaleYLimitEnable
Enable maximum scale Y limit attribute
static MObject maxScaleZLimitEnable
Enable maximum scale Z limit attribute
static MObject geometry
static MObject xformMatrix
static MObject selectHandle
static MObject selectHandleX
static MObject selectHandleY
static MObject selectHandleZ
static MObject inheritsTransform
static MObject displayHandle
static MObject displayScalePivot
static MObject displayRotatePivot
static MObject displayLocalAxis
static MObject dynamics
static MObject showManipDefault
static MObject specifiedManipLocation
static MObject rotateQuaternion
static MObject rotateQuaternionX
static MObject rotateQuaternionY
static MObject rotateQuaternionZ
static MObject rotateQuaternionW
static MObject rotationInterpolation

protected members:

virtual MVector applyTranslationLimits (const MVector &unclampedT, MDataBlock &block, MStatus *ReturnStatus = NULL)
virtual MVector applyTranslationLocks (const MVector &toTest, const MVector &savedT, MStatus *ReturnStatus = NULL)
virtual MEulerRotation applyRotationLimits (const MEulerRotation &unclampedR, MDataBlock &block, MStatus *ReturnStatus = NULL)
virtual MEulerRotation applyRotationLocks (const MEulerRotation &toTest, const MEulerRotation &savedR, MStatus *ReturnStatus = NULL)
virtual MVector applyScaleLimits (const MVector &unclampedS, MDataBlock &block, MStatus *ReturnStatus = NULL)
virtual MVector applyScaleLocks (const MVector &toTest, const MVector &savedS, MStatus *ReturnStatus = NULL)
virtual MVector applyShearLocks (const MVector &toTest, const MVector &savedSh, MStatus *ReturnStatus = NULL)
virtual MEulerRotation applyRotateOrientationLocks (const MEulerRotation &toTest, const MEulerRotation &savedRO, MStatus *ReturnStatus = NULL)
virtual MVector applyScaleLocksPivot (const MPoint &toTest, const MPoint &savedSP, MStatus *ReturnStatus = NULL)
virtual MVector applyRotatePivotLocks (const MPoint &toTest, const MPoint &savedRP, MStatus *ReturnStatus = NULL)
virtual MVector applyScaleLocksPivotTranslate (const MVector &toTest, const MVector &savedSPT, MStatus *ReturnStatus = NULL)
virtual MVector applyRotatePivotLocksTranslate (const MVector &toTest, const MVector &savedRPT, MStatus *ReturnStatus = NULL)
MStatus dirtyMatrix ()
USE _dirtyMatrix() IN SCRIPT
MStatus dirtyTranslation (const MVector &)
USE _dirtyTranslation() IN SCRIPT
MStatus dirtyRotation (const MEulerRotation &)
USE _dirtyRotation() IN SCRIPT
MStatus dirtyScale (const MVector &)
USE _dirtyScale() IN SCRIPT
MStatus dirtyShear (const MVector &)
USE _dirtyShear() IN SCRIPT
MStatus dirtyRotateOrientation (const MEulerRotation &)
USE _dirtyRotateOrientation() IN SCRIPT
MStatus dirtyScalePivot (const MPoint &)
USE _dirtyScalePivot() IN SCRIPT
MStatus dirtyRotatePivot (const MPoint &)
USE _dirtyRotatePivot() IN SCRIPT
MStatus dirtyScalePivotTranslation (const MVector &)
USE _dirtyScalePivotTranslation() IN SCRIPT
MStatus dirtyRotatePivotTranslation (const MVector &)
USE _dirtyRotatePivotTranslation() IN SCRIPT
virtual MStatus checkAndSetTranslation ( MDataBlock &block, const MPlug &, const MVector &, MSpace::Space = MSpace::kTransform )
virtual MStatus checkAndSetRotation ( MDataBlock &block, const MPlug &, const MEulerRotation &, MSpace::Space = MSpace::kTransform )
virtual MStatus checkAndSetScale ( MDataBlock &block, const MPlug &, const MVector &, MSpace::Space = MSpace::kTransform )
virtual MStatus checkAndSetShear ( MDataBlock &block, const MPlug &, const MVector &, MSpace::Space = MSpace::kTransform )
virtual MStatus checkAndSetRotateOrientation ( MDataBlock &block, const MPlug &, const MEulerRotation &, MSpace::Space = MSpace::kTransform , bool balance = true)
virtual MStatus checkAndSetRotatePivot ( MDataBlock &, const MPlug &, const MPoint &, MSpace::Space = MSpace::kTransform , bool balance = true)
virtual MStatus checkAndSetRotatePivotTranslation ( MDataBlock &, const MPlug &, const MVector &, MSpace::Space = MSpace::kTransform )
virtual MStatus checkAndSetScalePivot ( MDataBlock &, const MPlug &, const MPoint &, MSpace::Space = MSpace::kTransform , bool = true)
virtual MStatus checkAndSetScalePivotTranslation ( MDataBlock &, const MPlug &, const MVector &, MSpace::Space = MSpace::kTransform )

Inherited from MPxNode:

public members:

enum Type
kDependNode
kLocatorNode
kDeformerNode
kManipContainer
kSurfaceShape
kFieldNode
kEmitterNode
kSpringNode
kIkSolverNode
kHardwareShader
Custom shader derived from MPxHardwareShader
kHwShaderNode
Custom shader derived from MPxHwShaderNode
kTransformNode
kObjectSet
kFluidEmitterNode
kImagePlaneNode
kParticleAttributeMapperNode
kConstraintNode
kLast
virtual void postConstructor ()
virtual MStatus compute ( const MPlug & plug, MDataBlock & dataBlock )
virtual bool getInternalValueInContext ( const MPlug & plug, MDataHandle & dataHandle, MDGContext & ctx)
virtual bool setInternalValueInContext ( const MPlug & plug, const MDataHandle & dataHandle, MDGContext & ctx)
virtual bool getInternalValue ( const MPlug & plug, MDataHandle & dataHandle)
virtual bool setInternalValue ( const MPlug & plug, const MDataHandle & dataHandle)
virtual int internalArrayCount ( const MPlug & plug, const MDGContext & ctx) const
virtual void copyInternalData ( MPxNode * )
virtual MStatus legalConnection ( const MPlug & plug, const MPlug & otherPlug, bool asSrc, bool& isLegal ) const
virtual MStatus legalDisconnection ( const MPlug & plug, const MPlug & otherPlug, bool asSrc, bool& isLegal ) const
virtual MStatus setDependentsDirty ( const MPlug & plug, MPlugArray & plugArray)
virtual MStatus connectionMade ( const MPlug & plug, const MPlug & otherPlug, bool asSrc )
virtual MStatus connectionBroken ( const MPlug & plug, const MPlug & otherPlug, bool asSrc )
virtual bool isPassiveOutput ( const MPlug & plug ) const
virtual MStatus shouldSave ( const MPlug & plug, bool& isSaving )
virtual MPlug passThroughToOne ( const MPlug & plug ) const
virtual bool passThroughToMany ( const MPlug & plug, MPlugArray & plugArray ) const
MTypeId typeId () const
MString typeName () const
MString name () const
virtual Type type () const
virtual bool isAbstractClass () const
MObject thisMObject () const
static MStatus addAttribute ( const MObject & attr )
static MStatus inheritAttributesFrom ( const MString & parentClassName )
static MStatus attributeAffects ( const MObject & whenChanges, const MObject & isAffected )
MStatus setExistWithoutInConnections ( bool flag )
bool existWithoutInConnections ( MStatus * ReturnStatus = NULL ) const
MStatus setExistWithoutOutConnections ( bool flag )
bool existWithoutOutConnections ( MStatus * ReturnStatus = NULL ) const
static MObject message
static MObject isHistoricallyInteresting
static MObject caching
static MObject state

protected members:

MDataBlock forceCache ( MDGContext & ctx= MDGContext::fsNormal )
void setMPSafe ( bool flag )
MStatus setDoNotWrite ( bool flag )
bool doNotWrite ( MStatus *ReturnStatus = NULL ) const

Documentation

Create user defined locators.
Description

MPxTransform allows the creation of user defined transform nodes. User defined transform nodes can introduce new transform types or change the transformation order. They are designed to be an extension of the standard Maya transform node and include all of the normal transform attributes. Standard behaviors such as limit enforcement and attribute locking are managed by this class, but may be overriden in derived classes.

In general, a complete implementation of user defined transforms will require the deriving from two classes; MPxTransform defines the node while MPxTransformationMatrix describes the mathematical functions of the user defined transform.

The MPxTransform class is registered using the MFnPlugin::registerTransform() method. Both the MPxTransform and the MPxTransformationMatrix classes are registered in the same method. This allows for a clear association between a MPxTransform and a MPxTransformationMatrix. Both the MPxTransform and the MPxTransformationMatrix classes need unique MTypeIds.

MPxTransform nodes are DAG nodes and therefore a change to one element will affect every node beneath the changed node. Since this can involve quite a bit of calculation, DAG nodes internally handle clean and dirty differently than other nodes. What this means is that the updateMatrixAttrs() method should be used when getting one of the matrix attributes from a method on this node. Additionally, after a value is changed, the appropriate dirty method (i.e. dirtyTranslate(), dirtyRotate(), etc.) should be called. When in doubt, dirtyMatrix() will flag everything as needing to be updated.

It is up to each transform node to determine if it will obey limits or Since transform attributes may have limits or may be involved in some sort of constraint, there needs to be a way to accept, reject, or modify a value when a plug is set on the node. The mustCallValidateAndSet() method allows for this kind of control. When an attribute is flagged with the mustCallValidateAndSet() method in the initialize() method, every plug change will call the validateAndSetValue() method for approval. From the validateAndSetValue() method things like limits and value locking can be enforced. It is important to note that for new attributes on the transform node, any locking or limits are left as an implementation detail.

If any of the public methods are affected by the addition of transform components, or by the order of computation, they should be overriden in the derived class. Many of the public methods are used by internal Maya code and exist for more than just convenience.

The createTransformationMatrix() class must be overloaded if a transformation matrix other than the default MPxTransformationMatrix is used.

NOTES: 1) The setDependentsDirty() virtual method is available in this class since MPxTransform derives from MPxNode. During a call to MPxTransform::setDependentsDirty(), a plug-in should not invoke any of the dirty*() or updateMatrixAttrs() calls of this class. For example, the methods dirtyMatrix(), dirtyTranslation() or updateMatrixAttrs() should not be called. 2) Updating world space attributes is an expensive operation. Maya updates world space attributes on demand such as in the case of a getAttr being issued or a connection exists for the attribute.

Functions

MPxTransform:: MPxTransform ()
Constructor

Class constructor.

MPxTransform:: MPxTransform ( MPxTransformationMatrix *tm)

Description

Class constructor. The passed pointer to a MPxTransformationMatrix derived object will be used for the transformation matrix calculation. This class will assume responsibility to delete this memory.

Arguments

  • tm A pointer to a MPxTransformationMatrix derived object.

MPxTransform:: ~MPxTransform ()
Destructor

Class destructor.

void MPxTransform:: postConstructor ()
Description

Post constructor.

Internally maya creates two objects when a user defined node is created, the internal MObject and the user derived object. The association between the these two objects is not made until after the MPxNode constructor is called. This implies that no MPxNode member function can be called from the MPxNode constructor. The postConstructor will get called immediately after the constructor when it is safe to call any MPxNode member function.

MPxNode::Type MPxTransform:: type () const

Description

This method returns the type of the node. This method should not be overridden by the user. It will return MPxNode::kTransformNode.

Return Value

  • An enum specifying the node type.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

MPxTransformationMatrix *MPxTransform:: createTransformationMatrix ()

Description

This method returns a new transformation matrix. The function that calls this method is responsible for deleting the transformation matrix.

If a derived MPxTransformationMatrix is used as the transformation matrix for the node, then this method must be overridden.

Return Value

  • A pointer to the new transformation matrix.

bool MPxTransform:: isBounded () const

Description

This method should be overridden to return true if the user supplies a bounding box routine. Supplying a bounding box routine makes refresh and selection more efficient.

Return Value

  • A boolean value indicating whether a bounding box routine has been supplied.

MBoundingBox MPxTransform:: boundingBox () const

Description

This method should be overridden to return a bounding box for the transform. If this method is overridden, then MPxTransform::isBounded should also be overridden to return true.

Return Value

  • The bounding box of the transform.

MStatus MPxTransform:: clearLimits ()

Description

This method turns off all of the limits and sets them to their default values. Before this method is called, the base class clears all of the limits on the standard transform attributes, so this method only needs to be implemented for custom transform attributes.

Return Value

  • Return status.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

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

Description

Determine if the specified limit attribute is enabled or disabled.

Arguments

  • type An enum specifying the type of limit to query.
  • ReturnStatus Status.

Return Value

Returns true if the limit is enabled, otherwise false is returned.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

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

Description

Returns the current value of the specified limit in internal units as a double.

Arguments

  • type An enum indicating the type of limit to query.
  • ReturnStatus Status.

Return Value

Returns the current value of the specified limit in internal units as a double.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

MStatus MPxTransform:: 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 An enum indicating the limit to set.
  • value The new limit value in internal units (centimeters or radians).

Return Value

Status code.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

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

Description

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

Arguments

  • type An enum indicating the limit to enable or disable.
  • flag The enable value; true will enable while false will disable the limit.

Return Value

Status code.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

void MPxTransform:: resetTransformation (const MMatrix & matrix )

Description

This method will reset the transformation matrix to one that is constructed with the passed MMatrix. How the new transformation matrix is created will depend on the transformation matrix class and its decomposeMatrix() method.

Arguments

  • matrix The matrix used for resetting this transform.

void MPxTransform:: resetTransformation ( MPxTransformationMatrix *xform)

Description

This method will reset the transformation matrix to the one specified by the passed transformation matrix pointer. The contents of the passed transformation matrix are copied into this class's transformation matrix.

Arguments

  • xform A pointer to the source transformation matrix.

const MPxTransformationMatrix & MPxTransform:: transformationMatrix () const

Description

This method returns a reference to the transformation matrix used by this transform.

Return Value

  • The transformation matrix.

MStatus MPxTransform:: computeLocalTransformation ( MPxTransformationMatrix *xform, MDataBlock &block)

Description

This method computes the transformation matrix for a passed data block and places the output into a passed transformation matrix.

The caller needs to allocate space for the passed transformation matrix.

Arguments

  • xform The transformation matrix to fill with computed values.
  • block The data block used for the transformation matrix computation.

Return Value

  • Status code.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

MStatus MPxTransform:: compute (const MPlug & plug, MDataBlock & block)

Description

The transform's compute method. The compute method should call any supporting methods to proper handle limits as well as the cases where the plug's value should not change. The MPlug::isFreeToChange() method is used to determine if a plug's value may be changed.

When the compute method on derived classes is invoked for an attribute not handled by the derived class, the derived class should call MPxTransform::compute to allow the base classes to handle the attribute.

Arguments

  • plug The plug to compute.
  • block The data block.

Return Value

  • Status code.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.
  • MS::kUnknownParameter The parent class will be called.

MStatus MPxTransform:: validateAndSetValue (const MPlug & plug, const MDataHandle & handle, const MDGContext & context)

Description

When a plug's value is set, and the plug is on a default transform attribute, or has been flagged by the mustCallValidateAndSet() method, then this method will be called. The purpose of validateAndSetValue() is to enforce limits, constraints, or plug value locking.

If the plug passed into this method is not an attribute related to the derived class, the derived class should call the validateAndSetValue method of its parent class in order to allow the base classes to handle their attributes.

If any adjustments or corrections are required, they are placed in the data block and if the context is normal, into the cached transformation matrix. Values on the data block are in transform space.

Arguments

  • plug The plug that is to be set.
  • handle The inputValue handle of the data.
  • context The context for the data.

Return Value

  • Status code.

Status Codes

  • MS::kSuccess validateAndSet succeeded.
  • MS::kFailure validateAndSet failed.

MVector MPxTransform:: getTranslation ( MSpace::Space space , const MDGContext &context , MStatus *ReturnStatus )
Description

This method returns the translation component of the transform as a MVector in internal units (centimeters).

Arguments

  • space The space used for setting the translation.
  • context The context used for setting the translation.
  • ReturnStatus Return status.

Return Value

  • The translation MVector in internal units (centimeters).

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kInvalidParameter The method failed due to an invalid space being used.

MStatus MPxTransform:: translateTo (const MVector & newTrans, MSpace::Space space , const MDGContext &context )
Description

Set the translation component of the transform in centimeters.

Arguments

  • newTrans The new translation component in centimeters.
  • space The space in which to perform the translation.
  • context The context of the translation.

Return Value

  • Status code.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kInvalidParameter The method failed due to an invalid space being used.

MStatus MPxTransform:: translateBy (const MVector & transOffset, MSpace::Space space , const MDGContext &context )
Description

Add to the translation component by translating relative to the existing transform. The transform value should be in internal units (centimeters).

Arguments

  • transOffset The relative translation value in centimeters.
  • space The space in which to perform the translation.
  • context The context for the translation.

Return Value

  • Status code.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kInvalidParameter The method failed due to an invalid space being used.

MQuaternion MPxTransform:: getRotation ( MSpace::Space space , const MDGContext &context , MStatus *ReturnStatus )

Description

This method returns the rotation of the transform as a quaternion. The rotation is returned in MSpace::kTransform space. If an invalid space is used, MQuaternion::identity will be returned.

Arguments

  • space The space used for getting the rotate value.
  • context The context used for getting the rotate value.
  • ReturnStatus Return status.

Return Value

  • The rotate component of the transform as a quaternion.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kInvalidParameter The method failed due to an invalid space being used.

MEulerRotation MPxTransform:: getEulerRotation ( MSpace::Space space , const MDGContext &context , MStatus *ReturnStatus )

Description

Returns the rotation component of the transform as a euler rotation. The rotation is returned in MSpace::kTransform space. If an invalid space is used, MEulerRotation::identity will be returned.

Arguments

  • space The space used for getting the rotation.
  • context The context used for getting the rotation.
  • ReturnStatus Return status.

Return Value

  • The rotation component of the transform as an euler rotation.

Status Codes

  • MS::kSuccess Success
  • MS::kInvalidParameter Invalid space

MStatus MPxTransform:: rotateTo (const MQuaternion & newRot, MSpace::Space space , const MDGContext &context )

Description

Sets the rotation component of the transform using a quaternion. The rotation is performed in MSpace::kTransform space.

Arguments

  • newRot The new rotation value as a quaternion.
  • space The space of the passed rotation value.
  • context The context used for setting the rotation.

Return Value

  • Return Status.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kInvalidParameter The method failed due to an invalid space being used.

MStatus MPxTransform:: rotateBy (const MQuaternion & rotateOffset, MSpace::Space space , const MDGContext &context )

Description

Adds to the rotation component of the transform by rotating relative to the existing transformation using a quaternion. The only valid transformation spaces for this method are MSpace::kTransform and MSpace::kPreTransform. All other spaces are treated as being equivalent to MSpace::kTransform.

Arguments

  • rotateOffset The relative rotation to apply to the transform.
  • space The space of the passed rotation.
  • context The context used for setting the rotation.

Return Value

  • Status code.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kInvalidParameter The method failed due to an invalid space being used.

MStatus MPxTransform:: rotateTo (const MEulerRotation & euler, MSpace::Space space , const MDGContext &context )

Description

Sets the rotation component of the transform using an euler rotation.

Arguments

  • euler The new rotation value as an euler rotation.
  • space The space of the passed rotation value.
  • context The context used for setting the rotation.

Return Value

  • Status code.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kInvalidParameter The method failed due to an invalid space being used.

MStatus MPxTransform:: rotateBy (const MEulerRotation & euler, MSpace::Space space , const MDGContext &context )

Description

Adds to the rotation component of the transform by rotating relative to the existing transform using a euler rotation. The only valid transformation spaces for this method are MSpace::kTransform and MSpace::kPreTransform/MSpace::kObject. All other spaces are treated as being equivalent to MSpace::kTransform.

Arguments

  • euler The rotation value of the relative euler rotation.
  • space The space used for the relative rotation.
  • context The context used for setting the rotation.

Return Value

  • Status code.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kInvalidParameter The method failed due to an invalid space being used.

MVector MPxTransform:: getScale ( MSpace::Space space , const MDGContext &context , MStatus *ReturnStatus )
Description

Returns the scale component of the transform. If the space is invalid a <1.0, 1.0, 1.0> vector is returned.

Arguments

  • space The space used to get the scale.
  • context The context used to get the scale.
  • ReturnStatus The return status.

Return Value

  • A MVector holding the x, y, and z scale components

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kInvalidParameter The method failed.

MStatus MPxTransform:: scaleTo (const MVector &newScale, MSpace::Space space , const MDGContext &context )
Description

This method will set the scale of the transform to the passed value.

Arguments

  • newScale A MVector holding the scale components.
  • space The space of the passed scale value.
  • context The context used for setting the scale.

Return Value

  • Status code.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kInvalidParameter The method failed due to an invalid space being used.

MStatus MPxTransform:: scaleBy (const MVector &scaleOffset, MSpace::Space space , const MDGContext &context )
Description

This method will apply a relative scale to an existing scale.

Arguments

  • scaleOffset A MVector holding the scale components.
  • space The space of the passed scale values.
  • context The context used for the scale.

Return Value

  • Status code.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kInvalidParameter The method failed due to an invalid space being used.

MVector MPxTransform:: getShear ( MSpace::Space space , const MDGContext &context , MStatus *ReturnStatus )
Description

Get the shear value for this transform.

Arguments

  • space The space used for retrieving the shear value.
  • context The context used for getting the shear value.
  • ReturnStatus Return status.

Return Value

  • A MVector holding the xy, xz, yz values of shear.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kInvalidParameter The method failed due to an invalid space specification.

MStatus MPxTransform:: shearTo (const MVector &newShear, MSpace::Space space , const MDGContext &context )
Description

The method sets the shear component of the transform.

Arguments

  • newShear A MVector holding the new shear value.
  • space The space of the passed shear value.
  • context The context used for setting the shear value.

Return Value

  • Status code.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kInvalidParameter The method failed due to an invalid space being used.

MStatus MPxTransform:: shearBy (const MVector &shearOffset, MSpace::Space space , const MDGContext &context )
Description

This method will apply a relative shear to the existing shear.

Arguments

  • shearOffset The relative shear value as a MVector.
  • space The space of the passed shear value.
  • context The context used for setting the shear.

Return Value

  • Status code.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kInvalidParameter The method failed due to an invalid space being used.

MMatrix MPxTransform:: getMatrix (const MDGContext &context , MStatus *ReturnStatus )

Description

This method returns a 4x4 matrix that is produced by applying all of the components of the transform.

Arguments

  • context The context for getting the matrix.
  • ReturnStatus Return status.

Return Value

  • The transform as a MMatrix.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kInvalidParameter The method failed due to an invalid space being used.

MMatrix MPxTransform:: getMatrixInverse (const MDGContext &context , MStatus *ReturnStatus )

Description

This method returns the inverse of the 4x4 matrix that describes this transformation.

Arguments

  • context The context for getting the inverse MMatrix.
  • ReturnStatus Return status.

Return Value

  • The inverse of the transform as a MMatrix.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kInvalidParameter The method failed due to an invalid space being used.

MPoint MPxTransform:: getScalePivot ( MSpace::Space space , const MDGContext &context , MStatus *ReturnStatus )
Description

This method returns the position of the pivot used by the scale component of the transform. The position is represented in internal units (centimeters).

Arguments

  • space The space used to get the scale pivot.
  • context The context for getting the scale pivot.
  • ReturnStatus Return status.

Return Value

  • A MPoint given the position of the scale pivot in centimeters.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kInvalidParameter The method failed due to an invalid space being used.

MPoint MPxTransform:: getRotatePivot ( MSpace::Space space , const MDGContext &context , MStatus *ReturnStatus )
Description

This method returns the position of the pivot used by the rotate component of the transform. The position is represented in internal units (centimeters).

  • space The space used to get the rotate pivot.
  • context The context for getting the rotate pivot.
  • ReturnStatus Return status.

Return Value

  • A MPoint given the position of the rotate pivot in centimeters.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kInvalidParameter The method failed due to an invalid space being used.

MVector MPxTransform:: getScalePivotTranslation ( MSpace::Space space , const MDGContext &context , MStatus *ReturnStatus )
Description

This method returns the scale pivot translation in internal units (centimeters). The scale pivot translation is an offset applied to the transform to allow adjustments to the scale pivot to be made without changing the overall transform.

Arguments

  • space The spaced used to get the scale pivot translation.
  • context The context for getting the scale pivot translation.
  • ReturnStatus Return status.

Return Value

  • An MVector containing the value of the scale pivot translation in centimeters.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kInvalidParameter The method failed due to an invalid space being used.

MVector MPxTransform:: getRotatePivotTranslation ( MSpace::Space space , const MDGContext &context , MStatus *ReturnStatus )
Description

This method returns the rotate pivot translation in internal units (centimeters). The rotate pivot translation is an offset applied to the transform to allow adjustments to the rotate pivot to be made without changing the overall transform.

Arguments

  • space The spaced used to get the rotate pivot translation.
  • context The context for getting the rotate pivot translation.
  • ReturnStatus Return status.

Return Value

  • An MVector containing the value of the rotate pivot translation in centimeters.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kInvalidParameter The method failed due to an invalid space being used.

MStatus MPxTransform:: setScalePivot (const MPoint &newSP, MSpace::Space space , bool balance , const MDGContext &context )
Description

This method sets the position of the scale pivot. The position of the pivot is defined as a MPoint in internal units (centimeters).

If the balance argument is true, then the scale pivot translation will be adjusted such that the overall transform remains unchanged after the new scale pivot is set.

If an invalid space is used, the scale pivot will not change.

Arguments

  • newSP The position of the new scale pivot.
  • space The space used to set the scale pivot.
  • context The context used for setting the scale pivot.

Return Value

  • Return status.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kInvalidParameter The method failed due to an invalid space being used.

MStatus MPxTransform:: setScalePivotTranslation (const MVector &newPT, MSpace::Space space , const MDGContext &context )
Description

This method sets the scale pivot translation in internal units (centimeters). The scale pivot translation is normally used to automatically compensate for changes in the scale pivot when the setScalePivot() method is used.

Arguments

  • newPT The scale pivot translation as a MVector.
  • space The space used to set the scale pivot translation.
  • context The context used in setting the scale pivot translation.

Return Value

  • Return status.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kInvalidParameter The method failed due to an invalid space being used.

MStatus MPxTransform:: setRotatePivot (const MPoint &newRP, MSpace::Space space , bool balance , const MDGContext &context )
Description

This method sets the position of the rotate pivot. The position of the pivot is defined as a MPoint in internal units (centimeters).

If the balance argument is true, then the rotate pivot translation will be adjusted such that the overall transform remains unchanged after the new rotate pivot is set.

If an invalid space is used, the rotate pivot will not change.

Arguments

  • newSP The position of the new rotate pivot.
  • space The space used to set the rotate pivot.
  • context The context used for setting the rotate pivot.

Return Value

  • Return status.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kInvalidParameter The method failed due to an invalid space being used.

MStatus MPxTransform:: setRotatePivotTranslation (const MVector &newPT, MSpace::Space space , const MDGContext &context )
Description

This method sets the rotate pivot translation in internal units (centimeters). The rotate pivot translation is normally used to automatically compensate for changes in the rotate pivot when the setRotatePivot() method is used.

Arguments

  • newPT The rotate pivot translation as a MVector.
  • space The space used to set the rotate pivot translation.
  • context The context used in setting the rotate pivot translation.

Return Value

  • Return status.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kInvalidParameter The method failed due to an invalid space being used.

MTransformationMatrix::RotationOrder MPxTransform:: getRotationOrder (const MDGContext &context )

Description

Returns the rotation order used by the rotation component of the transformation matrix. This method uses the MTransformationMatrix::RotateOrder enums to describe the rotation order.

Arguments

  • context The context for getting the rotation order.

Return Value

  • The MTransformationMatrix::RotationOrder enum describing the rotation order of the transform.

MStatus MPxTransform:: setRotationOrder ( MTransformationMatrix::RotationOrder ro, bool reorder , const MDGContext &context )

Description

Sets the rotation order used by the rotation component of the transformation matrix. The rotation order is specified by the MTransformationMatrix::RotationOrder enum.

Arguments

  • ro The new rotation order as a MTransformationMatrix::RotationOrder enum.
  • context The context for setting the rotation order.

Return Value

  • Return status.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

MQuaternion MPxTransform:: getRotateOrientation ( MSpace::Space space , const MDGContext &context , MStatus *ReturnStatus )

Description

Returns the rotate orientation for the transformation matrix as a quaternion. The rotate orientation is the value associated with the rotateAxis attribute on this node. The rotate orientation value is used to orient the local rotation space of the transform.

Arguments

  • space The space used for getting the rotate orientation.
  • context The context for getting the rotate orientation.
  • ReturnStatus Return status.

Return Value

  • A MQuaternion representing the rotate orientation.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kInvalidParameter The method failed due to an invalid space being used.

MStatus MPxTransform:: setRotateOrientation (const MQuaternion &newRO, MSpace::Space space , bool balance , const MDGContext &context )

Description

This method sets the rotate orientation for this transform. The rotate orientation is used to define the local rotation space. The rotate orientation is the value associated with the rotateAxis attribute on this node.

The balance argument allows the rotate orientation to be changed without affecting the overall transformation. The rotate value is adjusted to compensate for the change in rotate orientation.

Arguments

  • newRO The quaternion used to set the rotate orientation.
  • space The space used when setting the rotate orientation.
  • balance If true is used, then the rotation will change to compensate for the change in the rotate orientation.
  • context The context used for setting the rotate orientation.

Return Value

  • Return status.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kInvalidParameter The method failed due to an invalid space being used.

void MPxTransform:: updateMatrixAttrs (const MDGContext &context)

Description

This method is used only for the MPxTransform and MPxTransform derived classes. It will ensure that the values which change the resulting 4x4 matrix are current. It should be called before getting values that affect the matrix calculation.

If only a specific value needs to be updated, then use the updateMatrixAttrs(MObject &attr, const MDGContext &context) method.

Arguments

  • context The context to use when updating the values.

MStatus MPxTransform:: updateMatrixAttrs ( MObject &attr, const MDGContext &context)

Description

This method ensures that a passed attribute will have its values current.

Arguments

  • attr The attribute.
  • context The context to use.

Return Value

  • Return status.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

void MPxTransform:: mustCallValidateAndSet ( MObject &obj)

Description

This method must be called in the initialize() method for all attributes that affect the matrix of the transform. It will ensure that the matrix is properly calculated when the passed attribute is changed and that the validateAndSetValue method will get called for this attribute.

It is only for MPxTransform derived classes.

If a custom attribute on an MPxTransform derived classes is declared as "mustValidateAndSetValue", then the validateAndSetValue method must be implemented, so that it takes the data out of the data handle, and sets it into the datablock of the node.

Arguments

  • obj the attribute

MStatus MPxTransform:: setNonAffineMatricesEnabled (bool enabled)

Description

Normal Maya transforms consist of translate, rotate, scale, and skew. All of these transform types produce an affine matrix. With MPxTransform it is possible to introduce non-affine matrices into places that previously did not consider their effects.

If non-affine matrices are enabled, then all calculations which require additional operations when handling non-affine matrices will perform the addition mathematical operations.

This is a static method and will affect all transforms when enabled.

Arguments

  • enable If true, then non-afine calculations will be used.

Return Value

  • return status

Status Codes

  • MS::kSuccess Operation successful
  • MS::kSuccess Operation failed

bool MPxTransform:: isNonAffineMatricesEnabled ( MStatus *ReturnStatus)

Description

This method returns true is non-affine matrix calculations are being used for transforms.

Arguments

  • ReturnStatus The status

Return Value

  • true if non-affine matrix calculations are enabled.

Status Codes

  • MS::kSuccess Operation successful
  • MS::kSuccess Operation failed

MVector MPxTransform:: applyTranslationLimits (const MVector &unlimitedT, MDataBlock &block, MStatus *ReturnStatus )

Description

This method returns a copy of the passed translation value with its members limited by any enabled translation limits on this node.

Arguments

  • unlimitedT The value before limits are applied.
  • block The datablock to use.
  • ReturnStatus Return status.

Return Value

  • The limited translation value.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

MVector MPxTransform:: applyTranslationLocks (const MVector &toTest, const MVector &savedT, MStatus *ReturnStatus )

Description

This method allows the custom transform to apply its own locking mechanism to translation. Standard dependency graph attribute locking happens automatically and cannot be modified by custom nodes.

If the plug should not be changed, then the value from the passed savedT argument should be return to be used in the transformation matrix.

Arguments

  • toTest The values to use if the plug is not locked.
  • savedT The values to revert to if the plug cannot be changed.
  • ReturnStatus status

Return Value

  • The value after the locking checks are applied.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

MEulerRotation MPxTransform:: applyRotationLimits (const MEulerRotation &unlimitedR, MDataBlock &block, MStatus *ReturnStatus )

Description

This method returns a copy of the passed rotation value with its members limited by any enabled rotation limits on this node.

Arguments

  • unlimitedR The value before applying the limits.
  • block The datablock.
  • ReturnStatus Return status.

Return Value

  • A MEulerRotation with limits applied to it.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

MEulerRotation MPxTransform:: applyRotationLocks (const MEulerRotation &toTest, const MEulerRotation &savedR, MStatus *ReturnStatus )

Description

This method allows the custom transform to apply its own locking mechanism to rotation. Standard dependency graph attribute locking happens automatically and cannot be modified by custom nodes.

If the plug should not be changed, then the value from the passed savedR argument should be return to be used in the transformation matrix.

Arguments

  • toTest The values to use if the plug is not locked.
  • savedR The values to revert to if the plug cannot be changed.
  • ReturnStatus status

Return Value

  • The value after the locking checks are applied.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

MVector MPxTransform:: applyScaleLimits (const MVector &unlimitedS, MDataBlock &block, MStatus *ReturnStatus )

Description

This method returns a copy of the passed scale value with its members limited by any enabled scale limits on this node.

Arguments

  • unlimitedS The scale before applying limits.
  • block The datablock.
  • ReturnStatus Return status.

Return Value

  • The scale value with limits applied.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

MVector MPxTransform:: applyScaleLocks (const MVector &toTest, const MVector &savedS, MStatus *ReturnStatus )

Description

This method allows the custom transform to apply its own locking mechanism to scale. Standard dependency graph attribute locking happens automatically and cannot be modified by custom nodes.

If the plug should not be changed, then the value from the passed savedS argument should be return to be used in the transformation matrix.

Arguments

  • toTest The values to use if the plug is not locked.
  • savedS The values to revert to if the plug cannot be changed.
  • ReturnStatus status

Return Value

  • The scale value after the locking checks are applied.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

MVector MPxTransform:: applyShearLocks (const MVector &toTest, const MVector &savedS, MStatus *ReturnStatus )

Description

This method allows the custom transform to apply its own locking mechanism to shear. Standard dependency graph attribute locking happens automatically and cannot be modified by custom nodes.

If the plug should not be changed, then the value from the passed savedS argument should be return to be used in the transformation matrix.

Arguments

  • toTest The values to use if the plug is not locked.
  • savedS The values to revert to if the plug cannot be changed.
  • ReturnStatus status

Return Value

  • The shear value after the locking checks are applied.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

MEulerRotation MPxTransform:: applyRotateOrientationLocks (const MEulerRotation &toTest, const MEulerRotation &savedRO, MStatus *ReturnStatus )

Description

This method allows the custom transform to apply its own locking mechanism to rotation orientation. Standard dependency graph attribute locking happens automatically and cannot be modified by custom nodes.

If the plug should not be changed, then the value from the passed savedRO argument should be return to be used in the transformation matrix.

Arguments

  • toTest The values to use if the plug is not locked.
  • savedRO The values to revert to if the plug cannot be changed.
  • ReturnStatus status

Return Value

  • The rotate orientation value after the locking checks are applied.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

MVector MPxTransform:: applyScaleLocksPivot (const MPoint &toTest, const MPoint &savedSP, MStatus *ReturnStatus )

Description

This method allows the custom transform to apply its own locking mechanism to scale pivot. Standard dependency graph attribute locking happens automatically and cannot be modified by custom nodes.

If the plug should not be changed, then the value from the passed savedSP argument should be return to be used in the transformation matrix.

Arguments

  • toTest The values to use if the plug is not locked.
  • savedSP The values to revert to if the plug cannot be changed.
  • ReturnStatus status

Return Value

  • The scale pivot value after the locking checks are applied.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

MVector MPxTransform:: applyRotatePivotLocks (const MPoint &toTest, const MPoint &savedSP, MStatus *ReturnStatus )

Description

This method allows the custom transform to apply its own locking mechanism to rotation pivots. Standard dependency graph attribute locking happens automatically and cannot be modified by custom nodes.

If the plug should not be changed, then the value from the passed savedRP argument should be return to be used in the transformation matrix.

Arguments

  • toTest The values to use if the plug is not locked.
  • savedSP The values to revert to if the plug cannot be changed.
  • ReturnStatus status

Return Value

  • The value after the locking checks are applied.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

MVector MPxTransform:: applyScaleLocksPivotTranslate (const MVector &toTest, const MVector &savedSPT, MStatus *ReturnStatus )

Description

This method allows the custom transform to apply its own locking mechanism to the scalePivotTranslate attribute. Standard dependency graph attribute locking happens automatically and cannot be modified by custom nodes.

If the plug should not be changed, then the value from the passed savedR argument should be return to be used in the transformation matrix.

Arguments

  • toTest The values to use if the plug is not locked.
  • savedSPT The values to revert to if the plug cannot be changed.
  • ReturnStatus status

Return Value

  • The value after the locking checks are applied.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

MVector MPxTransform:: applyRotatePivotLocksTranslate (const MVector &toTest, const MVector &savedSPT, MStatus *ReturnStatus )

Description

This method allows the custom transform to apply its own locking mechanism to the rotatePivotTranslate attribute. Standard dependency graph attribute locking happens automatically and cannot be modified by custom nodes.

If the plug should not be changed, then the value from the passed savedR argument should be return to be used in the transformation matrix.

Arguments

  • toTest The values to use if the plug is not locked.
  • savedSPT The values to revert to if the plug cannot be changed.
  • ReturnStatus status

Return Value

  • The value after the locking checks are applied.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

MStatus MPxTransform:: dirtyMatrix ()
Description

This marks the entire matrix dirty. When a value is changed and that value should also update the matrix, use this method, or one of the specific dirty methods (i.e. dirtyTranslation())

Return Value

  • Status Code.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

MStatus MPxTransform:: dirtyTranslation (const MVector &savedT)

Description

If the current transformation matrix translation values are different than the passed translation value, then the translation portion of the matrix will be marked dirty.

Arguments

  • savedT The previous translation values.

Return Value

  • Status Code.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

MStatus MPxTransform:: dirtyRotation (const MEulerRotation &savedR)

Description

If the current transformation matrix rotation values are different than the passed rotation value, then the rotation portion of the matrix will be marked dirty.

Arguments

  • savedR The previous rotation values.

Return Value

  • Status code.

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

MStatus MPxTransform:: dirtyScale (const MVector &savedS)

Description

If the current transformation matrix scale values are different than the passed scale value, then the scale portion of the matrix will be marked dirty.

Arguments

  • savedS The previous scale values.

Return Value

  • status

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

MStatus MPxTransform:: dirtyShear (const MVector &savedSh)

Description

If the current transformation matrix shear values are different than the passed shear value, then the shear portion of the matrix will be marked dirty.

Arguments

  • savedSh The previous shear values.

Return Value

  • status

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

MStatus MPxTransform:: dirtyRotateOrientation (const MEulerRotation &savedRO)

Description

If the current transformation matrix rotate orientation values are different than the passed rotate orientation value, then the rotate orientation portion of the matrix will be marked dirty.

Arguments

  • savedRO The previous rotate orientation values.

Return Value

  • status

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

MStatus MPxTransform:: dirtyRotatePivot (const MPoint &savedRP)

Description

If the current transformation matrix rotate pivot values are different than the passed rotate pivot value, then the rotate pivot portion of the matrix will be marked dirty.

Arguments

  • savedRP The previous rotate pivot values.

Return Value

  • status

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

MStatus MPxTransform:: dirtyScalePivot (const MPoint &savedSP)

Description

If the current transformation matrix scale pivot values are different than the passed scale pivot value, then the scale pivot portion of the matrix will be marked dirty.

Arguments

  • savedSP The previous scale pivot values.

Return Value

  • status

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

MStatus MPxTransform:: dirtyRotatePivotTranslation (const MVector &savedRT)

Description

If the current transformation matrix rotate pivot translation values are different than the passed rotate pivot translation value, then the rotate pivot translation portion of the matrix will be marked dirty.

Arguments

  • savedRT The previous rotate pivot translation values.

Return Value

  • status

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

MStatus MPxTransform:: dirtyScalePivotTranslation (const MVector &savedST)

Description

If the current transformation matrix scale pivot translation values are different than the passed scale pivot translation value, then the scale pivot translation portion of the matrix will be marked dirty.

Arguments

  • savedST The previous scale pivot translation values.

Return Value

  • status

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

MStatus MPxTransform:: checkAndSetTranslation ( MDataBlock &block, const MPlug &plug, const MVector & newT, MSpace::Space space )

Description This method is used to modify and set the new translate values being passed in from the compute method or from the validateAndSetValue. The data block should be set with the corrected values. Corrections would come from enforcing any active limits as well as verifying that the plug's value may be changed. If the plug is locked or if it is the destination in a connection that disallows value changes, then the plug will be set to its unchanged value.

Arguments

  • block The data block to set.
  • plug The translate plug (or one of its child plugs).
  • newT The new translate value.
  • space The space used for the new translation value.

Return Value

  • status

Status Codes

  • MS::kSuccess The method succeeded.
  • MS::kFailure The method failed.

MStatus MPxTransform:: checkAndSetRotation ( MDataBlock &block, const MPlug &plug, const MEulerRotation & newR, MSpace::Space space )

Description

This method verifies that the passed value can be set on the rotate plugs. In the base class, limits as well as locking are checked by this method.

The compute, validateAndSetValue, and rotateTo functions all use this method.

Arguments

  • block The data block
  • plug The plug. This should be rotate or one of its children.
  • newR The new rotate value.
  • space The space that the newR value is using.

Return Value

  • status

Status Codes

  • MS::kSuccess Operation successful
  • MS::kFailure Operation failed

MStatus MPxTransform:: checkAndSetScale ( MDataBlock &block, const MPlug &plug, const MVector & newS, MSpace::Space space )

Description

This method verifies that the passed value can be set on the scale plugs. In the base class, limits as well as locking are checked by this method.

The compute, validateAndSetValue, and scaleTo functions all use this method.

Arguments

  • block The data block
  • plug The plug. This should be scale or one of its children.
  • newS The new scale value.
  • space The space that the newS value is using.

Return Value

  • status

Status Codes

  • MS::kSuccess Operation successful
  • MS::kFailure Operation failed

MStatus MPxTransform:: checkAndSetShear ( MDataBlock &block, const MPlug &plug, const MVector & newS, MSpace::Space space )

Description

This method verifies that the passed value can be set on the shear plugs. In the base class, only the locking conditions are enforced.

The compute, validateAndSetValue, and shearTo functions all use this method. If limits are desired on shear, then the limit enforcement should be implemented in this method in a derived class.

Arguments

  • block The data block
  • plug The plug. This should be shear or one of its children.
  • newS The new shear value.
  • space The space that the newS value is using.

Return Value

  • status

Status Codes

  • MS::kSuccess Operation successful
  • MS::kFailure Operation failed

MStatus MPxTransform:: checkAndSetRotateOrientation ( MDataBlock &block, const MPlug & plug, const MEulerRotation & newRO, MSpace::Space space , bool balance )

Description

This method verifies that the passed value can be set on the rotateAxis plugs. In the base class, only the locking conditions are enforced. This method will also update the rotation value if balance is true.

The compute, validateAndSetValue, and setRotateOrientation functions all use this method. If limits are desired on rotateAxis, then the limit enforcement should be implemented in this method in a derived class.

Arguments

  • block The data block
  • plug The plug. This should be rotateAxis or one of its children.
  • newRO The new rotate orientation value.
  • space The space that the newRO value is using.
  • balance If balance is true, then the rotation is modified to compensate for the change in rotateAxis such that the transform remains unchanged.

Return Value

  • status

Status Codes

  • MS::kSuccess Operation successful
  • MS::kFailure Operation failed

MStatus MPxTransform:: checkAndSetRotatePivot ( MDataBlock &block, const MPlug & plug, const MPoint & newRP, MSpace::Space space , bool balance )

Description

This method verifies that the passed value can be set on the rotatePivot plugs. In the base class, only the locking conditions are enforced. This method will also update the rotatePivotTranslate value if balance is true.

The compute, validateAndSetValue, and setRotatePivot functions all use this method. If limits are desired on rotatePivot, then the limit enforcement should be implemented in this method in a derived class.

Arguments

  • block The data block
  • plug The plug. This should be rotatePivot or one of its children.
  • newRP The new rotate pivot value.
  • space The space that the newRP value is using.
  • balance If balance is true, then the rotatePivotTranslate is modified to compensate for the change in rotatePivot such that the transform remains unchanged.

Return Value

  • status

Status Codes

  • MS::kSuccess Operation successful
  • MS::kFailure Operation failed

MStatus MPxTransform:: checkAndSetRotatePivotTranslation ( MDataBlock &block, const MPlug & plug, const MVector & newPT, MSpace::Space space )

Description

This method verifies that the passed value can be set on the rotatePivotTranslate plugs. In the base class, only the locking conditions are enforced.

The compute, validateAndSetValue, and setRotatePivotTranslation functions all use this method. If limits are desired on rotatePivotTranslate, then the limit enforcement should be implemented in this method in a derived class.

Arguments

  • block The data block
  • plug The plug. This should be rotatePivotTranslate or one of its children.
  • newPT The new rotate pivot translate value.
  • space The space that the newPT value is using.

Return Value

  • status

Status Codes

  • MS::kSuccess Operation successful
  • MS::kFailure Operation failed

MStatus MPxTransform:: checkAndSetScalePivot ( MDataBlock &block, const MPlug & plug, const MPoint & newSP, MSpace::Space space , bool balance )

Description

This method verifies that the passed value can be set on the scalePivot plugs. In the base class, only the locking conditions are enforced. This method will also update the scalePivotTranslate value if balance is true.

The compute, validateAndSetValue, and setScalePivot functions all use this method. If limits are desired on scalePivot, then the limit enforcement should be implemented in this method in a derived class.

Arguments

  • block The data block
  • plug The plug. This should be scalePivot or one of its children.
  • newSP The new scale pivot value.
  • space The space that the newSP value is using.
  • balance If balance is true, then the scalePivotTranslate is modified to compensate for the change in scalePivot such that the transform remains unchanged.

Return Value

  • status

Status Codes

  • MS::kSuccess Operation successful
  • MS::kFailure Operation failed

MStatus MPxTransform:: checkAndSetScalePivotTranslation ( MDataBlock &block, const MPlug & plug, const MVector & newPT, MSpace::Space space )

Description

This method verifies that the passed value can be set on the scalePivotTranslate plugs. In the base class, only the locking conditions are enforced.

The compute, validateAndSetValue, and setScalePivotTranslation functions all use this method. If limits are desired on scalePivotTranslate, then the limit enforcement should be implemented in this method in a derived class.

Arguments

  • block The data block
  • plug The plug. This should be scalePivotTranslate or one of its children.
  • newPT The new scale pivot translate value.
  • space The space that the newPT value is using.

Return Value

  • status

Status Codes

  • MS::kSuccess Operation successful
  • MS::kFailure Operation failed

void MPxTransform:: copyInternalData ( MPxNode * node)

Description

This function copies the internal data of the transform node.

Arguments

  • node the node that is being duplicated

MPxTransformationMatrix *MPxTransform:: transformationMatrixPtr () const

Description

This function returns the associated transformation matrix.

This class has no child classes.


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