class MFnWeightGeometryFilter

Jump to documentation

: public MFnGeometryFilter Weight geometry filter function set (OpenMayaAnim) (OpenMayaAnim.py)

Inheritance:

MFnWeightGeometryFilter < MFnGeometryFilter < MFnDependencyNode < MFnBase

public members:

MFnWeightGeometryFilter ()
MFnWeightGeometryFilter ( MObject & object, MStatus * ReturnStatus = NULL )
virtual ~MFnWeightGeometryFilter ()
virtual MFn::Type type () const
MStatus getWeights (unsigned int index, const MObject &components, MFloatArray &weights) const
MStatus getWeights (const MDagPath &path, const MObject &components, MFloatArray &weights) const
MStatus setWeight (const MDagPath &path, unsigned int index, const MObject &components, float weight, MFloatArray *oldValues = NULL)
MStatus setWeight (const MDagPath &path, const MObject &components, float weight, MFloatArray *oldValues = NULL)
MStatus setWeight (const MDagPath &path, unsigned int index, const MObject &components, MFloatArray &values)
MStatus setWeight (const MDagPath &path, const MObject &components, MFloatArray &values)
MString weightPlugStrings (const MSelectionList &list, MStatus * ReturnStatus = NULL ) const
MStatus getWeightPlugStrings (const MSelectionList &list, MStringArray &plugStringArray) const
MFnWeightGeometryFilter ( const MObject & object, MStatus * ReturnStatus = NULL )
MStatus getWeightPlugStrings (const MSelectionList &list, MString &plugStrings) const
NO SCRIPT SUPPORT

Inherited from MFnGeometryFilter:

public members:

virtual MFn::Type type () const
MStatus getInputGeometry ( MObjectArray &objects) const
MStatus getOutputGeometry ( MObjectArray &objects) const
MObject inputShapeAtIndex (unsigned int index, MStatus *ReturnStatus = NULL) const
MObject outputShapeAtIndex (unsigned int index, MStatus *ReturnStatus = NULL) const
unsigned int indexForOutputShape (const MObject &shape, MStatus *ReturnStatus = NULL) const
MStatus getPathAtIndex (unsigned int index, MDagPath &path) const
unsigned int indexForGroupId (unsigned int groupId, MStatus *ReturnStatus = NULL) const
unsigned int groupIdAtIndex (unsigned int index, MStatus *ReturnStatus = NULL) const
unsigned int numOutputConnections ( MStatus *ReturnStatus = NULL) const
unsigned int indexForOutputConnection (unsigned int connectionIndex, MStatus *ReturnStatus = NULL) const
MObject deformerSet ( MStatus *ReturnStatus = NULL) const
float envelope ( MStatus *ReturnStatus = NULL) const
MStatus setEnvelope (float envelope )

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

MFnWeightGeometryFilter is the function set for editing the weights of clusters, cluster flexors, and user-defined deformers derived from MPxDeformerNode.
Description

MFnWeightGeometryFilter is the function set for weight geometry filters. Weight geometry filter nodes include clusters, cluster flexors, and user-defined deformers derived from MPxDeformerNode. The purpose of the weight geometry filter is to store the weights for each component of each geometry that is deformed. The weight geometry filter is independent of any algorithm that calculates a deformation based on the component weight values. Clusters, cluster flexors, and user-defined deformers each have their own algorithm to determine the deformation based on the component weights.

This function set provides methods for getting and setting weights on weight geometry filter nodes. In addition to getting and settings weights on components, this class provides methods for accessing the weight geometry filter's input and output geometry through its parent class, MFnGeometryFilter.

When getting and setting weights on components, it is more efficient to use the methods that take a plug index. The plug index is a sparse array index, and is the same index used in MEL scripts to index into an array of plugs.

Functions

MFnWeightGeometryFilter:: MFnWeightGeometryFilter ()

Description

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

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

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

MFnWeightGeometryFilter:: ~MFnWeightGeometryFilter ()

Description

The class destructor.

MFn::Type MFnWeightGeometryFilter:: type () const

Description

Return the type of this function set.

Return Value

  • the constant MFn::kWeightGeometryFilt

MStatus MFnWeightGeometryFilter:: getWeights (unsigned int index, const MObject &components, MFloatArray &weights) const

Description

Gets the weights of the components that correspond to the geometry at the specified plug index.

The relationship between the weights and the components can be determined by iterating through the components using the MItGeometry iterator. The iterator iterates through the components in the same order as the weights array.

Arguments

  • index the plug index corresponding to the shape that has the components
  • component the components whose weights are requested
  • weights the weight values of the components

Return Value

  • MS::kSuccess operation successful
  • MS::kFailure function set does not have a valid object
  • MS::kInvalidParameter component parameter is invalid

MStatus MFnWeightGeometryFilter:: getWeights (const MDagPath &path, const MObject &components, MFloatArray &weights) const

Description

Gets the weights of the components that correspond to the geometry whose DAG path is specified.

If the plug index is already known, it is more efficient to call the other getWeights method than this one. This getWeights method calls indexForOutputShape internally to find the plug index.

