C++ API Reference
|
Anim Curve Function Set. More...
#include <MFnAnimCurve.h>
Public Member Functions | |
virtual MFn::Type | type () const |
Function set type. More... | |
virtual | ~MFnAnimCurve () |
Destructor. | |
MFnAnimCurve () | |
Default constructor. | |
MFnAnimCurve (MObject &object, MStatus *ReturnStatus=NULL) | |
Constructor. More... | |
MFnAnimCurve (const MPlug &plug, MStatus *ReturnStatus=NULL) | |
Class constructor that initializes the function set to the single Anim Curve Node connected to the given MPlug. More... | |
MObject | create (const MObject &node, const MObject &attribute, MDGModifier *modifier=NULL, MStatus *ReturnStatus=NULL) |
Creates a new Anim Curve Node, attaches the Function Set to the new Node (detaching from the current Node) and connects the output of the new Anim Curve Node to an animatable Attribute on another DG Node. More... | |
MObject | create (const MObject &node, const MObject &attribute, AnimCurveType animCurveType, MDGModifier *modifier=NULL, MStatus *ReturnStatus=NULL) |
Creates a new Anim Curve Node, attaches the Function Set to the new Node (detaching from the current Node) and connects the output of the new Anim Curve Node to an animatable Attribute on another DG Node. More... | |
MObject | create (const MPlug &plug, MDGModifier *modifier=NULL, MStatus *ReturnStatus=NULL) |
Creates a new Anim Curve Node, attaches the Function Set to the new Node (detaching from the current Node) and connects the output of the new Anim Curve Node to the Plug on an animatable Attribute on another DG Node. More... | |
MObject | create (const MPlug &plug, AnimCurveType animCurveType, MDGModifier *modifier=NULL, MStatus *ReturnStatus=NULL) |
Creates a new Anim Curve Node, attaches the Function Set to the new Node (detaching from the current Node) and connects the output of the new Anim Curve Node to the Plug on an animatable Attribute on another DG Node. More... | |
MObject | create (AnimCurveType animCurveType, MDGModifier *modifier=NULL, MStatus *ReturnStatus=NULL) |
Creates a new Anim Curve Node, attaches the Function Set to the new Node (detaching from the current Node) but does not attempt to connect the new Anim Curve Node. More... | |
AnimCurveType | animCurveType (MStatus *ReturnStatus=NULL) const |
Returns the animCurve type. More... | |
AnimCurveType | timedAnimCurveTypeForPlug (MPlug &plug, MStatus *ReturnStatus=NULL) const |
Returns the timed animCurve type appropriate for the specified plug. More... | |
AnimCurveType | unitlessAnimCurveTypeForPlug (MPlug &plug, MStatus *ReturnStatus=NULL) const |
Returns the unitless animCurve type appropriate for the specified plug. More... | |
double | evaluate (const MTime &atTime, MStatus *ReturnStatus=NULL) const |
Determines the interpolated output value of Anim Curves of type kAnimCurveTA, kAnimCurveTL and kAnimCurveTU at the specified time. More... | |
MStatus | evaluate (const MTime &atTime, double &value) const |
Determines the interpolated output value of Anim Curves of type kAnimCurveTA, kAnimCurveTL and kAnimCurveTU at the specified time. More... | |
MStatus | evaluate (const MTime &atTime, MTime &timeValue) const |
Determines the interpolated output value of Anim Curves of type kAnimCurveTT at the specified time. More... | |
MStatus | evaluate (const double &atUnitlessInput, double &value) const |
Determines the interpolated output value of Anim Curves of type kAnimCurveUA, kAnimCurveUL and kAnimCurveUU at the specified unitless input. More... | |
MStatus | evaluate (const double &atUnitlessInput, MTime &timeValue) const |
Determines the interpolated output value of Anim Curves of type kAnimCurveUT at the specified unitless input. More... | |
bool | isStatic (MStatus *ReturnStatus=NULL) const |
Determines whether or not the animCurve is static. More... | |
unsigned int | numKeyframes (MStatus *ReturnStatus=NULL) const |
This method is obsolete. More... | |
unsigned int | numKeys (MStatus *ReturnStatus=NULL) const |
Determines the number of keys on the Anim Curve Node. More... | |
MStatus | remove (unsigned int index, MAnimCurveChange *change=NULL) |
Removes the key at the specified index. More... | |
MStatus | addKeyframe (const MTime &time, double value, MAnimCurveChange *change=NULL) |
Adds a new key with the given value at the specified time. More... | |
MStatus | addKeyframe (const MTime &time, double value, TangentType tangentInType, TangentType tangentOutType, MAnimCurveChange *change=NULL) |
Adds a new key with the given value and tangent types at the specified time. More... | |
unsigned int | addKey (const MTime &time, double value, TangentType tangentInType=kTangentGlobal, TangentType tangentOutType=kTangentGlobal, MAnimCurveChange *change=NULL, MStatus *ReturnStatus=NULL) |
Adds a new key with the given value and tangent types at the specified time for curves of type kAnimCurveTA, kAnimCurveTL and kAnimCurveTU. More... | |
unsigned int | addKey (const MTime &timeInput, const MTime &timeValue, TangentType tangentInType=kTangentGlobal, TangentType tangentOutType=kTangentGlobal, MAnimCurveChange *change=NULL, MStatus *ReturnStatus=NULL) |
Adds a new key with the given output time value and tangent types at the specified input time for curves of type kAnimCurveTT. More... | |
unsigned int | addKey (double unitlessInput, double value, TangentType tangentInType=kTangentGlobal, TangentType tangentOutType=kTangentGlobal, MAnimCurveChange *change=NULL, MStatus *ReturnStatus=NULL) |
Adds a new key with the given value and tangent types at the specified unitless input for curves of type kAnimCurveUA, kAnimCurveUL and kAnimCurveUU. More... | |
unsigned int | addKey (double unitlessInput, const MTime &time, TangentType tangentInType=kTangentGlobal, TangentType tangentOutType=kTangentGlobal, MAnimCurveChange *change=NULL, MStatus *ReturnStatus=NULL) |
Adds a new key with the given output time value and tangent types at the specified unitless input for curves of type kAnimCurveUT. More... | |
MStatus | addKeys (MTimeArray *timeArray, MDoubleArray *valueArray, TangentType tangentInType=kTangentGlobal, TangentType tangentOutType=kTangentGlobal, bool keepExistingKeys=false, MAnimCurveChange *change=NULL) |
Add a set of new keys with the given corresponding values and tangent types at the specified times. More... | |
MStatus | addKeysWithTangents (MTimeArray *timeArray, MDoubleArray *valueArray, TangentType tangentInType=kTangentGlobal, TangentType tangentOutType=kTangentGlobal, MIntArray *tangentInTypeArray=NULL, MIntArray *tangentOutTypeArray=NULL, MDoubleArray *tangentInXArray=NULL, MDoubleArray *tangentInYArray=NULL, MDoubleArray *tangentOutXArray=NULL, MDoubleArray *tangentOutYArray=NULL, MIntArray *tangentsLockedArray=NULL, MIntArray *weightsLockedArray=NULL, bool convertUnits=true, bool keepExistingKeys=false, MAnimCurveChange *change=NULL) |
Add a set of new keys with the given corresponding values and tangent types at the specified times. More... | |
unsigned int | insertKey (const MTime &time, bool breakdown=false, MAnimCurveChange *change=nullptr, MStatus *ReturnStatus=nullptr) |
Inserts a key at the specified time adjusting neighboring tangents to maintain curve shape. More... | |
bool | find (const MTime &time, unsigned int &index, MStatus *ReturnStatus=NULL) const |
Determines the index of the key which is set at the specified time. More... | |
bool | find (double unitlessInput, unsigned int &index, MStatus *ReturnStatus=NULL) const |
Determines the index of the key which is set at the specified unitless input value. More... | |
unsigned int | findClosest (const MTime &time, MStatus *ReturnStatus=NULL) const |
Determines the index of the key which is set at the time closest to the specified time. More... | |
unsigned int | findClosest (double unitlessInput, MStatus *ReturnStatus=NULL) const |
Determines the index of the key which is set at the time closest to the specified unitless input value. More... | |
MTime | time (unsigned int index, MStatus *ReturnStatus=NULL) const |
Determines the time of the key at the specified index. More... | |
double | value (unsigned int index, MStatus *ReturnStatus=NULL) const |
Determines the value of the key at the specified index. More... | |
double | unitlessInput (unsigned int index, MStatus *ReturnStatus=NULL) const |
Determines the unitless input value of the key at the specified index. More... | |
MStatus | setValue (unsigned int index, double value, MAnimCurveChange *change=NULL) |
Sets the value of the key at the specified index. More... | |
MStatus | setTime (unsigned int index, const MTime &time, MAnimCurveChange *change=NULL) |
Sets the time of the key at the specified index. More... | |
MStatus | setUnitlessInput (unsigned int index, double unitlessInput, MAnimCurveChange *change=NULL) |
Sets the value of the unitless input of the key at the specified index. More... | |
bool | isTimeInput (MStatus *ReturnStatus=NULL) const |
Determines the input type of the animCurve. More... | |
bool | isUnitlessInput (MStatus *ReturnStatus=NULL) const |
Determines the input type of the animCurve. More... | |
TangentType | inTangentType (unsigned int index, MStatus *ReturnStatus=NULL) const |
Determines the type of the tangent to the curve entering the current key. More... | |
TangentType | outTangentType (unsigned int index, MStatus *ReturnStatus=NULL) const |
Determines the type of the tangent to the curve leaving the current key. More... | |
MStatus | setInTangentType (unsigned int index, TangentType tangentType, MAnimCurveChange *change=NULL) |
Sets the type of the tangent to the curve entering the key at the specified index. More... | |
MStatus | setOutTangentType (unsigned int index, TangentType tangentType, MAnimCurveChange *change=NULL) |
Sets the type of the tangent to the curve leaving the key at the specified index. More... | |
MStatus | setTangentTypes (MIntArray indexArray, TangentType tangentInType=kTangentGlobal, TangentType tangentOutType=kTangentGlobal, MAnimCurveChange *change=NULL) |
Sets the tangent types for multiple keys. More... | |
MStatus | getTangent (unsigned int index, TangentValue &x, TangentValue &y, bool inTangent) const |
Determines the x,y value representing the vector of the in- or out-tangent (depending on the value of the inTangent parameter) to the curve for the key at the specified index. More... | |
MStatus | getTangent (unsigned int index, MAngle &angle, double &weight, bool inTangent) const |
Determines the angle and weight of the in- or out-tangent to the curve for the key at the specified index. More... | |
MStatus | setTangent (unsigned int index, TangentValue x, TangentValue y, bool inTangent, MAnimCurveChange *change=NULL, bool convertUnits=true) |
Sets the tangent for the key at the specified index. More... | |
MStatus | setTangent (unsigned int index, const MAngle &angle, double weight, bool inTangent, MAnimCurveChange *change=NULL, bool convertUnits=true) |
Sets the tangent for the key at the specified index. More... | |
MStatus | setAngle (unsigned int index, const MAngle &angle, bool inTangent, MAnimCurveChange *change=NULL) |
Set the in- or out-angle of the tangent for the key at the given index. More... | |
MStatus | setWeight (unsigned int index, double weight, bool inTangent, MAnimCurveChange *change=NULL) |
Set the in- or out-weight of the tangent for the key at the given index. More... | |
bool | weightsLocked (unsigned int index, MStatus *ReturnStatus=NULL) const |
Determines whether the weights are locked at the given key. More... | |
bool | tangentsLocked (unsigned int index, MStatus *ReturnStatus=NULL) const |
Determines whether the tangents are locked at the given key. More... | |
MStatus | setWeightsLocked (unsigned int index, bool locked, MAnimCurveChange *change=NULL) |
Lock or unlock the weights at the given key. More... | |
MStatus | setTangentsLocked (unsigned int index, bool locked, MAnimCurveChange *change=NULL) |
Lock or unlock the tangents at the given key. More... | |
InfinityType | preInfinityType (MStatus *ReturnStatus=NULL) const |
Determines the behaviour of the curve for the range occurring before the first key. More... | |
InfinityType | postInfinityType (MStatus *ReturnStatus=NULL) const |
Determines the behaviour of the curve for the range occurring after the last key. More... | |
MStatus | setPreInfinityType (InfinityType infinityType, MAnimCurveChange *change=NULL) |
Set the behaviour of the curve for the range occurring before the first key. More... | |
MStatus | setPostInfinityType (InfinityType infinityType, MAnimCurveChange *change=NULL) |
Set the behaviour of the curve for the range occurring after the last key. More... | |
bool | isWeighted (MStatus *ReturnStatus=NULL) const |
Determines whether or not the curve has weighted tangents. More... | |
MStatus | setIsWeighted (bool isWeighted, MAnimCurveChange *change=NULL) |
Sets whether or not the curve has weighted tangents. More... | |
bool | isBreakdown (unsigned int index, MStatus *ReturnStatus=NULL) const |
Determines whether or not a key is a breakdown. More... | |
MStatus | setIsBreakdown (unsigned int index, bool isBreakdown, MAnimCurveChange *change=NULL) |
Sets the breakdown state of a key at a given index. More... | |
MFnAnimCurve (const MObject &object, MStatus *ReturnStatus=NULL) | |
Constructor. More... | |
Public Member Functions inherited from MFnDependencyNode | |
virtual | ~MFnDependencyNode () |
Destructor. | |
MFnDependencyNode () | |
Default constructor. | |
MFnDependencyNode (MObject &object, MStatus *ReturnStatus=NULL) | |
Constructor. More... | |
MObject | create (const MTypeId &typeId, MStatus *ReturnStatus=NULL) |
Creates a new dependency node with the given type tag. More... | |
MObject | create (const MTypeId &typeId, const MString &name, MStatus *ReturnStatus=NULL) |
Creates a new dependency node with the given type tag. More... | |
MObject | create (const MString &type, MStatus *ReturnStatus=NULL) |
Creates a new dependency node with the given type. More... | |
MObject | create (const MString &type, const MString &name, MStatus *ReturnStatus=NULL) |
Creates a new dependency node with the given type. More... | |
MTypeId | typeId (MStatus *ReturnStatus=NULL) const |
Returns the type id of this node. More... | |
MString | typeName (MStatus *ReturnStatus=NULL) const |
Returns the type name of this node. More... | |
MString | name (MStatus *ReturnStatus=NULL) const |
Returns the name of this node. More... | |
MString | absoluteName (MStatus *ReturnStatus=NULL) const |
Returns the absolute name of this node. More... | |
MString | pluginName (MStatus *ReturnStatus=NULL) const |
Returns the name of the plug-in this MFnDependendencyNode was defined in. More... | |
MString | setName (const MString &name, bool createNamespace=false, MStatus *ReturnStatus=NULL) |
Sets the name of this node. More... | |
MUuid | uuid (MStatus *ReturnStatus=NULL) const |
Returns the node's UUID. More... | |
void | setUuid (const MUuid &uuid, MStatus *ReturnStatus=NULL) |
Sets the node's UUID. More... | |
MStatus | getConnections (MPlugArray &array) const |
Get all of the current connections to this node as an array of plugs. More... | |
unsigned int | attributeCount (MStatus *ReturnStatus=NULL) const |
Returns the number of attributes that this node has. More... | |
MObject | attribute (unsigned int index, MStatus *ReturnStatus=NULL) const |
Finds the attribute of this node at the given index. More... | |
MObject | reorderedAttribute (unsigned int index, MStatus *ReturnStatus=NULL) const |
Some nodes, such as the various animCurve nodes, require that their attributes be set in a specific order for proper operation. More... | |
MObject | attribute (const MString &attrName, MStatus *ReturnStatus=NULL) const |
Finds the attribute of this node that has the given name. More... | |
MAttrClass | attributeClass (const MObject &attr, MStatus *ReturnStatus=NULL) const |
Returns the class (normal, dynamic, extension) of the specified attribute. More... | |
MStatus | getAffectedAttributes (const MObject &attr, MObjectArray &affectedAttributes) const |
Returns an array of attributes that are affected by the attribute passed in. More... | |
MStatus | getAffectedByAttributes (const MObject &attr, MObjectArray &affectedByAttributes) const |
Returns an array of attributes that affect the attribute passed in, attr. More... | |
MPlug | findPlug (const MObject &attr, bool wantNetworkedPlug, MStatus *ReturnStatus=NULL) const |
Attempt to find a plug for the given attribute. More... | |
MPlug | findPlug (const MString &attrName, bool wantNetworkedPlug, MStatus *ReturnStatus=NULL) const |
Attempt to find a plug for the given attribute. More... | |
MPlug | findPlug (const MObject &attr, MStatus *ReturnStatus=NULL) const |
This method is obsolete. More... | |
MPlug | findPlug (const MString &attrName, MStatus *ReturnStatus=NULL) const |
This method is obsolete. More... | |
MStatus | addAttribute (const MObject &attr) |
Add a new dynamic attibute to this node. More... | |
MStatus | removeAttribute (const MObject &attr) |
Remove a dynamic attribute from a node. More... | |
MPxNode * | userNode (MStatus *ReturnStatus=NULL) const |
If the function set's node is a plug-in node, then this method will extract the MPxNode pointer from it. More... | |
bool | isFromReferencedFile (MStatus *ReturnStatus=NULL) const |
Indicates whether or not this node came from a referenced file. More... | |
bool | isShared (MStatus *ReturnStatus=NULL) const |
Indicates whether or not this node is shared. More... | |
bool | isTrackingEdits (MStatus *ReturnStatus=NULL) const |
Returns whether or not edits on the given node are being tracked by the generalized edit system. More... | |
bool | hasUniqueName (MStatus *ReturnStatus=NULL) const |
Indicates whether or not this node's name is unique within the scene. More... | |
MString | parentNamespace (MStatus *ReturnStatus=NULL) const |
Returns the name of the namespace in which this node resides. More... | |
bool | isLocked (MStatus *ReturnStatus=NULL) const |
Indicates whether or not this node is locked. More... | |
MStatus | setLocked (bool locked) |
Locks or unlocks this node. More... | |
bool | isNewAttribute (const MObject &attr, MStatus *ReturnStatus=NULL) const |
Indicates whether or not the specified attribute was added to this node within the current scene. More... | |
MStatus | setFlag (unsigned int flag, bool state) |
Sets the state of the specified flag for the node. More... | |
bool | isFlagSet (unsigned int flag, MStatus *ReturnStatus=NULL) const |
Retrieves the current state of the specified flag for a node. More... | |
bool | isDefaultNode (MStatus *ReturnStatus=NULL) const |
Returns true if the node is a default node. More... | |
MStatus | setDoNotWrite (bool flag) |
Use this method to mark the "do not write" state of this node. More... | |
bool | canBeWritten (MStatus *ReturnStatus=NULL) const |
Returns the do not write state of the node. More... | |
bool | hasAttribute (const MString &name, MStatus *ReturnStatus=NULL) const |
Returns true if the node already has an attribute with the given name. More... | |
MObject | getAliasAttr (bool force, MStatus *ReturnStatus=NULL) |
Returns the node's alias attribute, which is a special attribute used to store information about the node's attribute aliases. More... | |
bool | setAlias (const MString &alias, const MString &name, const MPlug &plug, bool add=true, MStatus *ReturnStatus=NULL) |
Sets or removes an alias (i.e. More... | |
bool | findAlias (const MString &alias, MObject &attrObj, MStatus *ReturnStatus=NULL) const |
Retrieves the attribute with the given alias. More... | |
bool | getAliasList (MStringArray &strArray, MStatus *ReturnStatus=NULL) |
Returns a list of all attribute aliases for this node. More... | |
MString | plugsAlias (const MPlug &plug, MStatus *ReturnStatus=NULL) |
Returns the alias for the plug's attribute or the empty string if that attribute has no alias. More... | |
MStatus | setIcon (const MString &filename) |
Associates a custom icon with the node for display in the Maya UI. More... | |
MString | icon (MStatus *ReturnStatus=NULL) const |
Returns the custom icon filename associated with the node. More... | |
MStatus | getExternalContent (MExternalContentInfoTable &table) const |
Returns the external content (files) that this node depends on. More... | |
MStatus | addExternalContentForFileAttr (MExternalContentInfoTable &table, const MObject &attr) const |
Adds content info to the specified table from a file path attribute. More... | |
MStatus | setExternalContentForFileAttr (const MObject &attr, const MExternalContentLocationTable &table) |
Sets content info in the specified attribute from the table. More... | |
MStatus | setExternalContent (const MExternalContentLocationTable &table) |
Changes the location of external content. More... | |
bool | affectsAnimation (MStatus *ReturnStatus=NULL) const |
Indicates whether or not this node is allowed to animate. More... | |
MStatus | setAffectsAnimation () |
Define a node can affect animation. More... | |
MString | setName (const MString &name, MStatus *ReturnStatus) |
NO SCRIPT SUPPORT. More... | |
MFnDependencyNode (const MObject &object, MStatus *ReturnStatus=NULL) | |
NO SCRIPT SUPPORT. More... | |
bool | getPlugsAlias (const MPlug &plug, MString &aliasName, MStatus *ReturnStatus=NULL) |
NO SCRIPT SUPPORT. More... | |
virtual const adsk::Data::Associations * | metadata (MStatus *ReturnStatus=NULL) const |
This method is not available in Python. More... | |
virtual MStatus | setMetadata (const adsk::Data::Associations &) |
This method is not available in Python. More... | |
virtual MStatus | deleteMetadata () |
This method is not available in Python. More... | |
virtual MStatus | validateMetadata (MString &errors) const |
This method is not available in Python. More... | |
MStatus | dgTimerOn () |
Indicates that this node should collect DG timing data whenever DG timing is enabled. More... | |
MStatus | dgTimerOff () |
Indicates that this node should no longer collect DG timing data when DG timing is enabled. More... | |
MdgTimerState | dgTimerQueryState (MStatus *ReturnStatus=NULL) |
The function returns the current on/off state of the node's timer. More... | |
MStatus | dgTimerReset () |
The function resets the dependency graph timers and counters for this node to zero. More... | |
double | dgTimer (const MdgTimerMetric timerMetric, const MdgTimerType timerType, MStatus *ReturnStatus=NULL) const |
The function returns the specified timer value for the current node. More... | |
MStatus | dgCallbacks (const MdgTimerType type, MStringArray &callbackName, MDoubleArray &value) |
Node callbacks that occur when timing is enabled get logged with the node and can be queried via this method. More... | |
MStatus | dgCallbackIds (const MdgTimerType type, const MString &callbackName, MCallbackIdArray &callbackId, MDoubleArray &value) |
This method provides a further breakdown of the per-callback time returned via dgCallbacks() by returning the data on a per-callbackId basis. More... | |
MStatus | addAttribute (const MObject &attr, MAttrClass type) |
This method is obsolete. More... | |
MStatus | removeAttribute (const MObject &attr, MAttrClass type) |
This method is obsolete. More... | |
Public Member Functions inherited from MFnBase | |
virtual | ~MFnBase () |
Class Destructor. More... | |
bool | hasObj (MFn::Type) const |
Determines whether or not the Function Set is compatible with the specified Maya Object within the API RTTI system. More... | |
bool | hasObj (const MObject &) const |
Determines whether or not the Function Set is compatible with the specified Maya Object within the API RTTI system. More... | |
MObject | object (MStatus *ReturnStatus=NULL) const |
Returns the MObject that is attached to the Function Set. More... | |
virtual MStatus | setObject (MObject &object) |
Attaches the Function Set to the specified Maya Object. More... | |
virtual MStatus | setObject (const MObject &object) |
NO SCRIPT SUPPORT. More... | |
Static Public Member Functions | |
static const char * | className () |
Returns the name of this class. More... | |
Static Public Member Functions inherited from MFnDependencyNode | |
static const char * | className () |
Returns the name of this class. More... | |
static MString | classification (const MString &nodeTypeName) |
Retrieves the classification string for a node type. More... | |
static unsigned int | allocateFlag (const MString pluginName, MStatus *ReturnStatus=NULL) |
Allocates a node flag for sole use by the caller. More... | |
static MStatus | deallocateFlag (const MString pluginName, unsigned int flag) |
Deallocates a node flag which was previously allocated by a call to allocateFlag. More... | |
static MStatus | deallocateAllFlags (const MString pluginName) |
Deallocates all of the node flags which are currently allocated to the specified plugin. More... | |
static void | enableDGTiming (bool enable) |
Globally enables or disables the DG node timing mechanism. More... | |
Static Public Member Functions inherited from MFnBase | |
static const char * | className () |
Returns the name of this class. More... | |
static const char * | typeString (MFn::Type) |
Returns the type string for a given type. More... | |
static bool | isValid (MFn::Type) |
Returns true if type is in the range of valid types. More... | |
Anim Curve Function Set.
Create, query and edit Anim Curve Nodes and the keys internal to those Nodes.
Create an Anim Curve Node and connect its output to any animatable attribute on another Node.
Evaluate an Anim Curve at a particular time.
Determine the number of keys held by an Anim Curve.
Determine the time and value of individual keys, as well as the (angle,weight) or (x,y) values and type of key tangents. The in-tangent refers to the tangent entering the key. The out-tangent refers to the tangent leaving the key.
Find the index of the key at, or closest to a particular time.
Set the time and value of individual keys, as well as the type of the tangent to the curve entering (in-tangent) and leaving (out-tangent) the key, specify the tangent as either (angle,weight) or (x,y).
Add and remove keys from an Anim Curve. Anim Curves are implemented as Dependency Graph (DG) Nodes. Each Node can have indexed keys.
There are eight different types of Anim Curve nodes:
Specifying the correct AnimCurveType during creation will avoid implicit unit conversion nodes.
Use the Anim Curve Function Set to create Anim Curve Nodes and connect them to animatable attributes on DG Nodes, as well as to query and edit an Anim Curve Node and its keys.
On creation, an Anim Curve Function Set may be attached to a given Anim Curve or it may be unattached. The Function Set may be attached to a different Anim Curve Node using the setObject() methods inherited from the Base Function Set (MFnBase) or with the create() methods.
Use the create() methods of an Anim Curve Function Set to create a new Anim Curve Node, attach the Function Set to the new Node and connect the output of the Node to a specific animatable Attribute or Plug of another Node. Additionally, the output of an Anim Curve Node may be attached to an Attribute or Plug of another DG Node using the DG Modifier method MDGModifier::connect().
Use the evaluate() methods to determine the value of an Anim Curve at a particular time or a given unitless input.
Use the addKey() and remove() methods to add and remove keys to and from an Anim Curve.
The query and edit methods of the Anim Curve Function Set act on keys at a specific 0-based index. [Note that the numKeys() method returns a 1-based value]. Keys can be accessed either randomly (via a 0-based index) or serially (using the find() and findClosest() methods).
Use the find() or findClosest() methods to determine the index of a key at or closest to a specific time respectively.
Use the specific query methods to determine the time, value and tangent information for a key at a given index.
Use the specific edit methods to set the time, value and tangent information for a key at a given index.
There are methods for setting the x,y values for the in- and out-tangents, as well as setting their angles and weights.
Setting the time of a key will fail if the new time would require a re-ordering of the keys. Use the remove() and addKey() methods to re-order the keys. Or use the keyframe command from mel.
The Maya developer's kit ships with example code (animDemo) which demonstrates how to evaluate a Maya animation curve independent from Maya. The animation parameter curves in Maya are defined by a restricted set of cubic two-dimensional Bezier curves. It is defined by four points. P1 = (x1, y1) is the (key,value) pair for the first key. P2 = (x2, y2) is a point which defines the outgoing tangent direction at P1. P4 = (x4, y4) defines the second key and P3 = (x3, y3) is a point which defines the incoming tangent direction at P4. There are some basic restrictions for the x coordinates of these points: x1 <= x2 <= x3 <= x4.
The 2-dimensional Bezier curve is defined as
F(u) yields a vector of two cubic polynomials [ Fx(u) Fy(u) ] which define an (x, y) position on the parameter curve for some u in the range [0,1].
For an animation parameter curve, we are given the x position and want to know its corresponding y position. To do this we use x = Fx(u) and solve for u. Fx(u) is cubic and the restrictions on valid values for x2 and x3 guarantee there will be only one real root value for u. Once we know u, we can plug it into Fy(u) to get the y value.
One important note is how the outgoing and incoming tangents directions for a key are saved internally and in the Maya Ascii file format. Instead of being specified as points, the tangent directions are specified as vectors. The outgoing tangent direction at P1 is specified and saved as the vector 3*(P2 - P1) and the incoming tangent direction is specified and saved as the vector 3*(P4 - P3).
An animation curve is basically a restricted form of a bezier curve for which the keys serve as the control points and have tangent information embedded within them. There are two different methods for converting tangent information into the control points of the bezier hull and we have taken to calling the two methods weighted and non-weighted tangents.
The animation curve is evaluated in a piecewise manner, which means that each segment between two keys is evaluated on its own, without regards to any other segment. The only time keys outside of a segment are considered is when tangent values are calculated for the spline, clamped, plateau or auto tangent types.
When evaluating an animation curve, a two stage process is used:
Animation curves may have either weighted or non-weighted tangents. With non-weighted tangents, tangents are implemented as vectors and P2 and P3 are internally adjusted to account for the time difference between P1 and P4.
When evaluating a time within a segment, the following algortithms are used:
enum AnimCurveType |
Defines the input and output type of the animation curve.
Animation curves in Maya support either time or unitless inputs. For example, curves set using setKeyframe have time inputs. Curves set using setDrivenKeyframe have unitless inputs. Maya supports four types of outputs: angular, linear, time and unitless. Time, angular and linear outputs work according to the units specified in user preferences and convert units when the preferences are changes. Unitless outputs are not sensitive to user preferences.
enum TangentType |
Defines the type of the tangent.
enum InfinityType |
MFnAnimCurve | ( | MObject & | object, |
MStatus * | ReturnStatus = NULL |
||
) |
MFnAnimCurve | ( | const MPlug & | plug, |
MStatus * | ReturnStatus = NULL |
||
) |
Class constructor that initializes the function set to the single Anim Curve Node connected to the given MPlug.
It is possible for a plug to be connected to more than one Anim Curve Node (for example the plug may be connected to a choice node and then several Anim Curves may be connected to the choice node). In this case the function set will attach to one of the Anim Curve Nodes and return MS::kNotImplemented.
[in] | plug | the MPlug to find a single Anim Curve Node |
[out] | ReturnStatus | the return status |
MFnAnimCurve | ( | const MObject & | object, |
MStatus * | ReturnStatus = NULL |
||
) |
|
virtual |
Function set type.
Return the class type : MFn::kAnimCurve.
Reimplemented from MFnDependencyNode.
|
static |
Returns the name of this class.
Return the class name : "MFnAnimCurve".
MObject create | ( | const MObject & | node, |
const MObject & | attribute, | ||
MDGModifier * | modifier = NULL , |
||
MStatus * | ReturnStatus = NULL |
||
) |
Creates a new Anim Curve Node, attaches the Function Set to the new Node (detaching from the current Node) and connects the output of the new Anim Curve Node to an animatable Attribute on another DG Node.
This method will fail if the target Attribute is not animatable, or if a connection to the target Attribute already exists.
Once the new Anim Curve Node has been created, the create() method finds the Plug associated with the target Attribute, makes sure the Attribute is animatable and then makes the connection.
The creation and connection of DG Nodes are DG operations. Operations on the DG are performed by DG Modifiers (MDGModifier). A DG Modifier provides methods for editing the DG, however, the operations are not performed immediately. DG operations must be undoable, therefore, the DG Modifier maintains a queue of pending DG operations which are performed when the MDGModifer::doIt() method is invoked. Subsequently, the queue of DG operations becomes the undo queue. When the MDGModifier::undoIt() method is invoked all of the operations on the queue are undone. DG operations on the queue can be done and undone as often as required as long as the Modifier exists and no other changes to the DG make the operations invalid. Once the Modifier holding the queue is destroyed, the queue is lost.
If a DG Modifier is passed as a parameter to this create() method, then that Modifier will be invoked to perform the creation and connection operations. At the completion of the create() method, the Modifier holds the necessary information to undo the operations, therefore, the caller of the create() method can undo the creation and connection if necessary.
If no Modifier is passed in, the create() method instantiates its own Modifier, uses it to perform the DG operations and then destroys the Modifier. The creation and connection, in this case, are not undoable by the caller.
[in] | node | DG Node to which the output of the new Anim Curve Node is to be connected |
[in] | attribute | Attribute on the given node to which the output of the new Anim Curve Node is to be connected |
[in] | modifier | Modifier to be used so undo capability is retained by caller |
[in] | ReturnStatus | Status Code |
MObject create | ( | const MObject & | node, |
const MObject & | attribute, | ||
AnimCurveType | animCurveType, | ||
MDGModifier * | modifier = NULL , |
||
MStatus * | ReturnStatus = NULL |
||
) |
Creates a new Anim Curve Node, attaches the Function Set to the new Node (detaching from the current Node) and connects the output of the new Anim Curve Node to an animatable Attribute on another DG Node.
This method will fail if the target Attribute is not animatable, or if a connection to the target Attribute already exists.
Once the new Anim Curve Node has been created, the create() method finds the Plug associated with the target Attribute, makes sure the Attribute is animatable and then makes the connection.
The creation and connection of DG Nodes are DG operations. Operations on the DG are performed by DG Modifiers (MDGModifier). A DG Modifier provides methods for editing the DG, however, the operations are not performed immediately. DG operations must be undoable, therefore, the DG Modifier maintains a queue of pending DG operations which are performed when the MDGModifer::doIt() method is invoked. Subsequently, the queue of DG operations becomes the undo queue. When the MDGModifier::undoIt() method is invoked all of the operations on the queue are undone. DG operations on the queue can be done and undone as often as required as long as the Modifier exists and no other changes to the DG make the operations invalid. Once the Modifier holding the queue is destroyed, the queue is lost.
If a DG Modifier is passed as a parameter to this create() method, then that Modifier will be invoked to perform the creation and connection operations. At the completion of the create() method, the Modifier holds the necessary information to undo the operations, therefore, the caller of the create() method can undo the creation and connection if necessary.
If no Modifier is passed in, the create() method instantiates its own Modifier, uses it to perform the DG operations and then destroys the Modifier. The creation and connection, in this case, are not undoable by the caller.
[in] | node | DG Node to which the output of the new Anim Curve Node is to be connected |
[in] | attribute | Attribute on the given node to which the output of the new Anim Curve Node is to be connected |
[in] | animCurveType | The animCurve Type to be created |
[in] | modifier | Modifier to be used so undo capability is retained by caller |
[out] | ReturnStatus | Status Code |
MObject create | ( | const MPlug & | plug, |
MDGModifier * | modifier = NULL , |
||
MStatus * | ReturnStatus = NULL |
||
) |
Creates a new Anim Curve Node, attaches the Function Set to the new Node (detaching from the current Node) and connects the output of the new Anim Curve Node to the Plug on an animatable Attribute on another DG Node.
This method will fail if the target Attribute is not animatable, or if a connection to the target Attribute already exists.
If a DG Modifier is passed as a parameter to this create() method, then that Modifier will be invoked to perform the creation and connection operations. At the completion of the create() method, the Modifier holds the necessary information to undo the operations, therefore, the caller of the create() method can undo the creation and connection if necessary.
If no Modifier is passed in, the create() method instantiates its own Modifier, uses it to perform the DG operations and then destroys the Modifier. The creation and connection, in this case, are not undoable by the caller.
[in] | plug | Plug to which the output of the new Anim Curve Node is to be connected |
[in] | modifier | Modifier to be used so undo capability is retained by caller |
[out] | ReturnStatus | Status Code |
MObject create | ( | const MPlug & | plug, |
AnimCurveType | animCurveType, | ||
MDGModifier * | modifier = NULL , |
||
MStatus * | ReturnStatus = NULL |
||
) |
Creates a new Anim Curve Node, attaches the Function Set to the new Node (detaching from the current Node) and connects the output of the new Anim Curve Node to the Plug on an animatable Attribute on another DG Node.
This method will fail if the target Attribute is not animatable, or if a connection to the target Attribute already exists.
If a DG Modifier is passed as a parameter to this create() method, then that Modifier will be invoked to perform the creation and connection operations. At the completion of the create() method, the Modifier holds the necessary information to undo the operations, therefore, the caller of the create() method can undo the creation and connection if necessary.
If no Modifier is passed in, the create() method instantiates its own Modifier, uses it to perform the DG operations and then destroys the Modifier. The creation and connection, in this case, are not undoable by the caller.
[in] | plug | Plug to which the output of the new Anim Curve Node is to be connected |
[in] | animCurveType | The animCurve type to be created |
[in] | modifier | Modifier to be used so undo capability is retained by caller |
[out] | ReturnStatus | Status Code |
MObject create | ( | AnimCurveType | animCurveType, |
MDGModifier * | modifier = NULL , |
||
MStatus * | ReturnStatus = NULL |
||
) |
Creates a new Anim Curve Node, attaches the Function Set to the new Node (detaching from the current Node) but does not attempt to connect the new Anim Curve Node.
If a DG Modifier is passed as a parameter to this create() method, then that Modifier will be invoked to perform the creation and connection operations. At the completion of the create() method, the Modifier holds the necessary information to undo the operations, therefore, the caller of the create() method can undo the creation and connection if necessary.
If no Modifier is passed in, the create() method instantiates its own Modifier, uses it to perform the DG operations and then destroys the Modifier. The creation and connection, in this case, are not undoable by the caller.
[in] | animCurveType | The type of Anim Curve to be created |
[in] | modifier | Modifier to be used so undo capability is retained by caller |
[out] | ReturnStatus | Status Code |
MFnAnimCurve::AnimCurveType animCurveType | ( | MStatus * | ReturnStatus = NULL | ) | const |
Returns the animCurve type.
[out] | ReturnStatus | Status Code |
MFnAnimCurve::AnimCurveType timedAnimCurveTypeForPlug | ( | MPlug & | plug, |
MStatus * | ReturnStatus = NULL |
||
) | const |
Returns the timed animCurve type appropriate for the specified plug.
[in] | plug | plug |
[out] | ReturnStatus | Status Code |
MFnAnimCurve::AnimCurveType unitlessAnimCurveTypeForPlug | ( | MPlug & | plug, |
MStatus * | ReturnStatus = NULL |
||
) | const |
Returns the unitless animCurve type appropriate for the specified plug.
[in] | plug | plug |
[out] | ReturnStatus | Status Code |
Determines the interpolated output value of Anim Curves of type kAnimCurveTA, kAnimCurveTL and kAnimCurveTU at the specified time.
[in] | atTime | Time at which the Anim Curve is to be evaluated |
[out] | ReturnStatus | Status Code . |
Determines the interpolated output value of Anim Curves of type kAnimCurveTA, kAnimCurveTL and kAnimCurveTU at the specified time.
[in] | atTime | Time at which the Anim Curve is to be evaluated |
[out] | value | Interpolated value of Anim Curve at specified time |
Determines the interpolated output value of Anim Curves of type kAnimCurveTT at the specified time.
[in] | atTime | Time at which the Anim Curve is to be evaluated |
[out] | timeValue | Interpolated output time of Anim Curve at specified time |
MStatus evaluate | ( | const double & | atUnitlessInput, |
double & | value | ||
) | const |
Determines the interpolated output value of Anim Curves of type kAnimCurveUA, kAnimCurveUL and kAnimCurveUU at the specified unitless input.
[in] | atUnitlessInput | Input value at which the Anim Curve is to be evaluated |
[out] | value | Interpolated output value of Anim Curve at specified input value |
Determines the interpolated output value of Anim Curves of type kAnimCurveUT at the specified unitless input.
[in] | atUnitlessInput | Input value at which the Anim Curve is to be evaluated |
[out] | timeValue | Interpolated output time of Anim Curve at specified time |
bool isStatic | ( | MStatus * | ReturnStatus = NULL | ) | const |
Determines whether or not the animCurve is static.
The animCurve is considered to be static if it would return the same value regardless of the evaluation time. This basically means that the values of all the keys are the same and the y component of all the tangents is 0.
For efficiency reasons, the isStatic flag is conservative. If the flag is true, the curve is guaranteed to be static. Since Maya assumes a recently edited curve may be edited again, the application defers certain analysis of the curve to determine if it's static. Therefore, isStatic may return false when edit operations convert the curve from non-static to static. It is possible to manually trigger curve analysis operations using the dgValidateCurve command.
[out] | ReturnStatus | Status Code . |
unsigned int numKeyframes | ( | MStatus * | ReturnStatus = NULL | ) | const |
This method is obsolete.
[out] | ReturnStatus | Status Code |
unsigned int numKeys | ( | MStatus * | ReturnStatus = NULL | ) | const |
Determines the number of keys on the Anim Curve Node.
[out] | ReturnStatus | Status Code |
MStatus remove | ( | unsigned int | index, |
MAnimCurveChange * | change = NULL |
||
) |
Removes the key at the specified index.
If this method is called from within an MItKeyframe iterator, the results are undefined (i.e., it is likely that the incorrect key will be removed). This is because keys are automatically sorted (i.e., assigned new index values) everytime time they are modified in such a manner that could cause them to change order (e.g., they are moved, keys are inserted or removed, etc.).
[in] | index | Index of the key to be removed |
[out] | change | Optional cache to store undo/redo information. |
MStatus addKeyframe | ( | const MTime & | time, |
double | value, | ||
MAnimCurveChange * | change = NULL |
||
) |
Adds a new key with the given value at the specified time.
Tangent types are set to kTangentGlobal. If you immediately query this key for its tangent type (after it is added), it will not be kTangentGlobal, rather it will be the specific type referred to by kTangentGlobal.
[in] | time | Time at which the key is to be added |
[in] | value | Value to which the key is to be set |
[out] | change | Optional cache to store undo/redo information. |
MStatus addKeyframe | ( | const MTime & | time, |
double | value, | ||
TangentType | tangentInType, | ||
TangentType | tangentOutType, | ||
MAnimCurveChange * | change = NULL |
||
) |
Adds a new key with the given value and tangent types at the specified time.
[in] | time | Time at which the key is to be added |
[in] | value | Value to which the key is to be set |
[in] | tangentInType | In tangent type for the key |
[in] | tangentOutType | Out tangent type for the key |
[out] | change | Optional cache to store undo/redo information. |
unsigned int addKey | ( | const MTime & | time, |
double | value, | ||
TangentType | tangentInType = kTangentGlobal , |
||
TangentType | tangentOutType = kTangentGlobal , |
||
MAnimCurveChange * | change = NULL , |
||
MStatus * | ReturnStatus = NULL |
||
) |
Adds a new key with the given value and tangent types at the specified time for curves of type kAnimCurveTA, kAnimCurveTL and kAnimCurveTU.
[in] | time | Time at which the key is to be added |
[in] | value | Value to which the key is to be set |
[in] | tangentInType | In tangent type for the key |
[in] | tangentOutType | Out tangent type for the key |
[out] | change | Optional cache to store undo/redo information. |
[out] | ReturnStatus | Status Code |
unsigned int addKey | ( | const MTime & | timeInput, |
const MTime & | timeValue, | ||
TangentType | tangentInType = kTangentGlobal , |
||
TangentType | tangentOutType = kTangentGlobal , |
||
MAnimCurveChange * | change = NULL , |
||
MStatus * | ReturnStatus = NULL |
||
) |
Adds a new key with the given output time value and tangent types at the specified input time for curves of type kAnimCurveTT.
[in] | timeInput | Time at which the key is to be added |
[in] | timeValue | Value to which the key is to be set |
[in] | tangentInType | In tangent type for the key |
[in] | tangentOutType | Out tangent type for the key |
[out] | change | Optional cache to store undo/redo information. |
[out] | ReturnStatus | Status Code |
unsigned int addKey | ( | double | unitlessInput, |
double | value, | ||
TangentType | tangentInType = kTangentGlobal , |
||
TangentType | tangentOutType = kTangentGlobal , |
||
MAnimCurveChange * | change = NULL , |
||
MStatus * | ReturnStatus = NULL |
||
) |
Adds a new key with the given value and tangent types at the specified unitless input for curves of type kAnimCurveUA, kAnimCurveUL and kAnimCurveUU.
[in] | unitlessInput | Unitless input at which the key is to be added |
[in] | value | Value to which the key is to be set |
[in] | tangentInType | In tangent type for the key |
[in] | tangentOutType | Out tangent type for the key |
[out] | change | Optional cache to store undo/redo information. |
[out] | ReturnStatus | Status Code |
unsigned int addKey | ( | double | unitlessInput, |
const MTime & | timeValue, | ||
TangentType | tangentInType = kTangentGlobal , |
||
TangentType | tangentOutType = kTangentGlobal , |
||
MAnimCurveChange * | change = NULL , |
||
MStatus * | ReturnStatus = NULL |
||
) |
Adds a new key with the given output time value and tangent types at the specified unitless input for curves of type kAnimCurveUT.
[in] | unitlessInput | Unitless input at which the key is to be added |
[in] | timeValue | Value to which the key is to be set |
[in] | tangentInType | In tangent type for the key |
[in] | tangentOutType | Out tangent type for the key |
[out] | change | Optional cache to store undo/redo information. |
[out] | ReturnStatus | Status Code |
MStatus addKeys | ( | MTimeArray * | timeArray, |
MDoubleArray * | valueArray, | ||
TangentType | tangentInType = kTangentGlobal , |
||
TangentType | tangentOutType = kTangentGlobal , |
||
bool | keepExistingKeys = false , |
||
MAnimCurveChange * | change = NULL |
||
) |
Add a set of new keys with the given corresponding values and tangent types at the specified times.
This method only works for Anim Curves of type kAnimCurveTA, kAnimCurveTL and kAnimCurveTU.
This method is tuned to provide best performance when:
These optimisations are geared towards motion capture plug-ins where a large numbers of keys must be added to a curve in a single operation.
Note: The timeArray and valueArray arrays are owned by the calling function. This method will copy those arrays to internal structures for use. As such, It is up to the caller to ensure that the memory allocated for the above arrays are deallocated appropriately.
[in] | timeArray | Times at which keys are to be added |
[in] | valueArray | Values to which the keys is to be set |
[in] | tangentInType | In tangent type for all the added keys |
[in] | tangentOutType | Out tangent type for all the added keys |
[in] | keepExistingKeys | Specifies whether the new keys should be merged with existing keys, or if they should be cut prior to adding the new keys |
[out] | change | Optional cache to store undo/redo information. |
MStatus addKeysWithTangents | ( | MTimeArray * | timeArray, |
MDoubleArray * | valueArray, | ||
TangentType | tangentInType = kTangentGlobal , |
||
TangentType | tangentOutType = kTangentGlobal , |
||
MIntArray * | tangentInTypeArray = NULL , |
||
MIntArray * | tangentOutTypeArray = NULL , |
||
MDoubleArray * | tangentInXArray = NULL , |
||
MDoubleArray * | tangentInYArray = NULL , |
||
MDoubleArray * | tangentOutXArray = NULL , |
||
MDoubleArray * | tangentOutYArray = NULL , |
||
MIntArray * | tangentsLockedArray = NULL , |
||
MIntArray * | weightsLockedArray = NULL , |
||
bool | convertUnits = true , |
||
bool | keepExistingKeys = false , |
||
MAnimCurveChange * | change = NULL |
||
) |
Add a set of new keys with the given corresponding values and tangent types at the specified times.
This method only works for Anim Curves of type kAnimCurveTA, kAnimCurveTL and kAnimCurveTU.
(Optional) Specify the tangent types for keys in tangentInTypeArray and tangentOutTypeArray. When an INT_MAX is found, the method will use the tangent types from tangentInType and tangentOutType parameters.
(Optional) Specify the tangents for keys in tangentInXArray, tangentInYArray, tangentOutXArray and tangentOutYArray. When a DBL_MAX is found, the method will leave tangents unchanged.
(Optional) Specify whether the tangents should be locked before the method returns in tangentsLockedArray. When an INT_MAX is found, the tangent lock is unchanged.
(Optional) Specify whether the weights should be locked before the method returns in weightsLockedArray. When an INT_MAX is found, the weight lock is unchanged.
This method is tuned to provide best performance when:
These optimisations are geared towards motion capture plug-ins where a large numbers of keys must be added to a curve in a single operation.
Note: All arrays are owned by the calling function. This method will copy those arrays to internal structures for use. As such, It is up to the caller to ensure that the memory allocated for the above arrays are deallocated appropriately.
[in] | timeArray | Times at which keys are to be added |
[in] | valueArray | Values to which the keys is to be set |
[in] | tangentInType | In tangent type for all the added keys |
[in] | tangentOutType | Out tangent type for all the added keys |
[in] | tangentInTypeArray | In tangent types for individual added keys |
[in] | tangentOutTypeArray | Out tangent types for individual added keys |
[in] | tangentInXArray | Absolute x value of the slope of in tangent |
[in] | tangentInYArray | Absolute y value of the slope of in tangent |
[in] | tangentOutXArray | Absolute x value of the slope of out tangent |
[in] | tangentOutYArray | Absolute y value of the slope of out tangent |
[in] | tangentsLockedArray | Lock or unlock the tangents |
[in] | weightsLockedArray | Lock or unlock the weights |
[in] | convertUnits | Whether to convert to UI units before setting |
[in] | keepExistingKeys | Specifies whether the new keys should be merged with existing keys, or if they should be cut prior to adding the new keys |
[out] | change | Optional cache to store undo/redo information. |
unsigned int insertKey | ( | const MTime & | time, |
bool | breakdown = false , |
||
MAnimCurveChange * | change = nullptr , |
||
MStatus * | ReturnStatus = nullptr |
||
) |
Inserts a key at the specified time adjusting neighboring tangents to maintain curve shape.
This method is the API equivalent to setKeyframe -insert.
[in] | time | Time to insert the key |
[in] | breakdown | Whether the new key is a breakdown key |
[in] | change | Optional cache to store undo/redo information. |
[out] | ReturnStatus | Status Code |
Determines the index of the key which is set at the specified time.
[in] | time | Time for which a key index is required |
[in] | index | Key index at the specified time (implicit return) |
[out] | ReturnStatus | Status Code |
bool find | ( | double | unitlessInput, |
unsigned int & | index, | ||
MStatus * | ReturnStatus = NULL |
||
) | const |
Determines the index of the key which is set at the specified unitless input value.
[in] | unitlessInput | Value for which a key index is required |
[in] | index | Key index at the specified time (implicit return) |
[out] | ReturnStatus | Status Code |
Determines the index of the key which is set at the time closest to the specified time.
[in] | time | Time for which a key index is required |
[out] | ReturnStatus | Status Code . |
unsigned int findClosest | ( | double | unitlessInput, |
MStatus * | ReturnStatus = NULL |
||
) | const |
Determines the index of the key which is set at the time closest to the specified unitless input value.
[in] | unitlessInput | Input value for which a key index is required |
[out] | ReturnStatus | Status Code . |
Determines the time of the key at the specified index.
[in] | index | Index of the key for which the time is required |
[out] | ReturnStatus | Status Code . |
double value | ( | unsigned int | index, |
MStatus * | ReturnStatus = NULL |
||
) | const |
Determines the value of the key at the specified index.
This method should only be used on Anim Curves of type kAnimCurve*A, kAnimCurve*L or kAnimCurve*U.
[in] | index | Index of the key for which the value is required |
[out] | ReturnStatus | Status Code . |
double unitlessInput | ( | unsigned int | index, |
MStatus * | ReturnStatus = NULL |
||
) | const |
Determines the unitless input value of the key at the specified index.
This method should only be used on Anim Curves of type kAnimCurveU*.
[in] | index | Index of the key for which the input value is required |
[out] | ReturnStatus | Status Code . |
MStatus setValue | ( | unsigned int | index, |
double | value, | ||
MAnimCurveChange * | change = NULL |
||
) |
Sets the value of the key at the specified index.
This method should only be used on Anim Curves of type kAnimCurve*A, kAnimCurve*L or kAnimCurve*U.
[in] | index | Index of the key for which the value is to be set |
[in] | value | Value to which the key is to be set |
[out] | change | Optional cache to store undo/redo information. |
MStatus setTime | ( | unsigned int | index, |
const MTime & | time, | ||
MAnimCurveChange * | change = NULL |
||
) |
Sets the time of the key at the specified index.
This will fail if setting the time would require re-ordering of the keys. This method should only be used on Anim Curves of type kAnimCurveT*.
Tangents may be changed so that the curve remains monotonic with respect to time.
[in] | index | Index of the key for which the time is to be set |
[in] | time | Time to which the indexed key time is to be set |
[out] | change | Optional cache to store undo/redo information. |
MStatus setUnitlessInput | ( | unsigned int | index, |
double | unitlessInput, | ||
MAnimCurveChange * | change = NULL |
||
) |
Sets the value of the unitless input of the key at the specified index.
This will fail if setting the value would require re-ordering of the keys. This method should only be used on Anim Curves of type kAnimCurveU*.
Tangents may be changed so that the curve remains monotonic with respect to the unitless input.
[in] | index | Index of the key for which the unitless input value is to be set |
[in] | unitlessInput | Value to which the indexed key unitless input value is to be set |
[out] | change | Optional cache to store undo/redo information. |
bool isTimeInput | ( | MStatus * | ReturnStatus = NULL | ) | const |
Determines the input type of the animCurve.
[out] | ReturnStatus | Status Code . |
bool isUnitlessInput | ( | MStatus * | ReturnStatus = NULL | ) | const |
Determines the input type of the animCurve.
[out] | ReturnStatus | Status Code . |
MFnAnimCurve::TangentType inTangentType | ( | unsigned int | index, |
MStatus * | ReturnStatus = NULL |
||
) | const |
Determines the type of the tangent to the curve entering the current key.
[in] | index | Index of the key for which the tangent type is required |
[out] | ReturnStatus | Status Code . |
MFnAnimCurve::TangentType outTangentType | ( | unsigned int | index, |
MStatus * | ReturnStatus = NULL |
||
) | const |
Determines the type of the tangent to the curve leaving the current key.
[in] | index | Index of the key for which the tangent type is required |
[out] | ReturnStatus | Status Code . |
MStatus setInTangentType | ( | unsigned int | index, |
TangentType | tangentType, | ||
MAnimCurveChange * | change = NULL |
||
) |
Sets the type of the tangent to the curve entering the key at the specified index.
[in] | index | Index of the key for which the tangent type is to be set |
[in] | tangentType | Type to which the tangent is to be set |
[out] | change | Optional cache to store undo/redo information. |
MStatus setOutTangentType | ( | unsigned int | index, |
TangentType | tangentType, | ||
MAnimCurveChange * | change = NULL |
||
) |
Sets the type of the tangent to the curve leaving the key at the specified index.
[in] | index | Index of the key for which the tangent type is to be set |
[in] | tangentType | Type to which the tangent is to be set |
[out] | change | Optional cache to store undo/redo information. |
MStatus setTangentTypes | ( | MIntArray | indexArray, |
TangentType | inTangentType = kTangentGlobal , |
||
TangentType | outTangentType = kTangentGlobal , |
||
MAnimCurveChange * | change = NULL |
||
) |
Sets the tangent types for multiple keys.
[in] | indexArray | Indices of the key for which the tangent type is to be set |
[in] | inTangentType | Type to which the in tangent is to be set |
[in] | outTangentType | Type to which the out tangent is to be set |
[out] | change | Optional cache to store undo/redo information. |
MStatus getTangent | ( | unsigned int | index, |
TangentValue & | x, | ||
TangentValue & | y, | ||
bool | inTangent | ||
) | const |
Determines the x,y value representing the vector of the in- or out-tangent (depending on the value of the inTangent parameter) to the curve for the key at the specified index.
The values returned will be in Maya's internal units (seconds for time, centimeters for linear, radians for angles). The following examples demonstrates how to convert from internal units of seconds into the current user time unit.
[in] | index | Index of the key for which the tangent x,y value is required |
[out] | x | The x value of the slope of the tangent in seconds |
[out] | y | Absolute y value of the slope of the tangent |
[in] | inTangent | If true, the in-tangent is returned, else, the out-tangent is returned |
Determines the angle and weight of the in- or out-tangent to the curve for the key at the specified index.
Recall that tangents are stored as vectors internally and in the Maya Ascii file format. This means that the returned angle and weight will be converted from an (x,y) pair to represent the vector according to the following formula:
where x is in seconds and y is in centimeters for linear units and radians for angular units.
[in] | index | Index of the key for which the tangent x,y value is required |
[out] | angle | The tangent angle |
[out] | weight | The tangent weight |
[in] | inTangent | If true, the inTangent is returned, else, the outTangent is returned |
MStatus setTangent | ( | unsigned int | index, |
TangentValue | x, | ||
TangentValue | y, | ||
bool | inTangent, | ||
MAnimCurveChange * | change = NULL , |
||
bool | convertUnits = true |
||
) |
Sets the tangent for the key at the specified index.
If convertUnits is true (the default) the x value will be scaled by the current UI time units and the y value will be scaled by the relevant UI units for the output type of the animation curve (i.e. linear units for a curve that outputs linear data, and so on).
Note that if this method is called on a locked tangent (which they are by default), the corresponding out- or in-tangent will be modified as well (i.e., they will both be set to fixed). To prevent this from occurring, you must first unlock the tangent, make your modifications and then restore the lock setting for the tangent afterwards.
[in] | index | Index of the key for which the tangent type is to be set |
[in] | x | Absolute x value of the slope of the tangent |
[in] | y | Absolute y value of the slope of the tangent |
[in] | inTangent | If true, the inTangent is modified, else, the outTangent is modified |
[out] | change | Optional cache to store undo/redo information. |
[in] | convertUnits | Whether to convert to UI units before setting |
MStatus setTangent | ( | unsigned int | index, |
const MAngle & | angle, | ||
double | weight, | ||
bool | inTangent, | ||
MAnimCurveChange * | change = NULL , |
||
bool | convertUnits = true |
||
) |
Sets the tangent for the key at the specified index.
If convertUnits is true (the default) the x value will be scaled by the current UI time units and the y value will be scaled by the relevant UI units for the output type of the animation curve (i.e. linear units for a curve that outputs linear data, and so on).
Recall that tangents are stored as vectors internally and in the Maya Ascii file format. This means that the provided angle and weight will be converted into an (x,y) pair to represent the vector according to the following formula:
Note that if this method is called on a locked tangent (which they are by default), the corresponding out- or in-tangent will be modified as well (i.e., they will both be set to fixed). To prevent this from occurring, you must first unlock the tangent, make your modifications and then restore the lock setting for the tangent afterwards.
[in] | index | Index of the key for which the tangent type is to be set |
[in] | angle | The angle to set the tangent |
[in] | weight | The weight to set the tangent |
[in] | inTangent | If true, the inTangent is modified, else, the outTangent is modified |
[out] | change | Optional cache to store undo/redo information. |
[in] | convertUnits | Whether to convert to UI units before setting |
MStatus setAngle | ( | unsigned int | index, |
const MAngle & | angle, | ||
bool | inTangent, | ||
MAnimCurveChange * | change = NULL |
||
) |
Set the in- or out-angle of the tangent for the key at the given index.
Note that if this method is called on a locked tangent (which they are by default), the corresponding out- or in-tangent will be modified as well (i.e., they will both be set to fixed). To prevent this from occurring, you must first unlock the tangent, make your modifications and then restore the lock setting for the tangent afterwards.
[in] | index | Index of the key |
[in] | angle | The new in- or out-angle for the key's tangent |
[in] | inTangent | If true, set the in-tangent, else out-tangent |
[out] | change | Optional cache to store undo/redo information. |
MStatus setWeight | ( | unsigned int | index, |
double | weight, | ||
bool | inTangent, | ||
MAnimCurveChange * | change = NULL |
||
) |
Set the in- or out-weight of the tangent for the key at the given index.
Note that if this method is called on a locked weight (which they are by default), the corresponding out- or in-weight will be modified as well. To prevent this from occurring, you must first unlock the weight, make your modifications and then restore the lock setting for the weight afterwards.
[in] | index | Index of the key |
[in] | weight | The new in- or out-weight for the key's tangent |
[in] | inTangent | If true, set the in-tangent, else set out-tangent |
[out] | change | Optional cache to store undo/redo information. |
bool weightsLocked | ( | unsigned int | index, |
MStatus * | ReturnStatus = NULL |
||
) | const |
Determines whether the weights are locked at the given key.
[in] | index | Index of the key to check for locked weights |
[out] | ReturnStatus | Status Code . |
bool tangentsLocked | ( | unsigned int | index, |
MStatus * | ReturnStatus = NULL |
||
) | const |
Determines whether the tangents are locked at the given key.
[in] | index | Index of the key to check for locked tangents |
[out] | ReturnStatus | Status Code . |
MStatus setWeightsLocked | ( | unsigned int | index, |
bool | locked, | ||
MAnimCurveChange * | change = NULL |
||
) |
Lock or unlock the weights at the given key.
[in] | index | Index of the key at which to set/unset the locks |
[in] | locked | true if the weights are to be locked, false otherwise |
[out] | change | Optional cache to store undo/redo information. |
MStatus setTangentsLocked | ( | unsigned int | index, |
bool | locked, | ||
MAnimCurveChange * | change = NULL |
||
) |
Lock or unlock the tangents at the given key.
[in] | index | Index of the key at which to set/unset the locks |
[in] | locked | true if the tangents are to be locked, false otherwise |
[out] | change | Optional cache to store undo/redo information. |
MFnAnimCurve::InfinityType preInfinityType | ( | MStatus * | ReturnStatus = NULL | ) | const |
Determines the behaviour of the curve for the range occurring before the first key.
[out] | ReturnStatus | Status Code . |
MFnAnimCurve::InfinityType postInfinityType | ( | MStatus * | ReturnStatus = NULL | ) | const |
Determines the behaviour of the curve for the range occurring after the last key.
[out] | ReturnStatus | Status Code . |
MStatus setPreInfinityType | ( | MFnAnimCurve::InfinityType | infinityType, |
MAnimCurveChange * | change = NULL |
||
) |
Set the behaviour of the curve for the range occurring before the first key.
[in] | infinityType | The infinity type to be set. |
[out] | change | Optional cache to store undo/redo information. |
MStatus setPostInfinityType | ( | MFnAnimCurve::InfinityType | infinityType, |
MAnimCurveChange * | change = NULL |
||
) |
Set the behaviour of the curve for the range occurring after the last key.
[in] | infinityType | The infinity type to be set. |
[out] | change | Optional cache to store undo/redo information. |
bool isWeighted | ( | MStatus * | ReturnStatus = NULL | ) | const |
Determines whether or not the curve has weighted tangents.
[out] | ReturnStatus | Status Code . |
MStatus setIsWeighted | ( | bool | isWeighted, |
MAnimCurveChange * | change = NULL |
||
) |
Sets whether or not the curve has weighted tangents.
[in] | isWeighted | Whether or not the curve should have weighted tangents |
[out] | change | Optional cache to store undo/redo information. |
bool isBreakdown | ( | unsigned int | index, |
MStatus * | ReturnStatus = NULL |
||
) | const |
Determines whether or not a key is a breakdown.
[in] | index | The key's index |
[out] | ReturnStatus | Status Code . |
MStatus setIsBreakdown | ( | unsigned int | index, |
bool | isBreakdown, | ||
MAnimCurveChange * | change = NULL |
||
) |
Sets the breakdown state of a key at a given index.
[in] | index | Index of the key whose breakdown state is to be modified |
[in] | isBreakdown | The new breakdown state for the key. |
[out] | change | Optional cache to store undo/redo information. |