Python API 2.0 Reference: OpenMayaAnim.MFnAnimCurve Class Reference

+ Inheritance diagram for OpenMayaAnim.MFnAnimCurve:

Public Member Functions

__init__ ()
 
addKey ()
 
addKeys ()
 
addKeysWithTangents ()
 
create ()
 
evaluate ()
 
find ()
 
findClosest ()
 
getTangentAngleWeight ()
 
getTangentXY ()
 
inTangentType ()
 
input ()
 
insertKey ()
 
isBreakdown ()
 
outTangentType ()
 
remove ()
 
setAngle ()
 
setInTangentType ()
 
setInput ()
 
setIsBreakdown ()
 
setIsWeighted ()
 
setOutTangentType ()
 
setPostInfinityType ()
 
setPreInfinityType ()
 
setTangent ()
 
setTangentTypes ()
 
setTangentsLocked ()
 
setValue ()
 
setWeight ()
 
setWeightsLocked ()
 
tangentsLocked ()
 
timedAnimCurveTypeForPlug ()
 
unitlessAnimCurveTypeForPlug ()
 
value ()
 
weightsLocked ()
 
- Public Member Functions inherited from OpenMaya.MFnDependencyNode
__init__ ()
 
absoluteName ()
 
addAttribute ()
 
addExternalContentForFileAttr ()
 
affectsAnimation ()
 
attribute ()
 
attributeClass ()
 
attributeCount ()
 
canBeWritten ()
 
create ()
 
dgCallbackIds ()
 
dgCallbacks ()
 
dgTimer ()
 
dgTimerOff ()
 
dgTimerOn ()
 
dgTimerQueryState ()
 
dgTimerReset ()
 
findAlias ()
 
findPlug ()
 
getAffectedAttributes ()
 
getAffectingAttributes ()
 
getAliasAttr ()
 
getAliasList ()
 
getConnections ()
 
getExternalContent ()
 
hasAttribute ()
 
hasUniqueName ()
 
isFlagSet ()
 
isNewAttribute ()
 
isTrackingEdits ()
 
name ()
 
plugsAlias ()
 
removeAttribute ()
 
reorderedAttribute ()
 
setAffectsAnimation ()
 
setAlias ()
 
setDoNotWrite ()
 
setExternalContent ()
 
setExternalContentForFileAttr ()
 
setFlag ()
 
setName ()
 
setUuid ()
 
userNode ()
 
uuid ()
 
- Public Member Functions inherited from OpenMaya.MFnBase
__init__ ()
 
hasObj ()
 
object ()
 
setObject ()
 
type ()
 

Static Public Attributes

int kAnimCurveTA = 0
 
int kAnimCurveTL = 1
 
int kAnimCurveTT = 2
 
int kAnimCurveTU = 3
 
int kAnimCurveUA = 4
 
int kAnimCurveUL = 5
 
int kAnimCurveUT = 6
 
int kAnimCurveUU = 7
 
int kAnimCurveUnknown = 8
 
int kConstant = 0
 
int kCycle = 3
 
int kCycleRelative = 4
 
int kLinear = 1
 
int kOscillate = 5
 
int kTangentAuto = 11
 
int kTangentClamped = 8
 
int kTangentCustomEnd = 32767
 
int kTangentCustomStart = 64
 
int kTangentFast = 7
 
int kTangentFixed = 1
 
int kTangentFlat = 3
 
int kTangentGlobal = 0
 
int kTangentLinear = 2
 
int kTangentPlateau = 9
 
int kTangentShared1 = 19
 
int kTangentShared2 = 20
 
int kTangentShared3 = 21
 
int kTangentShared4 = 22
 
int kTangentShared5 = 23
 
int kTangentShared6 = 24
 
int kTangentShared7 = 25
 
int kTangentShared8 = 26
 
int kTangentSlow = 6
 
int kTangentSmooth = 4
 
int kTangentStep = 5
 
int kTangentStepNext = 10
 
int kTangentTypeCount = 32768
 
- Static Public Attributes inherited from OpenMaya.MFnDependencyNode
int kTimerMetrics = 9
 
int kTimerTypes = 3
 
int kExtensionAttr = 3
 
int kInvalidAttr = 4
 
int kLocalDynamicAttr = 1
 
int kNormalAttr = 2
 
int kTimerInvalidState = 3
 
