MPxAnimCurveInterpolator Class Reference

#include <MPxAnimCurveInterpolator.h>

Class Description

Base Class for User-defined Animation Curve Interpolation Types.

MPxAnimCurveInterpolator is the base class for user defined Anim Curve Interpolation Types. It allows for the creation and evaluation of customized animation curves, in addition to determination of the type ID and name of the curve. The evaluation of an animCurve between two of its keyframes is determined by interpolators (also known as "tangent types") at those keyframes. This class allows for the creation of custom tangent types. Note that the valid type ranges are:

Types 1 to 18 Maya's built-in tangent types. See MFnAnimCurve::TangentType. Types 19 to 26 Custom tangent types which are available to all users, and should only be used internally. Types 27 to 63 Maya's built-in tangent types. See MFnAnimCurve::TangentType. Types 64 to 32767 Custom tangent types which can be reserved by customers. You can request between 1 to 8 id's per request. Visit Autodesk Maya Developer Tangent Types ID Block Registration to submit your request. See also Autodesk Developer Network for more information.

+ Examples:

Public Types

enum  InterpolatorFlags { kEvaluateAtKey = 0x001, kLockType = 0x002 }
 Defines the flags used when registering a new animation curve iterpolator. More...
 

Public Member Functions

virtual void initialize (const MObject &animCurve, unsigned int keyIndex)
 Initialize the interpolator to evaluate keyframe values within the time span of the given interval. More...
 
virtual double evaluate (const MTime &val)=0
 Compute an interpolated keyframe value at the given time, which is an absolute time between the start and end times. More...
 
MFnAnimCurve::TangentType typeId () const
 Returns the tangent type of this curve. More...
 
MString typeName () const
 Returns the name under which the interpolator type was registered. More...
 

Member Enumeration Documentation

Defines the flags used when registering a new animation curve iterpolator.

Enumerator
kEvaluateAtKey 

Animation curves do not typically evaluate at the keyframe times.

Instead, the keyframe value is used. For custom interpolators that may want to define their curves such that they do not pass through the keyframe values, kEvaluateAtKey can be set which will cause the interpolator to be evaluated at the keyframe times.

kLockType 

Many curve operations to move keys or change tangent types may cause a ripple of tangent type changes for neighboring keyframes to a tangent type known to be compatible with the new curve shape.

Some custom interpolators may be able to accomodate such changes to neighboring keyframes without being exchanged for a different type. Setting kLockType will prevent the custom tangent type from being automatically exchanged.

Member Function Documentation

void initialize ( const MObject animCurve,
unsigned int  keyIndex 
)
virtual

Initialize the interpolator to evaluate keyframe values within the time span of the given interval.

The interval starts at the keyframe denoted by the value of the interval and continues to the next keyframe.

It is not necessary to override this method.

Parameters
[in]animCurve
[in]keyIndex
+ Examples:
double evaluate ( const MTime val)
pure virtual

Compute an interpolated keyframe value at the given time, which is an absolute time between the start and end times.

Parameters
[in]valspecified time value
Returns
interpolated keyframe value
+ Examples:
MFnAnimCurve::TangentType typeId ( ) const

Returns the tangent type of this curve.

Returns
Type id of the node
MString typeName ( ) const

Returns the name under which the interpolator type was registered.

The name is used in the UI and when specifying a tangent type to the keyTangent command.

It is not necessary to override this method.

Returns
Type name of the class

The documentation for this class was generated from the following files:
  • MPxAnimCurveInterpolator.h
  • MPxAnimCurveInterpolator.cpp