#include <MFnMotionPath.h>
This class is used for constructing and manipulating motion path animation.
Motion path animation requires a curve (or surface) and one or more other objects. During the animation, the objects will be moved along the curve.
Setting "follow" for the motion path aligns the object(s) local axis to the tangent of the motion path. Banking can also be applied to objects.
Motion path markers are points along the path where the orientation and position for the object(s) travelling along the path can be specified.
Public Types | |
enum | Axis { kXaxis, kYaxis, kZaxis } |
Available axes. More... | |
Public Member Functions | |
virtual MFn::Type | type () const |
Function set type. | |
virtual | ~MFnMotionPath () |
Destructor. | |
MFnMotionPath () | |
Default constructor. | |
MFnMotionPath (MObject &object, MStatus *ReturnStatus=NULL) | |
Constructor. | |
MObject | create (const MDagPath &pathObject, const MDagPath &objectToAnimate, MTime &timeStart, MTime &timeEnd, MDGModifier *modifier=NULL, MStatus *ReturnStatus=NULL) |
MStatus | setPathObject (const MDagPath &pathObject, MDGModifier *modifier=NULL) |
MDagPath | pathObject (MStatus *ReturnStatus=NULL) |
MStatus | addAnimatedObject (const MDagPath &objectToAnimate, MDGModifier *modifier=NULL) |
MStatus | getAnimatedObjects (MDagPathArray &array) |
MStatus | setFollow (bool on, MDGModifier *modifier=NULL) |
bool | follow (MStatus *ReturnStatus=NULL) const |
MStatus | setFollowAxis (Axis axis) |
Axis | followAxis (MStatus *ReturnStatus=NULL) |
MStatus | setUpAxis (Axis axis) |
Axis | upAxis (MStatus *ReturnStatus=NULL) |
MStatus | setBank (bool bank) |
bool | bank (MStatus *ReturnStatus=NULL) const |
MStatus | setBankScale (double bankScale) |
double | bankScale (MStatus *ReturnStatus=NULL) |
MStatus | setBankThreshold (double bankThreshold) |
double | bankThreshold (MStatus *ReturnStatus=NULL) |
MStatus | setUseNormal (bool use) |
bool | useNormal (MStatus *ReturnStatus=NULL) |
MStatus | setInverseNormal (bool invert) |
bool | inverseNormal (MStatus *ReturnStatus=NULL) |
MStatus | setUStart (double start) |
MStatus | setUEnd (double end) |
double | uStart (MStatus *ReturnStatus=NULL) |
double | uEnd (MStatus *ReturnStatus=NULL) |
MStatus | setUTimeStart (MTime &start) |
MStatus | setUTimeEnd (MTime &end) |
MTime | uTimeStart (MStatus *ReturnStatus=NULL) |
MTime | uTimeEnd (MStatus *ReturnStatus=NULL) |
unsigned int | numPositionMarkers (MStatus *ReturnStatus=NULL) |
MObject | getPositionMarker (unsigned int, MStatus *ReturnStatus=NULL) |
unsigned int | numOrientationMarkers (MStatus *ReturnStatus=NULL) |
MObject | getOrientationMarker (unsigned int, MStatus *ReturnStatus=NULL) |
MFnMotionPath (const MObject &object, MStatus *ReturnStatus=NULL) | |
Constructor. | |
Protected Member Functions | |
virtual const char * | className () const |
Class name. |
enum MFnMotionPath::Axis |
Constructor.
Class constructor that initializes the function set to the given MObject.
[in] | object | The MObject to attach the function set to |
[out] | ReturnStatus | the return status |
Constructor.
Class constructor that initializes the function set to the given MObject.
[in] | object | The MObject to attach the function set to |
[out] | ReturnStatus | the return status |
MFn::Type MFnMotionPath::type | ( | ) | const [virtual] |
const char * MFnMotionPath::className | ( | ) | const [protected, virtual] |
MObject MFnMotionPath::create | ( | const MDagPath & | pathObject, | |
const MDagPath & | objectToAnimate, | |||
MTime & | timeStart, | |||
MTime & | timeEnd, | |||
MDGModifier * | modifier = NULL , |
|||
MStatus * | ReturnStatus = NULL | |||
) |
Create a new motion path dependency node. When a motion path node is created, the following defaults are set:
[in] | pathObject | the curve, surface, or curve-on-surface to use as the object path |
[in] | objectToAnimate | the object that will follow the motion path |
[in] | timeStart | the time at which to start the animation |
[in] | timeEnd | the time at which to end the animation |
[in] | modifier | this object will hold the undo information |
[out] | ReturnStatus | Status Code |
MStatus MFnMotionPath::setPathObject | ( | const MDagPath & | pathObject, | |
MDGModifier * | modifier = NULL | |||
) |
Set the curve or surface for this motion path. All animated objects for this motion path will follow the new path that is specified.
[in] | pathObject | The curve (or surface) that will be the motion path |
[in] | modifier | The object that will hold the undo information |
Return a dag path to the motion path object. The motion path object is the curve/surface that animated objects of this node will move along.
[out] | ReturnStatus | Status Code |
MStatus MFnMotionPath::addAnimatedObject | ( | const MDagPath & | objectToAnimate, | |
MDGModifier * | modifier = NULL | |||
) |
Add an object to be animated along this motion path.
[in] | objectToAnimate | A DAG path to the animated object |
[in] | modifier | The object that will hold the undo information |
MStatus MFnMotionPath::getAnimatedObjects | ( | MDagPathArray & | array | ) |
Returns an array of dag paths to the animated objects for this motion path.
[out] | array | Storage for the dag paths. |
MStatus MFnMotionPath::setFollow | ( | bool | on, | |
MDGModifier * | modifier = NULL | |||
) |
Setting follow on will cause the animated object(s) local axis to be aligned with the tangent of the motion path. The default alignment axis is Y.
[in] | on | Specifies whether follow is activated for this motion path |
[in] | modifier | The object that will hold the undo information |
bool MFnMotionPath::follow | ( | MStatus * | ReturnStatus = NULL |
) | const |
Determines whether follow is set for this motion path node.
[out] | ReturnStatus | Status Code |
MStatus MFnMotionPath::setFollowAxis | ( | MFnMotionPath::Axis | axis | ) |
Sets the axis of the animated object that will follow the motion path. Possible alignment parameters are kXaxis, kYaxiz, or kZaxis.
[in] | axis | Object axis to align with motion path tangent |
MFnMotionPath::Axis MFnMotionPath::followAxis | ( | MStatus * | ReturnStatus = NULL |
) |
Return the follow axis for this motion path.
[out] | ReturnStatus | Status Code |
MStatus MFnMotionPath::setUpAxis | ( | MFnMotionPath::Axis | axis | ) |
Set the up-axis for this motion path.
[in] | axis | Axis to be set |
MFnMotionPath::Axis MFnMotionPath::upAxis | ( | MStatus * | ReturnStatus = NULL |
) |
Return the up-axis for this motion path.
[out] | ReturnStatus | Status Code |
MStatus MFnMotionPath::setBank | ( | bool | bank | ) |
[in] | bank | Specifies whether bank is turned on |
bool MFnMotionPath::bank | ( | MStatus * | ReturnStatus = NULL |
) | const |
Determines whether bank has been enabled for this motion path.
[out] | ReturnStatus | Status Code |
MStatus MFnMotionPath::setBankScale | ( | double | bankScale | ) |
Set the bank scale for this motion path. If the computed bank angles are not large enough, the user can specify the bankScale to amplify them. The default value is 1.
Positive bankScale produces inward bank angle, negative bankScale produces outward bank angle.
[in] | bankScale | The new bank scale value |
double MFnMotionPath::bankScale | ( | MStatus * | ReturnStatus = NULL |
) |
Return the bank scale for this motion path.
[out] | ReturnStatus | Status Code |
MStatus MFnMotionPath::setBankThreshold | ( | double | bankThreshold | ) |
Set the bank threshold for this motion path. The bank threshold is used to specify the maximum bank angle. The default value is 90 degrees.
[in] | bankThreshold | The new bank threshold value |
double MFnMotionPath::bankThreshold | ( | MStatus * | ReturnStatus = NULL |
) |
Return the bank threshold for this motion path. The bank threshold is used to specify the maximum bank angle. The default value is 90 degrees.
[out] | ReturnStatus | Status Code |
MStatus MFnMotionPath::setUseNormal | ( | bool | use | ) |
If true, enables alignment of the up axis of the animated object to the normal vector of the path geometry.
[in] | use | Specifies if normal is used |
bool MFnMotionPath::useNormal | ( | MStatus * | ReturnStatus = NULL |
) |
Determines whether the up-axis of the animated object for this motion path is aligned with the normal vector of the path geometry.
[out] | ReturnStatus | Status Code |
MStatus MFnMotionPath::setInverseNormal | ( | bool | invert | ) |
If true, enable alignment of the up axis of the moving object(s) to the opposite direction of the normal vector of the path geometry.
[in] | invert | Specifies if inverse normal is used |
bool MFnMotionPath::inverseNormal | ( | MStatus * | ReturnStatus = NULL |
) |
Determines whether the up-axis of the animated object for this motion path is aligned to the opposite direction of the normal vector of the path geometry.
[out] | ReturnStatus | Status Code |
MStatus MFnMotionPath::setUStart | ( | double | start | ) |
Sets the starting value of the u parameterization for the animation.
[in] | start | the new start value |
MStatus MFnMotionPath::setUEnd | ( | double | end | ) |
Sets the end value of the u parameterization for the animation.
[in] | end | the new end value |
double MFnMotionPath::uStart | ( | MStatus * | ReturnStatus = NULL |
) |
Returns the starting value of the u parameterization for the animation.
[out] | ReturnStatus | Status Code |
double MFnMotionPath::uEnd | ( | MStatus * | ReturnStatus = NULL |
) |
Returns the end value of the u parameterization for the animation.
[out] | ReturnStatus | Status Code |
Sets the starting time of the animation for the u parameter.
[in] | start | the new start time |
Sets the end time of the animation for the u parameter.
[in] | end | the new end time |
Returns the start time of the animation for the u parameter.
[out] | ReturnStatus | Status Code |
Returns the end time of the animation for the u parameter.
[out] | ReturnStatus | Status Code |
unsigned int MFnMotionPath::numPositionMarkers | ( | MStatus * | ReturnStatus = NULL |
) |
Returns the number of position markers on this motion path.
[out] | ReturnStatus | Status Code |
Gets the position marker where markerNum is the order in which the marker was created.
[in] | markerNum | The number of the marker |
[out] | ReturnStatus | Status Code |
unsigned int MFnMotionPath::numOrientationMarkers | ( | MStatus * | ReturnStatus = NULL |
) |
Returns the number of orientation markers on this motion path.
[out] | ReturnStatus | Status Code |
MObject MFnMotionPath::getOrientationMarker | ( | unsigned int | markerNum, | |
MStatus * | ReturnStatus = NULL | |||
) |
Gets the orientation marker where markerNum is the order in which the marker was created.
[in] | markerNum | The number of the marker |
[out] | ReturnStatus | Status Code |
Autodesk® Maya® 2009 © 1997-2008 Autodesk, Inc. All rights reserved. | Generated with 1.5.6 |