class MFnIkHandle

Jump to documentation

: public MFnTransform Function set for inverse kinematics (IK) handles (OpenMayaAnim) (OpenMayaAnim.py)

Inheritance:

MFnIkHandle < MFnTransform < MFnDagNode < MFnDependencyNode < MFnBase

public members:

MFnIkHandle ( const MObject & object, MStatus * ReturnStatus = NULL )
enum Stickiness
kStickyOff
kStickyOn
kSuperSticky
MObject create ( MDagPath & startJoint, MDagPath & effector, MStatus * ReturnStatus = NULL )
MStatus getStartJoint ( MDagPath &jointPath )
MStatus setStartJoint ( const MDagPath &jointPath )
MStatus getEffector ( MDagPath &effectorPath )
MStatus setEffector ( const MDagPath &effectorPath )
MStatus setStartJointAndEffector ( const MDagPath &jointPath, const MDagPath &effectorPath )
unsigned int priority ( MStatus * ReturnStatus = NULL )
MStatus setPriority ( unsigned int priority )
Stickiness stickiness ( MStatus * ReturnStatus = NULL )
MStatus setStickiness ( Stickiness stickiness )
double weight ( MStatus * ReturnStatus = NULL )
MStatus setWeight ( double weight )
double poWeight ( MStatus * ReturnStatus = NULL )
MStatus setPOWeight ( double weight )
MObject solver ( MStatus * ReturnStatus = NULL )
MStatus setSolver ( const MObject & solver )
MStatus setSolver ( const MString & solverName )

Inherited from MFnTransform:

public members:

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
MStatus setRotation (const double rotation[3], MTransformationMatrix::RotationOrder order, MSpace::Space )
MVector translation ( MSpace::Space space, MStatus * ReturnStatus = NULL ) const
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

Description

This is the function set for inverse kinematics (IK) handles. An ik handle specifies the joints in a skeleton that are effected by an attached ik solver.

Functions

MFnIkHandle:: MFnIkHandle ()

Description

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

