#include <MAnimCurveClipboard.h>
The clipboard is a list of MAnimCurveClipboardItems (i.e. an MAnimCurveClipboardItemArray). All of the data stored on a clipboard remains static; that is, it will persist as long as the application remains running.
The items on the clipboard must be ordered. In the case where the clipboard info represents animation of a hierarchy, the order in which items appear in the clipboard is reliant on a depth-first-iteration from the root or the hierarchy. This ordering, is essential to properly match up hierarchies of objects
As an example, consider that animation from the following hierarchy is placed into the clipboard. Slanted Dag Objects are animated.
In this example, the object labelled "C" has translate{X,Y,Z} animated, while all the others only have one animated attribute (excluding objects B and F, which have no animated attributes).
Using notation where A(r,c,a) represents the animCurve driving object "A", which is at row "r" in its subhierarchy, has "c" children, and "a" animated attributes these items would appear in the clipboard in this order (i.e. depth-first with each object's attributes explicitly indexed before continuing down the hierarchy):
A(0,3,0) , B(1,1,0) , C(2,1,0) , C(2,1,1) , C(2,1,2) , D(3,0,0) , E(1,0,0) , F(1,2,0) , G(2,0,0) , H(2,0,0)
For example C(2,1,2) would mean that the object C resides on the second level of the subhierarchy and has one child. The last "2" is simply used as an index to count the number of animated attributes on this object.
Multiple objects can be represented on the clipboard in this manner. In the example above, if we had a separate second object with no children, "J", it would appear at the end of the array as J(0,0,0).
Note that although B and F contain no animation data themselves, they must still be placed on the clipboard as placeholders to preserve the hierarchy information. A placeholder object is defined by a NULL value for the MAnimCurveClipboardItem's animCurve.
There is a special clipboard that remains static. It can be accessed by MAnimCurveClipboard::theAPIClipboard().
Public Member Functions | |
MAnimCurveClipboard () | |
~MAnimCurveClipboard () | |
MStatus | set (const MAnimCurveClipboard &cb) |
MStatus | set (const MAnimCurveClipboardItemArray &clipboardItemArray) |
MStatus | set (const MAnimCurveClipboardItemArray &clipboardItemArray, const MTime &startTime, const MTime &endTime, const float &startUnitlessInput, const float &endUnitlessInput) |
MStatus | clear () |
bool | isEmpty (MStatus *ReturnStatus=NULL) const |
const MAnimCurveClipboardItemArray | clipboardItems (MStatus *ReturnStatus=NULL) const |
MTime | startTime (MStatus *ReturnStatus=NULL) const |
MTime | endTime (MStatus *ReturnStatus=NULL) const |
float | startUnitlessInput (MStatus *ReturnStatus=NULL) const |
float | endUnitlessInput (MStatus *ReturnStatus=NULL) const |
Static Public Member Functions | |
static MAnimCurveClipboard & | theAPIClipboard () |
MAnimCurveClipboard::MAnimCurveClipboard | ( | ) |
Default Constructor.
MAnimCurveClipboard::~MAnimCurveClipboard | ( | ) |
Class Destructor.
MAnimCurveClipboard & MAnimCurveClipboard::theAPIClipboard | ( | ) | [static] |
MStatus MAnimCurveClipboard::set | ( | const MAnimCurveClipboard & | cb | ) |
Replaces the contents of the clipboard
[in] | cb | the clipboard to copy |
MStatus MAnimCurveClipboard::set | ( | const MAnimCurveClipboardItemArray & | clipboardItemArray | ) |
Sets the contents of the clipboard.
The leading offset information is not preserved if this method is used. For example, if the keys on the animCurve you wish to cut fall within the range of 10 to 20 frames, and a startTime of 3 is specified, the leading offset of 7 frames is not preserved.
[in] | clipboardItemArray | the array of clipboard items to load on to the current clipboard |
MStatus MAnimCurveClipboard::set | ( | const MAnimCurveClipboardItemArray & | clipboardItemArray, | |
const MTime & | startTime, | |||
const MTime & | endTime, | |||
const float & | startUnitlessInput, | |||
const float & | endUnitlessInput | |||
) |
Sets the contents of the clipboard.
The start and end arguments are used to preserve offset information. For example, if the keys on the animCurve you wish to cut fall within the range of 10 to 20 frames, and a startTime of 3 is specified, the offset of 7 frames is preserved.
The arguments startTime and endTime are used to specify the range for animCurves of type kAnimCurveT*, while startUnitlessInput and endUnitlessInput are used to specify the range for animCurves of type kAnimCurveU*.
If the values of the MTime and float arguments are reversed (i.e. startTime > endTime or startUnitlessInput > endUnitlessInput ) then the range to be placed on the clipboard will be determined by the first and last key on the animCurves (i.e. leading offset information will not be preserved).
The start and end values must also bound the animation (i.e. the first and last key respectively), otherwise this method will fail. If there is no animation on any of the items being placed on the clipboard, the range is ignored.
[in] | clipboardItemArray | the array of clipboard items to load on to the current clipboard |
[in] | startTime | the start time for the clipboard |
[in] | endTime | the end time for the clipboard |
[in] | startUnitlessInput | the start unitless input for the clipboard |
[in] | endUnitlessInput | the end unitless input for the clipboard |
MStatus MAnimCurveClipboard::clear | ( | ) |
This method empties the clipboard.
bool MAnimCurveClipboard::isEmpty | ( | MStatus * | ReturnStatus = NULL |
) | const |
Determines if the clipboard is empty.
[out] | ReturnStatus | Status Code (see below) |
const MAnimCurveClipboardItemArray MAnimCurveClipboard::clipboardItems | ( | MStatus * | ReturnStatus = NULL |
) | const |
Returns the contents of the clipboard.
[out] | ReturnStatus | Status Code (see below) |
Returns the start time of the clipboard.
[out] | ReturnStatus | Status Code (see below) |
Returns the end time of the clipboard.
[out] | ReturnStatus | Status Code (see below) |
float MAnimCurveClipboard::startUnitlessInput | ( | MStatus * | ReturnStatus = NULL |
) | const |
Returns the start unitless input of the clipboard.
[out] | ReturnStatus | Status Code (see below) |
float MAnimCurveClipboard::endUnitlessInput | ( | MStatus * | ReturnStatus = NULL |
) | const |
Returns the end unitless input of the clipboard.
[out] | ReturnStatus | Status Code (see below) |
Autodesk® Maya® 2009 © 1997-2008 Autodesk, Inc. All rights reserved. | Generated with 1.5.6 |