#include <MFnExpression.h>
This class is used to create, edit, and query expression nodes.
Public Types | |
enum | UnitConversion { kAll, kNone, kAngularOnly } |
Unit conversion modes. More... | |
Public Member Functions | |
virtual MFn::Type | type () const |
Function set type. | |
virtual | ~MFnExpression () |
Destructor. | |
MFnExpression () | |
Default constructor. | |
MFnExpression (MObject &object, MStatus *ReturnStatus=NULL) | |
Constructor. | |
MObject | create (const MString &expression, MObject &object=MObject::kNullObj, MStatus *ReturnStatus=NULL) |
MString | expression (MStatus *ReturnStatus=NULL) |
MStatus | setExpression (const MString &expression) |
MStatus | getDefaultObject (MObject &object) |
MStatus | setDefaultObject (MObject &object) |
bool | isAnimated (MStatus *ReturnStatus=NULL) |
MStatus | setAnimated (bool value=false) |
MStatus | evaluate (MDoubleArray &result) |
UnitConversion | unitConversion (MStatus *ReturnStatus=NULL) const |
MStatus | setUnitConversion (UnitConversion conversion) |
MFnExpression (const MObject &object, MStatus *ReturnStatus=NULL) | |
Constructor. | |
MStatus | getExpression (MString &expression) |
NO SCRIPT SUPPORT. | |
Protected Member Functions | |
virtual const char * | className () const |
Class name. |
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 MFnExpression::type | ( | ) | const [virtual] |
const char * MFnExpression::className | ( | ) | const [protected, virtual] |
MObject MFnExpression::create | ( | const MString & | expression, | |
MObject & | object = MObject::kNullObj , |
|||
MStatus * | ReturnStatus = NULL | |||
) |
This method creates and returns a dependency node for a given expression.
A default object can be specified, but if it is not specified in the expression string then the expression string values will be used.
If the expression string is of the form "objectName.attribute = ... " then the default object parameter is not needed. If you supply a default object in this case, then it will be ignored.
If the expression has no default object then you must supply one. For example, if the expression is of the form "attribute = ...", then you must supply a default object.
[in] | expression | The expression string |
[in] | object | The default object (optional - see above) |
[out] | ReturnStatus | Status code |
Gets the expression string for this expression node.
[out] | ReturnStatus | Status code. See below. |
Sets the expression string for this expression node.
[in] | expression | The expression string |
Gets the "default" object for the expression. Not all expressions have a default object. If there is no default object for the expression, the object will be set to MObject::kNullObject and the return status will indicate success. This is a completely legal case that the calling code should check for before blindly using the returned object.
[out] | object | storage for the default object |
Sets the "default" object for the expression. This allows the expression writer to not type the object name for frequently-used objects.
This method will only work for expression strings in which the object name is not specified.
[in] | object | the object to be set |
bool MFnExpression::isAnimated | ( | MStatus * | ReturnStatus = NULL |
) |
If this is true, then the expression will be evaluated whenever time changes, regardless of whether the other inputs have changed.
If it is false (the default) , then the expression will only be evaluated if one or more of the inputs change.
Note, if 'time' or 'frame' are inputs, then the expression will act as if this was set to true.
[out] | ReturnStatus | Status code |
MStatus MFnExpression::setAnimated | ( | bool | value = false |
) |
Sets the way in which the expression is evaluated.
If this is true, then the expression will be evaluated whenever time changes, regardless of whether the other inputs have changed.
If it is false (the default) , then the expression will only be evaluated if one or more of the inputs change.
Note, if 'time' or 'frame' are inputs, then the expression will act as if this was set to true.
[in] | value | sets the objects evaluation type |
MStatus MFnExpression::evaluate | ( | MDoubleArray & | result | ) |
Evaluate this expression and return the result.
[out] | result | the value of the expression |
MFnExpression::UnitConversion MFnExpression::unitConversion | ( | MStatus * | ReturnStatus = NULL |
) | const |
Get the unit conversion status for the expression node.
[out] | ReturnStatus | Status code |
MStatus MFnExpression::setUnitConversion | ( | UnitConversion | conversion | ) |
Set the unit conversion options for the expression node.
[in] | conversion | unit conversion state for this node |
NO SCRIPT SUPPORT.
Gets the expression string for this expression node.
Python Notes
This method is not supported in Python. Please see the one which returns a string
[in] | expression | The expression string |
Autodesk® Maya® 2009 © 1997-2008 Autodesk, Inc. All rights reserved. | Generated with 1.5.6 |