MFnIkHandle:: MFnIkHandle ( 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

MFnIkHandle:: MFnIkHandle ( 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

MFnIkHandle:: MFnIkHandle ( 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 MFnIkHandle:: type () const

Description

Return the type of this function set.

Return Value

  • the constant MFn::kIkHandle

MFnIkHandle:: ~MFnIkHandle ()

Description

Class destructor.

MObject MFnIkHandle:: create ( MDagPath & startJoint, MDagPath & effector, MStatus * ReturnStatus )

Description

Creates a new ik handle. The effector and startJoint specify the joint chain controlled by this handle. The effector is the joint that is moved by the handle forcing the solver to recalculate the joint chain.

Arguments

  • startJoint a path to the start joint in the joint chain
  • effector a path to the end-effector (last joint) in the chain
  • ReturnStatus Status Code (see below)

Status Codes

  • MS::kSuccess A new ik handle was successfully created and added to the dag
  • MS::kInvalidParameter The startJoint or effector are not valid joints
  • MS::kInsufficientMemory Not enough memory available to create the new handle
  • MS::kLicenseFailure Application not licensed for attempted operation
  • MS::kFailure An error occurred adding the new handle to the DAG.

MStatus MFnIkHandle:: getStartJoint ( MDagPath &jointPath )

Description

This method will get a dag path to the starting joint of the handle's joint chain.

Arguments

  • jointPath storage for the dag path to the joint

Return value

  • Status Code (see below)

Status Codes

  • MS::kSuccess The dag path was successfully returned
  • MS::kFailure This function set has not been attached to a valid object

MStatus MFnIkHandle:: setStartJoint ( const MDagPath &jointPath )

Description

This method will set the dag path for the starting joint of the handle's joint chain. The start joint must be on the same skeletal chain as the end effector or this method will fail.

Arguments

  • jointPath The dag path to the joint that will be set

Status Codes

  • MS::kSuccess The joint path was successfully set
  • MS::kFailure This function set has not been attached to a valid object

MStatus MFnIkHandle:: getEffector ( MDagPath &effectorPath )

Description

Get a dag path to the end-effector of the handle's joint chain.

Arguments

  • effectorPath Storage for the effector path

Return value

  • ReturnStatus Status Code (see below)

Status Codes

  • MS::kSuccess The effector path was successfully returned
  • MS::kFailure This function set has not been attached to a valid object

MStatus MFnIkHandle:: setEffector ( const MDagPath &effectorPath )

Description

Set the dag path to the end-effector of the handle's joint chain. The end-effector/joint must be on the same skeletal chain as the start joint or this method will fail.

The end effector may be specified with a joint or an end-effector. If a joint is used, an end-effector will be created at the same position as the joint and this new end-effector will be used as the end effector.

Arguments

  • effectorPath The path for the effector

Return value

  • ReturnStatus Status Code (see below)

Status Codes

  • MS::kSuccess The effector path was successfully set
  • MS::kFailure This function set has not been attached to a valid object

MStatus MFnIkHandle:: setStartJointAndEffector ( const MDagPath &jointPath, const MDagPath &effectorPath )

Description

This method will set the dag path for the starting joint and the end-effector of the handle's joint chain. This method must be used when setting the joints for a handle that are in a different skeletal chain then the current one.

The end effector may be specified with a joint or an end-effector. If a joint is used, an end-effector will be created at the same position as the joint and this new end-effector will be used as the end effector.

Arguments

Arguments

  • jointPath The dag path to the joint that will be set
  • effectorPath The path for the effector

Status Codes

  • MS::kSuccess The joint and effector paths were successfully set
  • MS::kFailure This function set has not been attached to a valid object

unsigned int MFnIkHandle:: priority ( MStatus * ReturnStatus )

Description

Get the priority of this handle in case a solution is affected by more than one handle.

Logically, all handles with a lower number priority are solved before any handles with a higher numbered priority. (All handles of priority 1 are solved before any handles of priority 2 and so on.) Handle priorities must be > 0.

Arguments

  • ReturnStatus Status Code (see below)

Return value

  • The priority of this handle

Status Codes

  • MS::kSuccess The priority was successfully returned
  • MS::kFailure This function set has not been attached to a valid object

MStatus MFnIkHandle:: setPriority ( unsigned int priority )

Description

Set the priority of this handle in case a solution is affected by more than one handle

Logically, all handles with a lower number priority are solved before any handles with a higher numbered priority. (All handles of priority 1 are solved before any handles of priority 2 and so on.) Handle priorities must be > 0.

Arguments

  • priority The priority to set for this handle

Return value

  • ReturnStatus Status Code (see below)

Status Codes

  • MS::kSuccess The priority was successfully set
  • MS::kFailure This function set has not been attached to a valid object

MFnIkHandle::Stickiness MFnIkHandle:: stickiness ( MStatus * ReturnStatus )

Description

Get the stickiness of this handle.

Sticky handles are solved when the skeleton is being manipulated interactively. If a character has sticky feet, the solver will attempt to keep them in the same position as the user moves the character's root. If they were not sticky, they would move along with the root.

Arguments

  • ReturnStatus Status Code (see below)

Return value

  • The stickiness value for this handle :
    • kStickyOff
    • kStickyOn
    • kSuperSticky

Status Codes

  • MS::kSuccess The stickiness value was successfully returned
  • MS::kFailure This function set has not been attached to a valid object

MStatus MFnIkHandle:: setStickiness ( Stickiness stickiness )

Description

Set the stickiness of this handle. Sticky handles are solved when the skeleton is being manipulated interactively. If a character has sticky feet, the solver will attempt to keep them in the same position as the user moves the character's root. If they were not sticky, they would move along with the root.

Arguments

  • stickiness The stickiness value to be set :
    • kStickyOff
    • kStickyOn
    • kSuperSticky

Return value

  • ReturnStatus Status Code (see below)

Status Codes

  • MS::kSuccess The stickiness value was successfully set
  • MS::kFailure This function set has not been attached to a valid object

double MFnIkHandle:: weight ( MStatus * ReturnStatus )

Description

Get the handles weight in error calculations. The weight only applies when handle goals are in conflict and cannot be solved simultaneously. When this happens, a solution is computed that weights the "distance" from each goal to the solution by the handle's weight and attempts to minimize this value. The weight must be >= 0.

Arguments

  • ReturnStatus Status Code (see below)

Return value

  • The weight value for this handle

Status Codes

  • MS::kSuccess The weight value was successfully returned
  • MS::kFailure This function set has not been attached to a valid object

MStatus MFnIkHandle:: setWeight ( double weight )

Description

Specifies the handles weight in error calculations. The weight only applies when handle goals are in conflict and cannot be solved simultaneously. When this happens, a solution is computed that weights the "distance" from each goal to the solution by the handle's weight and attempts to minimize this value. The weight must be >= 0.

Arguments

  • weight The weight value to be set

Return value

  • ReturnStatus Status Code (see below)

Status Codes

  • MS::kSuccess The weight value was successfully set
  • MS::kFailure This function set has not been attached to a valid object

double MFnIkHandle:: poWeight ( MStatus * ReturnStatus )

Description

Gets the position/orientation weight of a handle. This is used to compute the "distance" between the goal position and the end-effector position.

A positionWeight of 1.0 computes the distance as the distance between positions only and ignores the orientations.

A positionWeight of 0.0 computes the distance as the distance between the orientations only and ignores the positions.

A positionWeight of 0.5 attempts to weight the distances equally but cannot actually compute this due to units differences. Because there is no way to add linear units and angular units.

Arguments

  • ReturnStatus Status Code (see below)

Return value

  • The position/orientation weight

Status Codes

  • MS::kSuccess The position/orientation weight was successfully returned
  • MS::kFailure This function set has not been attached to a valid object

MStatus MFnIkHandle:: setPOWeight ( double poWeight )

Description

Sets the position/orientation weight of a handle. This is used to compute the "distance" between the goal position and the end-effector position.

A positionWeight of 1.0 computes the distance as the distance between positions only and ignores the orientations.

A positionWeight of 0.0 computes the distance as the distance between the orientations only and ignores the positions.

A positionWeight of 0.5 attempts to weight the distances equally but cannot actually compute this due to units differences. Because there is no way to add linear units and angular units.

Arguments

  • poWeight The position/orientation weight to be set

Return value

  • Status Code (see below)

Status Codes

  • MS::kSuccess The position/orientation weight was successfully set
  • MS::kFailure This function set has not been attached to a valid object

MObject MFnIkHandle:: solver ( MStatus * ReturnStatus )

Description

Returns the solver attached to this handle.

Arguments

  • ReturnStatus Status Code (see below)

Return value

  • The solver associated with this handle

Status Codes

  • MS::kSuccess The solver for this handle was successfully returned
  • MS::kFailure This function set has not been attached to a valid object

MStatus MFnIkHandle:: setSolver ( const MObject & solver )

Description

Set the solver for this handle.

Arguments

  • solver The solver for this handle

Return value

  • Status Code (see below)

Status Codes

  • MS::kSuccess The solver for this handle was successfully set
  • MS::kFailure This function set has not been attached to a valid object

MStatus MFnIkHandle:: setSolver ( const MString & solverName )

Description

Set the solver associated with this handle by name.

Arguments

  • solverName The type name of the solver to be set

Return value

  • Status Code (see below)

Status Codes

  • MS::kSuccess The solver for this handle was successfully set
  • MS::kFailure This function set has not been attached to a valid object

This class has no child classes.


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