class MFnExpression

Jump to documentation

: public MFnDependencyNode Expression function set. (OpenMaya) (OpenMaya.py)

Inheritance:

MFnExpression < MFnDependencyNode < MFnBase

public members:

MFnExpression ()
MFnExpression ( MObject & object, MStatus * ReturnStatus = NULL )
virtual ~MFnExpression ()
virtual MFn::Type type () const
enum UnitConversion
kAll
convert all units
kNone
do not do any unit conversion
kAngularOnly
only convert angular units
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 )
MStatus getExpression ( MString & expression )
NO SCRIPT SUPPORT

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

Description

This class is used to create, edit, and query expression nodes.

Functions

MFnExpression:: MFnExpression ()

Description

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

MFnExpression:: MFnExpression ( 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

MFnExpression:: MFnExpression ( 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

MFnExpression:: ~MFnExpression ()

Description

The class destructor.

MFn::Type MFnExpression:: type () const

Description

Return the type of this function set.

Return Value

  • the constant MFn::kExpression

MObject MFnExpression:: create ( const MString & expression , MObject & object, MStatus * ReturnStatus )

Description

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.

Arguments

  • expression The expression string
  • object The default object (optional - see above)
  • ReturnStatus Status code

Return Value

  • The expression node

Status Codes

  • MS::kSuccess
  • MS::kLicenseFailure application not licensed for attempted operation
  • MS::kFailure

MStatus MFnExpression:: getExpression ( MString & expression )

Description

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

Arguments

  • expression The expression string

Return Value

  • Status code

Status Codes

  • MS::kSuccess
  • MS::kFailure

MString MFnExpression:: expression ( MStatus *ReturnStatus )

Description

Gets the expression string for this expression node.

Arguments

  • ReturnStatus Status code. See below.

Return Value

  • The expression string

Status Codes

  • MS::kSuccess
  • MS::kFailure

MStatus MFnExpression:: setExpression ( const MString & expression )

Description

Sets the expression string for this expression node.

Arguments

  • expression The expression string

Return Value

  • Status Code

Status Codes

  • MS::kSuccess
  • MS::kFailure

MStatus MFnExpression:: getDefaultObject ( MObject & object )

Description

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.

Arguments

  • object storage for the default object

Return Value

  • Status Code

Status Codes

  • MS::kSuccess
  • MS::kFailure

MStatus MFnExpression:: setDefaultObject ( MObject & object )

Description

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.

Arguments

  • object the object to be set

Return Value

  • Status Code

Status Codes

  • MS::kSuccess
  • MS::kFailure

bool MFnExpression:: isAnimated ( MStatus * ReturnStatus )

Description

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.

Arguments

  • ReturnStatus Status code

Return Value

  • true expression will be evaluated whenever time changes
  • false

Status Codes

  • MS::kSuccess
  • MS::kFailure

MStatus MFnExpression:: setAnimated ( bool value )

Description

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.

Arguments

  • value sets the objects evaluation type

Return Value

  • Status Code

Status Codes

  • MS::kSuccess
  • MS::kFailure

MStatus MFnExpression:: evaluate ( MDoubleArray & result )

Description

Evaluate this expression and return the result.

Arguments

  • result the value of the expression

Return Value

  • Status code

Status Codes

  • MS::kSuccess
  • MS::kFailure

MFnExpression::UnitConversion MFnExpression:: unitConversion ( MStatus * ReturnStatus ) const

Description

Get the unit conversion status for the expression node.

Arguments

  • ReturnStatus Status code

Return Value

  • the unit conversion state for this node

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set does not have a valid object

MStatus MFnExpression:: setUnitConversion ( UnitConversion conversion )

Description

Set the unit conversion options for the expression node.

Arguments

  • conversion unit conversion state for this node

Return Value

  • Status code

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set does not have a valid object

This class has no child classes.


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