int kTimerOff = 0
 
int kTimerOn = 1
 
int kTimerUninitialized = 2
 
int kTimerMetric_callback = 0
 
int kTimerMetric_callbackNotViaAPI = 6
 
int kTimerMetric_callbackViaAPI = 5
 
int kTimerMetric_compute = 1
 
int kTimerMetric_computeDuringCallback = 7
 
int kTimerMetric_computeNotDuringCallback = 8
 
int kTimerMetric_dirty = 2
 
int kTimerMetric_draw = 3
 
int kTimerMetric_fetch = 4
 
int kTimerType_count = 2
 
int kTimerType_inclusive = 1
 
int kTimerType_self = 0
 

Properties

 animCurveType
 
 isStatic
 
 isTimeInput
 
 isUnitlessInput
 
 isWeighted
 
 numKeys
 
 postInfinityType
 
 preInfinityType
 
- Properties inherited from OpenMaya.MFnDependencyNode
 isDefaultNode
 
 isFromReferencedFile
 
 isLocked
 
 isShared
 
 namespace
 
 pluginName
 
 typeId
 
 typeName
 

Additional Inherited Members

- Static Public Member Functions inherited from OpenMaya.MFnDependencyNode
allocateFlag ()
 
classification ()
 
deallocateAllFlags ()
 
deallocateFlag ()
 

Detailed Description

Function set for operations on anim curves.

__init__()
Initializes a new, empty MFnAnimCurve object.

__init__(MObject object)
Initializes a new MFnAnimCurve and attaches it
to an animCurve object.

__init__(MPlug plug)
Initializes a new MFnAnimCurve and attaches it
to the single animCurve node connected to the given MPlug.

Method resolution order:
-   MFnAnimCurve
-   OpenMaya.MFnDependencyNode
-   OpenMaya.MFnBase
-   __builtin__.object

Constructor & Destructor Documentation

OpenMayaAnim.MFnAnimCurve.__init__ ( )
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Member Function Documentation

OpenMayaAnim.MFnAnimCurve.addKey ( )
addKey(at, value, tangentInType=kTangentGlobal, tangentOutType=kTangentGlobal, change=None) -> unsigned int

Adds a new key with the given value at the specified time.
at and value can both be either MTime or double,depending on what is appropriate for the animCurve type.
change is an optional MAnimCurveChange.
OpenMayaAnim.MFnAnimCurve.addKeys ( )
addKeys(times, values, tangentInType=kTangentGlobal, tangentOutType=kTangentGlobal, keepExistingKeys=False, change=None) -> self

Add a set of new keys with the given corresponding values and tangent typesat the specified times.  This method only works for animCurves of typekAnimCurveTA, kAnimCurveTL and kAnimCurveTU.
OpenMayaAnim.MFnAnimCurve.addKeysWithTangents ( )
addKeysWithTangents(times, values, tangentInType=kTangentGlobal, tangentOutType=kTangentGlobal, tangentInTypeArray=None, tangentOutTypeArray=None, tangentInXArray=None, tangentInYArray=None, tangentOutXArray=None, tangentOutYArray=None, tangentsLockedArray=None, weightsLockedArray=None, convertUnits=True, keepExistingKeys=False, change=None) -> self

Add a set of new keys with the given corresponding values, tangent types and tangents at the specified times.  This method only works for animCurves of typekAnimCurveTA, kAnimCurveTL and kAnimCurveTU.
OpenMayaAnim.MFnAnimCurve.create ( )
create(node, attribute, animCurveType=kAnimCurveUnknown [, modifier] ) -> MObject
create(plug, animCurveType=kAnimCurveUnknown [, modifier] ) -> MObject
create(animCurveType [, modifier] ) -> MObject

Creates a new animCurve node.
If node and attribute (MObject) are supplied, the animCurvewill be connected to the given attribute on the given node.
If plug (MPlug) is supplied, the animCurvewill be connected to the given plug.
modifier is an optional MDGModifier which can be used to later undo the operation.
animCurveType specifies the type of animCurve to create. Valid values are:
kAnimCurveTA            Time to Angular
kAnimCurveTL            Time to Linear
kAnimCurveTT            Time to Time
kAnimCurveTU            Time to Unitless
kAnimCurveUA            Unitless to Angular
kAnimCurveUL            Unitless to Linear
kAnimCurveUT            Unitless to Time
kAnimCurveUU            Unitless to Unitless
kAnimCurveUnknown       Unknown type
OpenMayaAnim.MFnAnimCurve.evaluate ( )
evaluate(at) -> value

