class MFnMotionPath

Jump to documentation

: public MFnDependencyNode Motion path animation function set (OpenMayaAnim) (OpenMayaAnim.py)

Inheritance:

MFnMotionPath < MFnDependencyNode < MFnBase

public members:

MFnMotionPath ()
MFnMotionPath ( MObject & object, MStatus * ReturnStatus = NULL )
virtual ~MFnMotionPath ()
virtual MFn::Type type () const
enum Axis
kXaxis
kYaxis
kZaxis
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 )

Inherited from MFnDependencyNode:

public members:

virtual MFn::Type type () const
enum MAttrClass
kGlobalDynamicAttr
kLocalDynamicAttr
MObject create ( const MTypeId & typeId , MStatus * ReturnStatus = NULL )
MObject create ( const MTypeId & typeId , const MString & name , MStatus * ReturnStatus = NULL )
MObject create ( const MString & type , MStatus * ReturnStatus = NULL )
MObject create ( const MString & type , const MString & name , MStatus * ReturnStatus = NULL )
MTypeId typeId ( MStatus * ReturnStatus = NULL ) const
MString typeName ( MStatus * ReturnStatus = NULL ) const
MString name ( MStatus * ReturnStatus = NULL ) const
MString setName ( const MString & name , MStatus * ReturnStatus = NULL )
MStatus getConnections ( MPlugArray & array ) const
unsigned int attributeCount ( MStatus * ReturnStatus=NULL) const
MObject attribute ( unsigned int index, MStatus * ReturnStatus=NULL) const
MObject reorderedAttribute ( unsigned int index, MStatus * ReturnStatus=NULL) const
MObject attribute ( const MString & attrName, MStatus * ReturnStatus=NULL) const
MAttrClass attributeClass ( const MObject & attr, MStatus * ReturnStatus=NULL) const
MStatus getAffectedAttributes ( const MObject & attr, MObjectArray & affectedAttributes ) const
MStatus getAffectedByAttributes ( const MObject & attr, MObjectArray & affectedByAttributes ) const
MPlug findPlug ( const MObject & attr, bool wantNetworkedPlug, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MString & attrName, bool wantNetworkedPlug, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MObject & attr, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MString & attrName, MStatus * ReturnStatus=NULL) const
MStatus addAttribute ( const MObject & attr, MAttrClass type = kLocalDynamicAttr )
MStatus removeAttribute ( const MObject & attr, MAttrClass type = kLocalDynamicAttr )
MPxNode * userNode ( MStatus * ReturnStatus=NULL ) const
bool isFromReferencedFile ( MStatus * ReturnStatus=NULL) const
bool isShared ( MStatus * ReturnStatus=NULL) const
bool hasUniqueName ( MStatus * ReturnStatus=NULL) const
MString parentNamespace ( MStatus * ReturnStatus=NULL) const
bool isLocked ( MStatus * ReturnStatus=NULL) const
MStatus setLocked ( bool locked )
static MString classification ( const MString & nodeTypeName )
bool isNewAttribute ( const MObject & attr, MStatus * ReturnStatus=NULL) const
static unsigned int allocateFlag ( const MString pluginName, MStatus * ReturnStatus=NULL )
static MStatus deallocateFlag (const MString pluginName, unsigned int flag)
static MStatus deallocateAllFlags (const MString pluginName)
MStatus setFlag (unsigned int flag, bool state)
bool isFlagSet (unsigned int flag, MStatus * ReturnStatus=NULL) const
bool isDefaultNode ( MStatus * ReturnStatus=NULL) const
MStatus setDoNotWrite ( bool flag )
bool canBeWritten ( MStatus * ReturnStatus=NULL) const
bool hasAttribute (const MString & name , MStatus * ReturnStatus=NULL) const
MObject getAliasAttr (bool force, MStatus * ReturnStatus=NULL)
bool setAlias (const MString & alias,const MString & name , const MPlug & plug, bool add=true, MStatus * ReturnStatus=NULL)
bool findAlias (const MString & alias, MObject & attrObj, MStatus * ReturnStatus=NULL) const
bool getAliasList ( MStringArray & strArray, MStatus * ReturnStatus=NULL)
MString plugsAlias (const MPlug & plug, MStatus * ReturnStatus=NULL)
public
bool getPlugsAlias (const MPlug & plug, MString & aliasName, MStatus * ReturnStatus=NULL)

Inherited from MFnBase:

public members:

virtual MFn::Type type () const
bool hasObj ( MFn::Type ) const
bool hasObj ( const MObject & ) const
MObject object ( MStatus * ReturnStatus = NULL ) const
virtual MStatus setObject ( MObject & object )
virtual MStatus setObject ( const MObject & object )

