C++ API Reference
|
Control over animation playback and values. More...
#include <MAnimControl.h>
Public Types | |
enum | PlaybackMode { kPlaybackOnce, kPlaybackLoop, kPlaybackOscillate } |
Animation playback modes. More... | |
enum | PlaybackViewMode { kPlaybackViewAll, kPlaybackViewActive } |
Animation playback viewing modes. More... | |
Public Member Functions | |
MAnimControl () | |
Class constructor. | |
virtual | ~MAnimControl () |
Class destructor. | |
Static Public Member Functions | |
static bool | isValid () |
Introduced in 2020.0 More... | |
static MAnimControl::PlaybackMode | playbackMode () |
Return the playback mode currently in effect. More... | |
static MStatus | setPlaybackMode (PlaybackMode newMode) |
Set the current playback mode. More... | |
static MAnimControl::PlaybackViewMode | viewMode () |
Return the viewing mode currently in effect. More... | |
static MStatus | setViewMode (PlaybackViewMode newMode) |
Set the current viewing mode. More... | |
static double | playbackBy () |
Return a double specifying the increment between times viewed during the playing of the animation. More... | |
static MStatus | setPlaybackBy (const double &newTime) |
Specify the increment between times viewed during the playing of the animation. More... | |
static MTime | minTime () |
Return an MTime specifying the first frame of the current playback time range. More... | |
static MTime | maxTime () |
Return an MTime specifying the last frame of the current playback time range. More... | |
static MStatus | setMinTime (MTime newMinTime) |
Set the first frame of the current playback time range. More... | |
static MStatus | setMaxTime (MTime newMaxTime) |
Set the value of the last frame of the current playback time range. More... | |
static MStatus | setMinMaxTime (MTime min, MTime max) |
Set the values of the first and last frames of the playback time range. More... | |
static MTime | animationStartTime () |
Return an MTime specifying the first frame of the animation, as specified by the Maya user in the Range Slider UI. More... | |
static MTime | animationEndTime () |
Return an MTime specifying the last frame of the animation, as specified by the Maya user in the Range Slider UI. More... | |
static MStatus | setAnimationStartTime (MTime newStartTime) |
Set the value of the first frame in the animation. More... | |
static MStatus | setAnimationEndTime (MTime newEndTime) |
Set the value of the last frame in the animation. More... | |
static MStatus | setAnimationStartEndTime (MTime newStartTime, MTime newEndTime) |
Set the values of the first and last frames in the animation. More... | |
static MTime | currentTime () |
Return an MTime instance containing the current animation frame. More... | |
static MStatus | setCurrentTime (const MTime &newTime) |
Set the current animation frame. More... | |
static double | playbackSpeed () |
Return the speed with with to play the animation. More... | |
static MStatus | setPlaybackSpeed (double newSpeed) |
Set the desired speed factor at which the animation will play back. More... | |
static MStatus | playForward () |
Start playing the current animation forwards. More... | |
static MStatus | playBackward () |
Start playing the current animation backwards. More... | |
static bool | isPlaying () |
Return a value indicating whether Maya is currently playing the animation. More... | |
static bool | isScrubbing () |
Return a value indicating whether interactive scrubbing is occuring while Maya is not currently playing an animation. More... | |
static MStatus | stop () |
Stop playing the current animation. More... | |
static bool | autoKeyMode () |
Return the autoKeyMode. More... | |
static MStatus | setAutoKeyMode (bool mode) |
Set the autoKeyMode. More... | |
static MFnAnimCurve::TangentType | globalInTangentType (MStatus *ReturnStatus=NULL) |
Return the current global in tangent type. More... | |
static MStatus | setGlobalInTangentType (const MFnAnimCurve::TangentType &tangentType) |
Set the current global in tangent type. More... | |
static MFnAnimCurve::TangentType | globalOutTangentType (MStatus *ReturnStatus=NULL) |
Return the current global out tangent type. More... | |
static MStatus | setGlobalOutTangentType (const MFnAnimCurve::TangentType &tangentType) |
Set the current global out tangent type. More... | |
static bool | weightedTangents (MStatus *ReturnStatus=NULL) |
Determine whether or not the tangents on the Anim Curve are weighted. More... | |
static MStatus | setWeightedTangents (bool weightState) |
Sets whether or not the tangents on the Anim Curve are weighted. More... | |
Control over animation playback and values.
This class provide access to the values that control how an animation is played. This includes the minimum and maximum frames included in the playback, whether the playback loops, and whether the animation runs in all views, or only the active view, etc.
Methods also exist that mirror the functionality of the controls found on the time slider in the UI to start and stop the playback.
enum PlaybackMode |
enum PlaybackViewMode |
|
static |
Introduced in 2020.0
Return if the AnimControl is valid.
|
static |
Return the playback mode currently in effect.
|
static |
Set the current playback mode.
[in] | newMode | an element of MAnimControl::PlaybackMode |
|
static |
Return the viewing mode currently in effect.
|
static |
Set the current viewing mode.
Controls whether the animation is run in only the active view, or simultaneously in all views.
[in] | newMode | an element of MAnimControl::PlaybackViewMode |
|
static |
Return a double specifying the increment between times viewed during the playing of the animation.
|
static |
Specify the increment between times viewed during the playing of the animation.
[in] | newTime | a double containing the new increment |
|
static |
Return an MTime specifying the first frame of the current playback time range.
This corresponds to the minTime which can also be set and queried using the playbackOptions mel command. It does not represent the first frame of the total animation time unless the two coincide.
|
static |
Return an MTime specifying the last frame of the current playback time range.
This corresponds to the maxTime which can also be set and queried using the playbackOptions mel command. It does not represent the final frame of the total animation time unless the two coincide.
Set the first frame of the current playback time range.
[in] | newMinTime | an MTime containing the frame |
Set the value of the last frame of the current playback time range.
[in] | newMaxTime | an MTime containing the new frame |
Set the values of the first and last frames of the playback time range.
[in] | min | an MTime containing the new first frame |
[in] | max | an MTime containing the new last frame |
|
static |
|
static |
Set the value of the first frame in the animation.
[in] | newStartTime | an MTime containing the new first frame |
Set the value of the last frame in the animation.
[in] | newEndTime | an MTime containing the new last frame |
Set the values of the first and last frames in the animation.
[in] | newStartTime | an MTime containing the new first frame |
[in] | newEndTime | an MTime containing the new last frame |
|
static |
Return an MTime instance containing the current animation frame.
Set the current animation frame.
[in] | newTime | an MTime containing the new animation frame |
|
static |
Return the speed with with to play the animation.
|
static |
Set the desired speed factor at which the animation will play back.
[in] | newSpeed | the new speed factor |
|
static |
Start playing the current animation forwards.
|
static |
Start playing the current animation backwards.
|
static |
Return a value indicating whether Maya is currently playing the animation.
|
static |
Return a value indicating whether interactive scrubbing is occuring while Maya is not currently playing an animation.
|
static |
Stop playing the current animation.
|
static |
Return the autoKeyMode.
|
static |
Set the autoKeyMode.
[in] | mode | a boolean specifying the new mode |
|
static |
Return the current global in tangent type.
[out] | ReturnStatus | Status Code (see below) |
|
static |
Set the current global in tangent type.
[in] | tangentType | the global in tangent type to set [Note: MFnAnimCurve::kTangentGlobal and MFnAnimCurve::kTangentFixed are not valid arguments] |
|
static |
Return the current global out tangent type.
[out] | ReturnStatus | Status Code (see below) |
|
static |
Set the current global out tangent type.
[in] | tangentType | the global out tangent type to set [Note: MFnAnimCurve::kTangentGlobal and MFnAnimCurve::kTangentFixed are not valid arguments] |
|
static |
Determine whether or not the tangents on the Anim Curve are weighted.
[out] | ReturnStatus | Status Code |
|
static |
Sets whether or not the tangents on the Anim Curve are weighted.
Note: switching a curve from weightedTangents true to false and back to true again will not preserve fixed tangents properly. Use undo instead.
[in] | weightState | a boolean specifying whether tangents should be weighted or not |