Evalutes the curve.
For curves of type kAnimCurveTA, kAnimCurveTL and kAnimCurveTU,the at parameter is an MTime, otherwise it is a double.
For curves of type kAnimCurveTT and kAnimCurveUT,the value is an MTime, otherwise it is a double.
OpenMayaAnim.MFnAnimCurve.find ( )
find(at) -> unsigned int

Determines the index of the key which is set at the specifiedMTime (time-input curves) or double (unitless-input curves).
Returns None if the key is not found.
OpenMayaAnim.MFnAnimCurve.findClosest ( )
findClosest(at) -> unsigned int

Determines the index of the key which is set at theMTime (time-input curves) or double (unitless-input curves)closest to the specified time.
OpenMayaAnim.MFnAnimCurve.getTangentAngleWeight ( )
getTangentAngleWeight(index, isInTangent) -> (MAngle,double)

Determines the angle and weight of the in- or out-tangent to the curvefor the key at the specified index
OpenMayaAnim.MFnAnimCurve.getTangentXY ( )
getTangentXY(index, isInTangent) -> (x,y)

Determines the x,y value representing the vector of the in- orout-tangent (depending on the value of the isInTangent parameter) tothe curve for the key at the specified index.  The values returnedwill be in Maya's internal units (seconds for time, centimeters forlinear, radians for angles).
OpenMayaAnim.MFnAnimCurve.input ( )
input(index) -> MTime or double

Determines the input (MTime for T* curves or double for U* curves) of the key at the specified index.
OpenMayaAnim.MFnAnimCurve.insertKey ( )
addKey(time, breakdown=False, change=None) -> unsigned int

Inserts a new key at the specified time adjusting neighboring
tangents to maintain curve shape. This method is the API equivalent
to maya.cmds.setKeyframe(insert=True).
breakdown specifies the breakdown state of the newly inserted key.
change is an optional MAnimCurveChange.
Returns the index of the newly inserted key.
OpenMayaAnim.MFnAnimCurve.inTangentType ( )
inTangentType(index) -> TangentType

Determines the type of the tangent to the curve entering the current key.
OpenMayaAnim.MFnAnimCurve.isBreakdown ( )
isBreakdown(index) -> bool

Determines whether or not a key is a breakdown.
OpenMayaAnim.MFnAnimCurve.outTangentType ( )
outTangentType(index) -> TangentType

Determines the type of the tangent to the curve leaving the current key.
OpenMayaAnim.MFnAnimCurve.remove ( )
remove(index, change=None) -> self

Removes the key at the specified index.
change is an optional MAnimCurveChange.
OpenMayaAnim.MFnAnimCurve.setAngle ( )
setAngle(index, setAngle, isInTangent, change=None) -> self

Sets the in- or out-angle of the tangent for the key at the given index.
isInTangent is True to modify the inTangent or False to modify the outTangent.
OpenMayaAnim.MFnAnimCurve.setInput ( )
setInput(index, at, change=None) -> self

Sets the input (MTime for T* curves or double for U* curves) of the key at the specified index.  This will fail ifsetting the input would require re-ordering of the keys.
OpenMayaAnim.MFnAnimCurve.setInTangentType ( )
setInTangentType(index, tangentType, change=None) -> self

Sets the type of the tangent to the curve entering the key at thespecified index.
Valid values for tangentType are:
kTangentGlobal          Global
kTangentFixed           Fixed
kTangentLinear          Linear
kTangentFlat            Flag
kTangentSmooth          Smooth
kTangentStep            Step
kTangentSlow            OBSOLETE kTangentSlow should not be used. Using this tangent type may produce unwanted and unexpected results.
kTangentFast            OBSOLETE kTangentFast should not be used. Using this tangent type may produce unwanted and unexpected results.
kTangentClamped Clamped
kTangentPlateau Plateau
kTangentStepNext        StepNext
kTangentAuto            Auto
OpenMayaAnim.MFnAnimCurve.setIsBreakdown ( )
setIsBreakdown(index, isBreakdown, change=None) -> self