The relationship between the weights and the components can be determined by iterating through the components using the MItGeometry iterator. The iterator iterates through the components in the same order as the weights array.

Arguments

  • path the path of the DAG object that has the components
  • component the components whose weights are requested
  • weights the weight values of the components

Return Value

  • MS::kSuccess operation successful
  • MS::kFailure operation failed
  • MS::kInvalidParameter component parameter is invalid

MStatus MFnWeightGeometryFilter:: setWeight (const MDagPath &path, unsigned int index, const MObject &components, float weight, MFloatArray *oldValues)

Description

Sets the weights of the specified components of the object whose DAG path is specified.

In order to undo the setWeight operation, it is necessary to save the oldValues array and call setWeight with the oldValues array at the time of undo.

Arguments

  • path the DAG path for the object whose components' weights are being set
  • index the plug index for the specified shape
  • components the components of the object
  • weight weight value for the components
  • oldValues an array of old values for the components

Return Value

  • MS::kSuccess operation successful
  • MS::kFailure function set does not have a valid object
  • MS::kInvalidParameter component parameter is invalid

MStatus MFnWeightGeometryFilter:: setWeight (const MDagPath &path, const MObject &components, float weight, MFloatArray *oldValues)

Description

Sets the weights of the specified components of the object whose DAG path is specified.

If the plug index is already known, it is more efficient to call the corresponding setWeight method that takes a plugIndex. This setWeight method is a convenience method which calls indexForOutputShape internally to find the plug index.

In order to undo the setWeight operation, it is necessary to save the oldValues array and call setWeight with the oldValues array at the time of undo.

Arguments

  • path the DAG path for the object whose components' weights are being set
  • components the components of the object
  • weight weight value for the components
  • oldValues an array of old values for the components

Return Value

  • MS::kSuccess operation successful
  • MS::kFailure operation failed
  • MS::kInvalidParameter component parameter is invalid

MStatus MFnWeightGeometryFilter:: setWeight (const MDagPath &path, unsigned int index, const MObject &components, MFloatArray &values)

Description

Sets the weights of the specified components of the object whose DAG path is specified.

This method is useful in conjunction with the setWeight methods that return an oldValues array. This method can be called with those oldValues to restore the weights to the previous values.

Arguments

  • path the DAG path for the object whose components' weights are being set
  • index the plug index for the specified shape
  • component the components of the object
  • values the value array of the components

Return Value

  • MS::kSuccess operation successful
  • MS::kFailure function set does not have a valid object
  • MS::kInvalidParameter component parameter is invalid

MStatus MFnWeightGeometryFilter:: setWeight (const MDagPath &path, const MObject &components, MFloatArray &values)

Description

Sets the weights of the specified components of the object whose DAG path is specified.

This method is useful in conjunction with the setWeight methods that return an oldValues array. This method can be called with those oldValues to restore the weights to the previous values.

If the plug index is already known, it is more efficient to call the corresponding setWeight method that takes a plugIndex. This setWeight method is a convenience method which calls indexForOutputShape internally to find the plug index.

Arguments

  • path the DAG path for the object whose components' weights are being set
  • component the components of the object
  • values the value array of the components

Return Value

  • MS::kSuccess operation successful
  • MS::kFailure operation failed
  • MS::kInvalidParameter component parameter is invalid

MStatus MFnWeightGeometryFilter:: getWeightPlugStrings ( const MSelectionList &list, MString &plugStrings) const

Description

Sets the plugStrings argument to be a string (separated by spaces) containing the names of the plugs on this node that correspond to the components in the selection list. The method can be useful in conjunction with setting keys on a number of plugs. The operation will fail if none of the items in the selection list correspond to components weighted by this cluster.

Python Notes

This method is not supported in Python. See the version which returns a string.

Arguments

  • list selection list that contains components
  • plugStrings string containing the names of the plugs on this node that correspond to the components in the selection list

Return Value

  • MS::kSuccess operation successful
  • MS::kFailure operation failed

MString MFnWeightGeometryFilter:: weightPlugStrings ( const MSelectionList &list, MStatus * ReturnStatus) const

Description

Sets the plugStrings argument to be a string (separated by spaces) containing the names of the plugs on this node that correspond to the components in the selection list. The method can be useful in conjunction with setting keys on a number of plugs. The operation will fail if none of the items in the selection list correspond to components weighted by this cluster.

Arguments

  • list selection list that contains components
  • Status Status code

Return Value

  • string containing the names of the plugs on this node that correspond to the components in the selection list

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure operation failed

MStatus MFnWeightGeometryFilter:: getWeightPlugStrings ( const MSelectionList &list, MStringArray &plugStringArray) const

Description

Set the plugStringArray argument to contain the names of the plugs on this node that correspond to the components in the selection list. The operation will fail if none of the items in the selection list correspond to components weighted by this cluster.

Arguments

  • list selection list that contains components
  • plugStringArray string array containing the names of the plugs on this node that correspond to the components in the selection list; each of the plugs is put in a separate string

Return Value

  • MS::kSuccess operation successful
  • MS::kFailure operation failed

This class has no child classes.


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