Documentation

Construct and manipulate motion paths
Description

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.

Functions

MFnMotionPath:: MFnMotionPath ()

Description

Default class constructor. The function set is not attached to an MObject.

MFnMotionPath:: MFnMotionPath ( MObject & object, MStatus * ReturnStatus )

Description

Class constructor that initializes the function set to the given MObject.

Arguments

  • object the MObject to attach the function set to
  • ReturnStatus the return status
    • MS::kSuccess if the function set is successfully attached
    • MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFnMotionPath:: MFnMotionPath ( const MObject & object, MStatus * ReturnStatus )

Description

Class constructor that initializes the function set to the given constant MObject.

Arguments

  • object the const MObject to attach the function set to
  • ReturnStatus the return status
    • MS::kSuccess if the function set is successfully attached
    • MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFnMotionPath:: ~MFnMotionPath ()

Description

The class destructor.

MFn::Type MFnMotionPath:: type () const

Description

Return the type of this function set.

Return Value

  • the constant MFn::kMotionPath

MObject MFnMotionPath:: create ( const MDagPath & pathObject , const MDagPath & objectToAnimate, MTime & timeStart, MTime & timeEnd, MDGModifier * modifier, MStatus * ReturnStatus )

Description

Create a new motion path dependency node.
When a motion path node is created, the following defaults are set:

  • Follow OFF
  • Bank OFF
  • BankScale 1.0
  • BankThreshold 0.5 * PI

Arguments

  • pathObject the curve, surface, or curve-on-surface to use as the object path
  • objectToAnimate the object that will follow the motion path
  • timeStart the time at which to start the animation
  • timeEnd the time at which to end the animation
  • modifier this object will hold the undo information
  • ReturnStatus Status Code

Return Value

  • The new motion path node

Status Codes

  • MS::kSuccess Member was successful
  • MS::kLicenseFailure application not licensed for attempted operation
  • MS::kFailure An object error has occurred

MStatus MFnMotionPath:: setPathObject ( const MDagPath & pathObject , MDGModifier * modifier )

Description

Set the curve or surface for this motion path. All animated objects for this motion path will follow the new path that is specified.

Arguments

  • pathObject The curve (or surface) that will be the motion path
  • modifier The object that will hold the undo information

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

MDagPath MFnMotionPath:: pathObject ( MStatus * ReturnStatus )

Description

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.

Arguments

  • ReturnStatus Status Code

Return Value

  • The dag path of the motion path object

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

MStatus MFnMotionPath:: addAnimatedObject ( const MDagPath & objectToAnimate, MDGModifier * modifier )

Description

Add an object to be animated along this motion path.

Arguments

  • objectToAnimate A DAG path to the animated object
  • modifier The object that will hold the undo information

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

MStatus MFnMotionPath:: getAnimatedObjects ( MDagPathArray & array )

Description

Returns an array of dag paths to the animated objects for this motion path.

Arguments

  • array Storage for the dag paths.

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

MStatus MFnMotionPath:: setFollow ( bool on, MDGModifier * modifier )

Description

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.

Arguments

  • on Specifies whether follow is activated for this motion path
  • modifier The object that will hold the undo information

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

bool MFnMotionPath:: follow ( MStatus * ReturnStatus ) const

Description

Determines whether follow is set for this motion path node.

Arguments

  • ReturnStatus Status Code

Return Value

  • true Follow is turned on
  • false Follow is turned off

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

MStatus MFnMotionPath:: setFollowAxis ( MFnMotionPath::Axis axis )

Description

Sets the axis of the animated object that will follow the motion path. Possible alignment parameters are kXaxis, kYaxiz, or kZaxis.

Arguments

  • axis Object axis to align with motion path tangent

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

MFnMotionPath::Axis MFnMotionPath:: followAxis ( MStatus * ReturnStatus )

Description

Return the follow axis for this motion path.

Arguments

  • ReturnStatus Status Code

Return Value

  • The follow axis.

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

MStatus MFnMotionPath:: setUpAxis ( MFnMotionPath::Axis axis )

Description

Set the up-axis for this motion path.

Arguments

  • axis Axis to be set

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

MFnMotionPath::Axis MFnMotionPath:: upAxis ( MStatus * ReturnStatus )

Description

Return the up-axis for this motion path.

Arguments

  • ReturnStatus Status Code

Return Value

  • The up-axis for this motion path

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

MStatus MFnMotionPath:: setBank ( bool bank )

Description

Arguments

  • bank Specifies whether bank is turned on

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

bool MFnMotionPath:: bank ( MStatus * ReturnStatus ) const

Description