Sets the breakdown state of a key at a given index.
OpenMayaAnim.MFnAnimCurve.setIsWeighted ( )
setIsWeighted(isWeighted, change=None) -> self

Sets whether or not the curve has weighted tangents.
OpenMayaAnim.MFnAnimCurve.setOutTangentType ( )
setOutTangentType(index, tangentType, change=None) -> self

Sets the type of the tangent to the curve leaving the key at thespecified index.
OpenMayaAnim.MFnAnimCurve.setPostInfinityType ( )
setPostInfinityType(infinityType, change=None) -> self

Sets the behaviour of the curve for the range occurring after the last key.
OpenMayaAnim.MFnAnimCurve.setPreInfinityType ( )
setPreInfinityType(infinityType, change=None) -> self

Sets the behaviour of the curve for the range occurring before the first key.
Valid values for infinityType are:
kConstant                       Constant
kLinear                 Linear
kCycle                          Cycle
kCycleRelative          Cycle relative
kOscillate                      Oscillate
OpenMayaAnim.MFnAnimCurve.setTangent ( )
setTangent(index, xOrAngle, yOrWeight, isInTangent, change=None, convertUnits=True) -> self

Sets the tangent for the key at the specified index.
The tangent can be specified as an x/y pair, oras an MAngle and a weight.
isInTangent is True to modify the inTangent or False to modify the outTangent.
OpenMayaAnim.MFnAnimCurve.setTangentsLocked ( )
setTangentsLocked(index, locked, change=None) -> self

Lock or unlock the tangents at the given key.
OpenMayaAnim.MFnAnimCurve.setTangentTypes ( )
setTangentTypes(indexArray, tangentInType=kTangentGlobal, tangentOutType=kTangentGlobal, change=None) -> self

Sets the tangent types for multiple keys.
OpenMayaAnim.MFnAnimCurve.setValue ( )
setValue(index, value, change=None) -> self

Sets the value of the key at the specified index.  This methodshould only be used on Anim Curves of type kAnimCurve*A, kAnimCurve*Lor kAnimCurve*U.
OpenMayaAnim.MFnAnimCurve.setWeight ( )
setWeight(index, weight, isInTangent, change=None) -> self

Sets the in- or out-weight of the tangent for the key at the given index.
isInTangent is True to modify the inTangent or False to modify the outTangent.
OpenMayaAnim.MFnAnimCurve.setWeightsLocked ( )
setWeightsLocked(index, locked, change=None) -> self

Lock or unlock the weights at the given key.
OpenMayaAnim.MFnAnimCurve.tangentsLocked ( )
tangentsLocked(index) -> bool

Determines whether the tangents are locked at the given key.
OpenMayaAnim.MFnAnimCurve.timedAnimCurveTypeForPlug ( )
timedAnimCurveTypeForPlug(plug) -> AnimCurveType

Returns the timed animCurve type appropriate for the specified plug.
OpenMayaAnim.MFnAnimCurve.unitlessAnimCurveTypeForPlug ( )
unitlessAnimCurveTypeForPlug(plug) -> AnimCurveType

Returns the unitless animCurve type appropriate for the specified plug.
OpenMayaAnim.MFnAnimCurve.value ( )
value(index) -> double

Determines the value of the key at the specified index.  This methodshould only be used on Anim Curves of type kAnimCurve*A, kAnimCurve*Lor kAnimCurve*U.
OpenMayaAnim.MFnAnimCurve.weightsLocked ( )
weightsLocked(index) -> bool

Determines whether the weights are locked at the given key.

Property Documentation

OpenMayaAnim.MFnAnimCurve.animCurveType
static
 Anim curve type.
OpenMayaAnim.MFnAnimCurve.isStatic
static
 Whether the curve is static.
OpenMayaAnim.MFnAnimCurve.isTimeInput
static
 Whether the curve has time as an input.
OpenMayaAnim.MFnAnimCurve.isUnitlessInput
static
 Whether the curve has unitless input.
OpenMayaAnim.MFnAnimCurve.isWeighted
static
 Whether the curve has weighted tangents.
OpenMayaAnim.MFnAnimCurve.numKeys
static
 Number of keys.
OpenMayaAnim.MFnAnimCurve.postInfinityType
static
 The curve's post-infinity type.
OpenMayaAnim.MFnAnimCurve.preInfinityType
static
 The curve's pre-infinity type.