C++ API Reference
|
Base class for user defined IK solvers. More...
#include <MPxIkSolverNode.h>
Public Member Functions | |
~MPxIkSolverNode () override | |
Destructor. | |
MPxNode::Type | type () const override |
This method returns the type of the node. More... | |
virtual MStatus | preSolve () |
This method is called before doSolve. More... | |
virtual MStatus | doSolve () |
This is where the main solving takes place. More... | |
virtual MStatus | postSolve (MStatus) |
This method is called after doSolve has finished. More... | |
virtual MString | solverTypeName () const |
This method returns the type name of the solver. More... | |
bool | rotatePlane (MStatus *ReturnStatus=NULL) const |
This method indicates whether this solver supports the rotate plane. More... | |
MStatus | setRotatePlane (bool rotatePlane) |
This method sets whether or not this solver supports the rotate plane. More... | |
bool | singleChainOnly (MStatus *ReturnStatus=NULL) const |
This method indicates whether this solver is a single chain solver. More... | |
MStatus | setSingleChainOnly (bool singleChainOnly) |
This method sets whether or not this solver is a single chain solver. More... | |
bool | positionOnly (MStatus *ReturnStatus=NULL) const |
Indicates whether the ik solution is dependent on the ikHandle position only or also uses the orientation. More... | |
MStatus | setPositionOnly (bool positionOnly) |
Sets whether or not the solver supports handle orientation. More... | |
bool | supportJointLimits (MStatus *ReturnStatus=NULL) const |
This method indicates whether the solver supports limits on joint angles. More... | |
MStatus | setSupportJointLimits (bool supportJointLimits) |
This method sets whether or not the solver supports limits on joint angles. More... | |
bool | uniqueSolution (MStatus *ReturnStatus=NULL) const |
This method indicates whether the solver provides a unique solution. More... | |
MStatus | setUniqueSolution (bool uniqueSolution) |
This method sets whether or not the solver provides a unique solution. More... | |
virtual bool | isSingleChainOnly () const |
This method indicates whether this solver is a single chain solver. More... | |
virtual bool | isPositionOnly () const |
This method is obsolete. More... | |
virtual bool | hasJointLimitSupport () const |
This method is obsolete. More... | |
virtual bool | hasUniqueSolution () const |
This method is obsolete. More... | |
virtual bool | groupHandlesByTopology () const |
This method is obsolete. More... | |
virtual MStatus | setFuncValueTolerance (double tolerance) |
Set the error value for this solver. More... | |
virtual MStatus | setMaxIterations (int value) |
Set the maximum iterations for a solution by this solver. More... | |
MIkHandleGroup * | handleGroup () const |
Returns the handle group for this solver. More... | |
virtual void | setHandleGroup (MIkHandleGroup *) |
Set the handle group of this solver. More... | |
const MMatrix * | toWorldSpace () const |
Returns the world space matrix for this solver. More... | |
const MMatrix * | toSolverSpace () const |
Returns the local space matrix for this solver. More... | |
double | funcValueTolerance () const |
Return the error value for this solver. More... | |
int | maxIterations () const |
Return the the maximum nuber of itertations for a solution by this solver. More... | |
virtual void | snapHandle (MObject &handle) |
This function positions the handle at the end effector position. More... | |
virtual bool | isAttributeCreatedBySolver (MObject &attr) const |
This function returns whether a certain attribute on the ikHandle was created by the solver (and affecting the result of the solve). More... | |
Public Member Functions inherited from MPxNode | |
MPxNode () | |
Constructor. More... | |
virtual | ~MPxNode () |
Destructor. | |
virtual void | postConstructor () |
Post constructor. More... | |
virtual MStatus | compute (const MPlug &, MDataBlock &) |
This method should be overridden in user defined nodes. More... | |
virtual bool | getInternalValue (const MPlug &, MDataHandle &) |
This method is overridden by nodes that store attribute data in some internal format. More... | |
virtual bool | setInternalValue (const MPlug &, const MDataHandle &) |
This method is overridden by nodes that store attribute data in some internal format. More... | |
virtual int | internalArrayCount (const MPlug &) const |
This method is overridden by nodes that have internal array attributes which are not stored in Maya's datablock. More... | |
virtual void | copyInternalData (MPxNode *) |
This method is overridden by nodes that store attribute data in some internal format. More... | |
virtual MStatus | legalConnection (const MPlug &, const MPlug &, bool asSrc, bool &isLegal) const |
This method allows you to check for legal connections being made to attributes of this node. More... | |
virtual MStatus | legalDisconnection (const MPlug &, const MPlug &, bool asSrc, bool &isLegal) const |
This method allows you to check for legal disconnections being made to attributes of this node. More... | |
virtual MStatus | setDependentsDirty (const MPlug &plug, MPlugArray &plugArray) |
This method can be overridden in user defined nodes to specify which plugs should be set dirty based upon an input plug {plugBeingDirtied} which Maya is marking dirty. More... | |
virtual MStatus | preEvaluation (const MDGContext &context, const MEvaluationNode &evaluationNode) |
Prepare a node's internal state for threaded evaluation. More... | |
virtual MStatus | postEvaluation (const MDGContext &context, const MEvaluationNode &evaluationNode, PostEvaluationType evalType) |
Clean up node's internal state after threaded evaluation. More... | |
virtual SchedulingType | schedulingType () const |
When overridden this method controls the degree of parallelism supported by the node during threaded evaluation. More... | |
virtual void | getCacheSetup (const MEvaluationNode &, MNodeCacheDisablingInfo &, MNodeCacheSetupInfo &, MObjectArray &) const |
Provide node-specific setup info for the Cached Playback system. More... | |
virtual void | configCache (const MEvaluationNode &, MCacheSchema &) const |
Defines the node's behavior when participating in Cached Playback. More... | |
virtual MTimeRange | transformInvalidationRange (const MPlug &source, const MTimeRange &input) const |
Override this method to register this node as an Invalidation-Range-Transformation kernel (IRT kernel) An IRT kernel node will change the invalidation time range for its downstream nodes For example, Dynamics-solver will transform invalidation time range [a,b] to [a,+inf) And Clip-Time-Editor will send out the invalidation range for each of the clip [a,b] to ( [t0+a,t0+b] U [t1+a,t1+b] U [t2+a,t2+b] U ... More... | |
bool | hasInvalidationRangeTransformation () const |
Checks if this MPxNode derived node overrides the MPxNode::transformInvalidationRange method. | |
virtual MStatus | connectionMade (const MPlug &, const MPlug &, bool asSrc) |
This method gets called when connections are made to attributes of this node. More... | |
virtual MStatus | connectionBroken (const MPlug &, const MPlug &, bool asSrc) |
This method gets called when connections are broken with attributes of this node. More... | |
virtual MStatus | dependsOn (const MPlug &, const MPlug &, bool &depends) const |
This method may be overridden by the user defined node. More... | |
virtual bool | isPassiveOutput (const MPlug &) const |
This method may be overridden by the user defined node if it wants to provide output attributes which do not prevent value modifications to the destination attribute. More... | |
virtual MStatus | shouldSave (const MPlug &, bool &isSaving) |
This method may be overridden by the user defined node. More... | |
virtual MPlug | passThroughToOne (const MPlug &) const |
This method may be overridden by nodes that have a one-to-one relationship between an input attribute and a corresponding output attribute. More... | |
virtual bool | passThroughToMany (const MPlug &, MPlugArray &) const |
This method is overridden by nodes that want to control the traversal behavior of some Maya search algorithms which traverse the history/future of shape nodes looking for directly related nodes. More... | |
virtual bool | isAbstractClass () const |
Override this class to return true if this node is an abstract node. More... | |
virtual bool | isTrackingTopology () const |
Override this class to return true if this node wants to track topology. More... | |
virtual MStringArray | getFilesToArchive (bool shortName=false, bool unresolvedName=false, bool markCouldBeImageSequence=false) const |
Use this method to return all external files used by this node. More... | |
virtual void | getExternalContent (MExternalContentInfoTable &table) const |
Returns the external content (files) that this node depends on. More... | |
bool | addExternalContentForFileAttr (MExternalContentInfoTable &, const MObject &attr) const |
Adds content info to the specified table from a file path attribute. More... | |
bool | setExternalContentForFileAttr (const MObject &attr, const MExternalContentLocationTable &) |
Sets content info in the specified attribute from the table. More... | |
virtual void | setExternalContent (const MExternalContentLocationTable &) |
Changes the location of external content in batch. More... | |
virtual MTypeId | typeId () const |
Returns the TYPEID of this node. More... | |
virtual MString | typeName () const |
Returns the type name of this node. More... | |
virtual MString | name () const |
Returns the name of this particular instance of this class. More... | |
virtual MObject | thisMObject () const |
Returns the MObject associated with this user defined node. More... | |
virtual MStatus | setExistWithoutInConnections (bool flag) |
This method specifies whether or not the node can exist without input connections. More... | |
virtual bool | existWithoutInConnections (MStatus *ReturnStatus=NULL) const |
Determines whether or not this node can exist without input connections. More... | |
virtual MStatus | setExistWithoutOutConnections (bool flag) |
This method specifies whether or not the node can exist without output connections. More... | |
virtual bool | existWithoutOutConnections (MStatus *ReturnStatus=NULL) const |
Determines whether or not this node can exist without output connections. More... | |
void | _setMPSafe (bool isMPSafe) |
This method is obsolete. More... | |
MDataBlock | _forceCache (const MDGContext &) |
This method is obsolete. More... | |
virtual bool | getInternalValueInContext (const MPlug &, MDataHandle &, MDGContext &) |
This method is obsolete. More... | |
virtual bool | setInternalValueInContext (const MPlug &, const MDataHandle &, MDGContext &) |
This method is obsolete. More... | |
virtual int | internalArrayCount (const MPlug &, const MDGContext &) const |
This method is obsolete. More... | |
Static Public Member Functions | |
static const char * | className () |
Returns the name of this class. More... | |
Static Public Member Functions inherited from MPxNode | |
static MStatus | addAttribute (const MObject &attr) |
This method adds a new attribute to a user defined node type during the type's initialization. More... | |
static MStatus | inheritAttributesFrom (const MString &parentClassName) |
This method allows a class of plugin node to inherit all of the attributes of a second class of plugin node. More... | |
static MStatus | attributeAffects (const MObject &whenChanges, const MObject &isAffected) |
This method specifies that a particular input attribute affects a specific output attribute. More... | |
static MStatus | attributeAffects (const MObject &whenChanges, const MObject &isAffected, bool affectsTopology) |
This method is an extension to the other version of the attributeAffects method. More... | |
static const char * | className () |
Returns the name of this class. More... | |
Protected Member Functions | |
MStatus | getJointAngles (MDoubleArray &) const |
This method is not available in Python. More... | |
MStatus | setJointAngles (const MDoubleArray &) |
This method is not available in Python. More... | |
void | setToRestAngles () |
This method is not available in Python. More... | |
MPxIkSolverNode () | |
Constructor. | |
Protected Member Functions inherited from MPxNode | |
virtual MDataBlock | forceCache () |
USE _forceCache() IN SCRIPT. More... | |
virtual MStatus | setDoNotWrite (bool flag) |
USE _setDoNotWrite() IN SCRIPT. More... | |
virtual bool | doNotWrite (MStatus *ReturnStatus=NULL) const |
USE _doNotWrite() IN SCRIPT. More... | |
virtual void | setMPSafe (bool isMPSafe) |
This method is obsolete. More... | |
virtual MDataBlock | forceCache (const MDGContext &) |
This method is obsolete. More... | |
Base class for user defined IK solvers.
This is the base class for writing user-defined IK solvers. Users must at least override the following methods in order to write a solver:
Users can optionally override the following methods if they want to perform work before or after doSolve is called:
Since Maya 2018, users no longer need to call the base class version of these functions if overriding them.
Note that the following virtual methods (declared in MPxNode) are irrelevant for the MPxIkSolverNode. If these methods are overridden in a class derived from MPxIkSolverNode, they will be ignored.
A creator method is necessary to return an instance of the user solver:
In order to create and register the solver, execute the mel command:
Once the solver is registered it can be assigned to IK handles and its solve methods will be called in the same manner as the solvers within Maya.
|
overridevirtual |
This method returns the type of the node.
This method should not be overridden by the user. It will return MPxNode::kIkSolverNode.
Reimplemented from MPxNode.
|
virtual |
This method is called before doSolve.
Users should override this method if there is any preprocessing that needs to be done before solving.
|
virtual |
This is where the main solving takes place.
The user must override this method.
The purpose of this method is to calculate joint angles in a skeleton based upon the position of the end effector of the handle associated with this solver.
This method is called after doSolve has finished.
The user should override this method if there are any post calculations to be done.
The status argument indicates whether doSolve was successful.
[out] | stat | The status returned from doSolve |
|
virtual |
This method returns the type name of the solver.
The user must override this method in order for the solver to be identifiable when it is registered.
Once the solver is registered, the type name can be used to assign the solver to an IK handle.
bool rotatePlane | ( | MStatus * | ReturnStatus = NULL | ) | const |
This method indicates whether this solver supports the rotate plane.
Solvers that support the rotate plane allow the user to manipulate the IK handle's pole vector with the rotate plane manipulators.
[in] | ReturnStatus | Status code. |
MStatus setRotatePlane | ( | bool | rotatePlane | ) |
This method sets whether or not this solver supports the rotate plane.
Solvers that support the rotate plane allow the user to manipulate the IK handle's pole vector with the rotate plane manipulators.
[in] | rotatePlane | whether or not the solver supports the rotate plane |
bool singleChainOnly | ( | MStatus * | ReturnStatus = NULL | ) | const |
This method indicates whether this solver is a single chain solver.
Single chain solvers are solvers which act on one handle only, i.e. the handle groups have only one handle if they are for single chain solvers.
[in] | ReturnStatus | Status code. |
MStatus setSingleChainOnly | ( | bool | singleChainOnly | ) |
This method sets whether or not this solver is a single chain solver.
Single chain solvers are solvers which act on one handle only, i.e. the handle groups have only one handle if they are for single chain solvers.
[in] | singleChainOnly | whether or not the solver is a single chain solver |
bool positionOnly | ( | MStatus * | ReturnStatus = NULL | ) | const |
Indicates whether the ik solution is dependent on the ikHandle position only or also uses the orientation.
[in] | ReturnStatus | Status code. |
MStatus setPositionOnly | ( | bool | positionOnly | ) |
Sets whether or not the solver supports handle orientation.
[in] | positionOnly | whether or not the solver is positionOnly |
bool supportJointLimits | ( | MStatus * | ReturnStatus = NULL | ) | const |
This method indicates whether the solver supports limits on joint angles.
[in] | ReturnStatus | Status code. |
MStatus setSupportJointLimits | ( | bool | supportJointLimits | ) |
This method sets whether or not the solver supports limits on joint angles.
[in] | supportJointLimits | whether or not the solver supports joint limits |
bool uniqueSolution | ( | MStatus * | ReturnStatus = NULL | ) | const |
This method indicates whether the solver provides a unique solution.
[in] | ReturnStatus | Status code. |
MStatus setUniqueSolution | ( | bool | uniqueSolution | ) |
This method sets whether or not the solver provides a unique solution.
[in] | uniqueSolution | whether or not the solver provides a unique solution |
|
virtual |
This method indicates whether this solver is a single chain solver.
Single chain solvers are solvers which act on one handle only, i.e. the handle groups have only one handle if they are for single chain solvers.
|
virtual |
This method is obsolete.
Indicates whether the solver supports handle orientation.
[from before Maya 2016]
This method must be overridden to reflect the users solver.
|
virtual |
This method is obsolete.
This method indicates whether the solver supports limits on joint angles.
[from before Maya 2016]
This method must be overridden to reflect the users solver.
|
virtual |
This method is obsolete.
This method indicates whether the solver provides a unique solution.
[from before Maya 2016]
This method must be overridden to reflect the users solver.
|
virtual |
This method is obsolete.
Indicates whether the IK system should group handles according to skeletal topology.
[from before Maya 2016]
This method must be overridden to reflect the users solver.
|
virtual |
Set the error value for this solver.
The user can override this if any other calculations should be done here.
[in] | tolerance | Error value |
|
virtual |
Set the maximum iterations for a solution by this solver.
The user can override this if any other calculations should be done here.
[in] | value | value to set |
MIkHandleGroup * handleGroup | ( | ) | const |
Returns the handle group for this solver.
The handle group provides access to handles associated with the solver.
|
virtual |
Set the handle group of this solver.
[in] | group | The handle group to be set |
const MMatrix * toWorldSpace | ( | ) | const |
Returns the world space matrix for this solver.
const MMatrix * toSolverSpace | ( | ) | const |
Returns the local space matrix for this solver.
double funcValueTolerance | ( | ) | const |
Return the error value for this solver.
int maxIterations | ( | ) | const |
Return the the maximum nuber of itertations for a solution by this solver.
|
virtual |
This function positions the handle at the end effector position.
The user can override this method.
[in] | handle | handle to be set |
|
virtual |
This function returns whether a certain attribute on the ikHandle was created by the solver (and affecting the result of the solve).
[in] | attr | attribute to be queried |
|
static |
Returns the name of this class.
|
protected |
This method is not available in Python.
Returns the joint angles. Use MPxIkSolverNode::_getJointAngles in scripts.
[out] | angles | The array of doubles to hold the angles. |
|
protected |
This method is not available in Python.
Set joint angles to the given values. Use MPxIkSolverNode::_setJointAngles in scripts.
[in] | angles | The array of angles to set the joints to. |
|
protected |
This method is not available in Python.
Sets all joints to thier prefered orientations. Use MPxIkSolverNode::_setToRestAngles in scripts.