class MPxConstraint

Jump to documentation

: public MPxNode Proxy constraint node (OpenMayaAnim) (OpenMayaMPx.py)

Inheritance:

MPxConstraint < MPxNode

public members:

enum UpVectorType
kScene
Scene up vector
kObject
Origin of object
kObjectRotation
kVector
kLast
MPxConstraint ()
virtual ~MPxConstraint ()
virtual const MObject weightAttribute () const
virtual const MObject targetAttribute () const
virtual const MObject constraintRotateOrderAttribute () const

protected members:

virtual const MObject passiveOutputAttribute () const
virtual void getOutputAttributes ( MObjectArray & attributeArray)
MStatus closestPoint ( const MObject & dataGeometryObject, const MPoint & toThisPoint, MPoint & theClosestPoint ) const
MStatus closestNormal ( const MObject & dataGeometryObject, const MPoint & toThisPoint, MVector & theNormal ) const
MStatus closestTangent ( const MObject & dataGeometryObject, const MPoint & toThisPoint, MVector & theTangent ) const
MEulerRotation computeAim ( const MMatrix & parentInverseMatrix, const MVector & targetVector, const MVector & aimVector, const MVector & upVector, const MVector & wupVector, MEulerRotation::RotationOrder order = MEulerRotation::kXYZ , const MQuaternion & jointOrient = MQuaternion::identity , MStatus * ResultStatus = NULL ) const
MVector worldUpVector ( MPxConstraint::UpVectorType upType, const MVector & upVector, const MMatrix & upMatrix, const MPoint & constrPoint, MStatus * ResultStatus = NULL ) const
MPoint worldConstraintPoint ( const MMatrix & parentInverseMatrix, const MVector & translate, const MVector & rotatePivot, const MVector & rotatePivotTranslate, MStatus * ResultStatus = NULL ) const

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

Proxy constraint node (OpenMayaAnim) (OpenMayaMPx.py)
Description

MPxConstraint is the parent class for user defined constraint nodes. Position, orientation or scale of an object can be constrained by other objects. This class works in conjunction with the MPxConstraintCommand class.

Functions

MPxConstraint:: MPxConstraint ()
Description

Constructor.

The constructor should never call any methods from MPxConstraint or make any calls that require the existence of the MObject associated with the user defined node. The postConstructor method should be used to do any initialization of this kind.

MPxConstraint:: ~MPxConstraint ()
Description

Destructor.

const MObject MPxConstraint:: weightAttribute () const
Description

Returns the weight attribute for the constraint. Default implementation returns MObject::kNullObj.

const MObject MPxConstraint:: targetAttribute () const
Description

Returns the target attribute for the constraint. Default implementation returns MObject::kNullObj.

const MObject MPxConstraint:: constraintRotateOrderAttribute () const
Description

Returns the rotate order attribute for the constraint. Default implementation returns MObject::kNullObj.

If is only necessary to override this method if the constraint will control rotation.

const MObject MPxConstraint:: passiveOutputAttribute () const
Description

Returns the passive output attribute for the constraint. Default implementation returns MObject::kNullObj.

Passive output attributes do not prevent value modifications to the destination attribute when connected.

void MPxConstraint:: getOutputAttributes ( MObjectArray & attributeArray)
Description

Returns output attributes for the constraint. Default implementation clears the input attributeArray and returns.

MStatus MPxConstraint:: closestPoint ( const MObject & dataGeometryObject, const MPoint & toThisPoint, MPoint & theClosestPoint ) const

Description

Returns the closest point on this surface to the given point.

Arguments

  • dataGeometryObject surface
  • toThisPoint the point to evaluate from
  • theClosestPoint the calculated closest point

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter dataGeometryObject is invalid.
  • MS::kFailure An object error has occurred.

MStatus MPxConstraint:: closestNormal ( const MObject & dataGeometryObject, const MPoint & toThisPoint, MVector & theNormal ) const

Description

Returns the closest normal on this surface to the given point.

Arguments

  • dataGeometryObject surface
  • toThisPoint the point to evaluate from
  • theNormal the calculated closest normal

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter dataGeometryObject is invalid.
  • MS::kFailure An object error has occurred.

MStatus MPxConstraint:: closestTangent ( const MObject & dataGeometryObject, const MPoint & toThisPoint, MVector & theTangent ) const

Description

Returns the closest tangent on this surface to the given point.

Arguments

  • dataGeometryObject surface
  • toThisPoint the point to evaluate from
  • theTangent the calculated closest tangent

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter dataGeometryObject is invalid.
  • MS::kFailure An object error has occurred.

MEulerRotation MPxConstraint:: computeAim ( const MMatrix & parentInverseMatrix, const MVector & targetVector, const MVector & aimVector, const MVector & upVector, const MVector & wUpVector, MEulerRotation::RotationOrder order, const MQuaternion & jointOrient, MStatus * ResultStatus ) const

Description

Returns the rotation which aligns the aimVector in local space with the targetVector in local space while keeping the upVector in local space and the wUpVector world space aligned as closely as possible.

Arguments

  • parentInverseMatrix
  • targetVector
  • aimVector
  • upVector
  • wUpVector
  • order
  • jointOrient
  • ResultStatus

Return Value

  • MEulerRotation aim

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MVector MPxConstraint:: worldUpVector ( MPxConstraint::UpVectorType upType, const MVector & upVector, const MMatrix & upMatrix, const MPoint & constrPoint, MStatus * ResultStatus ) const

Description

Returns the world up vector based on the requested up type.

Arguments

  • upVector
  • upMatrix
  • aimVector
  • constrPoint
  • ResultStatus

Return Value

  • MVector world up vector

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MPoint MPxConstraint:: worldConstraintPoint ( const MMatrix & parentInverseMatrix, const MVector & translate, const MVector & rotatePivot, const MVector & rotatePivotTranslate, MStatus * ResultStatus ) const

Description

Returns the world constraint point.

Arguments

  • parentInverseMatrix
  • translate
  • rotatePivot
  • rotatePivotTranslate
  • ResultStatus

Return Value

  • MPoint world constraint point

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

This class has no child classes.


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