Determines whether bank has been enabled for this motion path.

Arguments

  • ReturnStatus Status Code

Return Value

  • true Bank is enabled
  • false Bank is disabled

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

MStatus MFnMotionPath:: setBankScale ( double bankScale )

Description

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.

Arguments

  • bankScale The new bank scale value

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

double MFnMotionPath:: bankScale ( MStatus * ReturnStatus )

Description

Return the bank scale for this motion path.

Arguments

  • ReturnStatus Status Code

Return Value

  • The bank scale.

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

MStatus MFnMotionPath:: setBankThreshold ( double bankThreshold )

Description

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.

Arguments

  • bankScale The new bank threshold value

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

double MFnMotionPath:: bankThreshold ( MStatus * ReturnStatus )

Description

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.

Arguments

  • ReturnStatus Status Code

Return Value

  • The bank threshold.

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

MStatus MFnMotionPath:: setUseNormal ( bool use )

Description

If true, enables alignment of the up axis of the animated object to the normal vector of the path geometry.

Arguments

  • use Specifies if normal is used

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

bool MFnMotionPath:: useNormal ( MStatus * ReturnStatus )

Description

Determines whether the up-axis of the animated object for this motion path is aligned with the normal vector of the path geometry.

Arguments

  • ReturnStatus Status Code

Return Value

  • true Normal vector is used for object alignment.
  • false Normal vector is not used for object alignment.

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

MStatus MFnMotionPath:: setInverseNormal ( bool invert )

Description

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.

Arguments

  • invert Specifies if inverse normal is used

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

bool MFnMotionPath:: inverseNormal ( MStatus * ReturnStatus )

Description

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.

Arguments

  • ReturnStatus Status Code

Return Value

  • true Inverse normal vector is used for object alignment.
  • false Inverse normal vector is not used for object alignment.

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

MStatus MFnMotionPath:: setUStart ( double start )

Description

Sets the starting value of the u parameterization for the animation.

Arguments

  • start the new start value

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

MStatus MFnMotionPath:: setUEnd ( double end )

Description

Sets the end value of the u parameterization for the animation.

Arguments

  • end the new end value

Return Value

  • Status Code

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

double MFnMotionPath:: uStart ( MStatus * ReturnStatus )

Description

Returns the starting value of the u parameterization for the animation.

Arguments

  • ReturnStatus Status Code

Return Value

  • The starting value

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

double MFnMotionPath:: uEnd ( MStatus * ReturnStatus )

Description

Returns the end value of the u parameterization for the animation.

Arguments

  • ReturnStatus Status Code

Return Value

  • The end value

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFa ilure An object error has occurred

MStatus MFnMotionPath:: setUTimeStart ( MTime & start )

Description

Sets the starting time of the animation for the u parameter.

Arguments

  • start the new start time

Return Value

  • Status code

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

MStatus MFnMotionPath:: setUTimeEnd ( MTime & end )

Description

Sets the end time of the animation for the u parameter.

Arguments

  • end the new end time

Return Value

  • Status code

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

MTime MFnMotionPath:: uTimeStart ( MStatus * ReturnStatus )

Description

Returns the start time of the animation for the u parameter.

Arguments

  • ReturnStatus Status Code

Return Value

  • The starting time

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

MTime MFnMotionPath:: uTimeEnd ( MStatus * ReturnStatus )

Description

Returns the end time of the animation for the u parameter.

Arguments

  • ReturnStatus Status Code

Return Value

  • The end time

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

unsigned int MFnMotionPath:: numPositionMarkers ( MStatus * ReturnStatus )

Description

Returns the number of position markers on this motion path.

Arguments

  • ReturnStatus Status Code

Return Value

  • The number of markers

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

MObject MFnMotionPath:: getPositionMarker ( unsigned int markerNum, MStatus * ReturnStatus )

Description

Gets the position marker where markerNum is the order in which the marker was created.

Arguments

  • markerNum The number of the marker
  • ReturnStatus Status Code

Return Value

  • The position marker

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

unsigned int MFnMotionPath:: numOrientationMarkers ( MStatus * ReturnStatus )

Description

Returns the number of orientation markers on this motion path.

Arguments

  • ReturnStatus Status Code

Return Value

  • The number of markers

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

MObject MFnMotionPath:: getOrientationMarker ( unsigned int markerNum, MStatus * ReturnStatus )

Description

Gets the orientation marker where markerNum is the order in which the marker was created.

Arguments

  • markerNum The number of the marker
  • ReturnStatus Status Code

Return Value

  • The orientation marker

Status Codes

  • MS::kSuccess Member was successful
  • MS::kFailure An object error has occurred

This class has no child classes.


Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright