Expression function set.
This class is used to create, edit, and query expression nodes.
#include <MFnExpression.h>
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) |
This method creates and returns a dependency
node for a given expression. |
|
MString | expression (MStatus *ReturnStatus=NULL) |
Gets the expression string for this
expression node. |
|
MStatus | setExpression (const MString &expression) |
Sets the expression string for this
expression node. |
|
MStatus | getDefaultObject (MObject &object) |
Gets the "default" object for the
expression. |
|
MStatus | setDefaultObject (MObject &object) |
Sets the "default" object for the
expression. |
|
bool | 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. |
|
MStatus | setAnimated (bool value=false) |
Sets the way in which the expression is
evaluated. |
|
MStatus | evaluate (MDoubleArray &result) |
Evaluate this expression and return the
result. |
|
UnitConversion | unitConversion (MStatus *ReturnStatus=NULL) const |
Get the unit conversion status for the
expression node. |
|
MStatus | setUnitConversion (UnitConversion conversion) |
Set the unit conversion options for the
expression node. |
|
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. |
enum UnitConversion |
Unit conversion modes.
MFnExpression | ( | MObject & | object, |
MStatus * | ReturnStatus =
NULL |
||
) |
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 |
MFnExpression | ( | const MObject & | object, |
MStatus * | ReturnStatus =
NULL |
||
) |
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 type | ( | ) | const [virtual] |
const char * className | ( | ) | const [protected, virtual] |
MObject 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 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 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 evaluate | ( | MDoubleArray & | result | ) |
Evaluate this expression and return the result.
[out] | result | the value of the expression |
MFnExpression::UnitConversion unitConversion | ( | MStatus * | ReturnStatus =
NULL |
) | const |
Get the unit conversion status for the expression node.
[out] | ReturnStatus | Status code |
MStatus 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 |