class MFnSkinCluster

Jump to documentation

: public MFnGeometryFilter skinCluster function set (OpenMayaAnim) (OpenMayaAnim.py)

Inheritance:

MFnSkinCluster < MFnGeometryFilter < MFnDependencyNode < MFnBase

public members:

MFnSkinCluster ()
MFnSkinCluster ( MObject & object, MStatus * ReturnStatus = NULL )
virtual ~MFnSkinCluster ()
virtual MFn::Type type () const
MStatus getWeights (const MDagPath & path, const MObject & components, unsigned int influenceIndex, MDoubleArray & weights) const
MStatus getWeights (const MDagPath & path, const MObject & components, MDoubleArray & weights, unsigned int& influenceCount) const
MStatus setWeights (const MDagPath & path, const MObject & components, unsigned int jointIndex, double value, bool normalize = true, MDoubleArray *oldValues = NULL)
MStatus setWeights (const MDagPath & path, const MObject & components, MIntArray & influenceIndices, MDoubleArray & values, bool normalize = true, MDoubleArray *oldValues = NULL)
MStatus getPointsAffectedByInfluence (const MDagPath & path, MSelectionList & result, MDoubleArray & weights)
unsigned int indexForInfluenceObject (const MDagPath & path, MStatus *ReturnStatus = NULL) const
unsigned int influenceObjects ( MDagPathArray & paths, MStatus *ReturnStatus = NULL) const
MStatus getWeights (const MDagPath & path, const MObject & components, unsigned int influenceIndex, MFloatArray & weights) const
MStatus getWeights (const MDagPath & path, const MObject & components, MFloatArray & weights, unsigned int& influenceCount) const
MStatus setWeights (const MDagPath & path, const MObject & components, unsigned int jointIndex, float value, bool normalize = true, MFloatArray *oldValues = NULL)
MStatus setWeights (const MDagPath & path, const MObject & components, MIntArray & influenceIndices, MFloatArray & values, bool normalize = true, MFloatArray *oldValues = NULL)
MStatus getPointsAffectedByInfluence (const MDagPath & path, MSelectionList & result, MFloatArray & weights)
MFnSkinCluster ( const MObject & object, MStatus * ReturnStatus = NULL )

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

MFnSkinCluster is the function set for editing the weights of skinClusters.
Description

MFnSkinCluster is the function set for skinClusters. SkinCluster nodes are created during a smooth bindSkin. The purpose of the skinCluster is to store a weight per influence object for each component of each geometry that is deformed. Influence objects can be joints or any transform.

Note that unlike most deformers, a skinCluster node can deform only a single geometry. Therefore, if additional geometries are added to the skinCluster set, they will be ignored.

This function set provides methods for getting and setting weights on skin cluster nodes. It parent class, MFnGeometryFilter provides methods for accessing the skin cluster's input and output geometry.

Functions

MFnSkinCluster:: MFnSkinCluster ()

Description

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

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

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

MFnSkinCluster:: ~MFnSkinCluster ()

Description

The class destructor.

MFn::Type MFnSkinCluster:: type () const

Description

Return the type of this function set.

Return Value

  • the constant MFn::kSkinClusterFilter

MStatus MFnSkinCluster:: setWeights (const MDagPath & path, const MObject & components, unsigned int influenceIndex, double value, bool normalize , MDoubleArray *oldValues )

Description

Sets the skinCluster weight for the influence object on the specified components of the object whose dagPath is specified. The influence is specified using the physical (non-sparse) index of the influence object. This corresponds to the order the influences are returned by the influenceObjects method.

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. The number of oldValues returned will be of size number of specified components x the total number of influence objects. The values in the oldValues array will be ordered with first the all the values for the first component, then all the values for the next, and so on.

Note that unlike most deformers, a skinCluster node can deform only a single geometry. Therefore, if additional geometries are added to the skinCluster set, they will be ignored, and weights cannot be set for the additional geometry.

Arguments

  • path path to object deformed by the skinCluster
  • components components to be weighted
  • influenceIndex physical index of influence object for the weight
  • value weight value
  • normalize whether or not to normalize weights on other influence objects
  • oldValues previous weight values, for undo

Return Value

  • the status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure operation failed
  • MS::kInvalidObjectType component or influence index was invalid, or shape was not attached to skinCluster

MStatus MFnSkinCluster:: setWeights (const MDagPath & path, const MObject & components, MIntArray & influenceIndices, MDoubleArray & values, bool normalize , MDoubleArray *oldValues )

Description

Sets the skinCluster weight on the specified components of the object whose dagPath is specified for the influence objects corresponding to the specified influence indices. The influence is specified using the physical (non-sparse) index of the influence object. This corresponds to the order the influences are returned by the influenceObjects method.

If you want to set the same values on all of the specified components, the number of values in the values array should equal the number of indices in the influence indices array. If you want to specify a unique value for each component, the number of values in the values array should equal the number of components x the number of indices in the influence indices array. The ordering of the values array should be such that first all the values for the first component are listed, then the second, and so on. For example, if you want to set the weights for three components for influences 7 and 10, the influence array would contain [7,10], and the values array would contain: [component1 weight for influence 7, component 1 weight for influence 10, component2 weight for influence 7, component2 weight for influence 10, ...]. In order to undo the setWeights operation, it is necessary to save the oldValues array and call setWeights with the oldValues array at the time of undo. The number of oldValues returned will be of size number of components x total number of influence objects. The values in the oldValues array will be ordered with first the all the values for the first component, then all the values for the next, and so on.

Note that unlike most deformers, a skinCluster node can deform only a single geometry. Therefore, if additional geometries are added to the skinCluster set, they will be ignored, and weights cannot be set for the additional geometry.

Arguments

  • path path to object deformed by the skinCluster
  • components components to be weighted
  • influenceIndices physical indices of influence objects to set
  • value weight values
  • normalize whether or not to normalize weights on other influence objects
  • oldValues previous weight values, for undo

Return Value

  • the status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure operation failed
  • MS::kInvalidObjectType component was invalid, or shape was not attached to skinCluster, or invalid influenceIndices were specified

MStatus MFnSkinCluster:: getWeights (const MDagPath & path, const MObject & components, unsigned int influenceIndex, MDoubleArray & weights) const

Description

Gets the skinCluster weights for the influence object for the specified components of the object whose dagPath is specified. Note that if some of components are not deformed by the skinCluster, zeros will be returned as the weights. For example, on periodic nurbs surfaces, some of the cvs enforce the periodicity of the surface. There is no weight data for these components. They do not get deformed since their position is automatically maintained by the nurb so that the periodicity of the surface will not be lost. Zeros will be returned for such components.

The influence object is specified using the physical (non-sparse) index of the influence object. This corresponds to the order the influences are returned by the influenceObjects method.

The length of the returned array will be equal to the number of specified components. The values in the returned array will be ordered in the same order as the input components.

Arguments

  • path path to object deformed by the skinCluster
  • components components to return weights for
  • influenceIndex physical index of influence object
  • weights weight values

Return Value

  • the status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure operation failed
  • MS::kInvalidObjectType component was invalid, shape was not attached to skinCluster, or invalid influenceIndex was specified

MStatus MFnSkinCluster:: getWeights (const MDagPath & path, const MObject & components, MDoubleArray & weights, unsigned int& influenceCount) const

Description

Gets the skinCluster weights for all influenceObjects for the specified components of the object whose dagPath is specified. Returns the weights in an array of size number of components x number of influenceObjects. The array elements are ordered by components: i.e. all of the weight values for the first component first, followed by all the weight values for the next component, and so on. For the first component, the weights are ordered by influence object in the same order that is returned by the MFnSkinCluster::influenceObjects method.

The number of influence objects is returned in influenceCount.

Arguments

  • path path to object deformed by the skinCluster
  • components components to return weights for
  • influenceCount count of influence objects
  • weights weight values returned (one per component, per influence)

Return Value

  • the status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure operation failed
  • MS::kInvalidObjectType component was invalid, shape was not attached to skinCluster, or invalid influenceIndex was specified

MStatus MFnSkinCluster:: setWeights (const MDagPath & path, const MObject & components, unsigned int influenceIndex, float value, bool normalize , MFloatArray *oldValues )

Description

This method is obsolete. Maya's skinCluster nodes store their weights as doubles. This method has been replaced by one which uses doubles instead of floats. This method only exists for backwards-compilability of old plug-in code.

Arguments

  • path path to object deformed by the skinCluster
  • components components to be weighted
  • influenceIndex index of influence object for the weight
  • value weight value
  • normalize whether or not to normalize weights on other influence objects
  • oldValues previous weight values, for undo

Return Value

  • the status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure operation failed
  • MS::kInvalidObjectType component was invalid, or shape was not attached to skinCluster, or invalid influenceIndex was specified

MStatus MFnSkinCluster:: setWeights (const MDagPath & path, const MObject & components, MIntArray & influenceIndices, MFloatArray & values, bool normalize , MFloatArray *oldValues )

Description

This method is obsolete. Maya's skinCluster nodes store their weights as doubles. This method has been replaced by one which uses doubles instead of floats. This method only exists for backwards-compilability of old plug-in code.

Arguments

  • path path to object deformed by the skinCluster
  • components components to be weighted
  • influenceIndices indices of influence objects to set
  • value weight values
  • normalize whether or not to normalize weights on other influence objects
  • oldValues previous weight values, for undo

Return Value

  • the status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure operation failed
  • MS::kInvalidObjectType component was invalid, or shape was not attached to skinCluster, or invalid influenceIndices was specified

MStatus MFnSkinCluster:: getWeights (const MDagPath & path, const MObject & components, unsigned int influenceIndex, MFloatArray & weights) const

Description

This method is obsolete. Maya's skinCluster nodes store their weights as doubles. This method has been replaced by one which uses doubles instead of floats. This method only exists for backwards-compilability of old plug-in code.

Arguments

  • path path to object deformed by the skinCluster
  • components components to return weights for
  • influenceIndex index of influence object
  • weights weight values

Return Value

  • the status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure operation failed
  • MS::kInvalidObjectType component was invalid, shape was not attached to skinCluster, or invalid influenceIndex was specified

MStatus MFnSkinCluster:: getWeights (const MDagPath & path, const MObject & components, MFloatArray & weights, unsigned int& influenceCount) const

Description

This method is obsolete. Maya's skinCluster nodes store their weights as doubles. This method has been replaced by one which uses doubles instead of floats. This method only exists for backwards-compilability of old plug-in code.

Arguments

  • path path to object deformed by the skinCluster
  • components components to return weights for
  • influenceCount count of influence objects
  • weights weight values returned (one per component, per influence)

Return Value

  • the status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure operation failed
  • MS::kInvalidObjectType component was invalid, shape was not attached to skinCluster, or invalid influenceIndex was specified
  • MS::kInvalidParameter operation failed, NULL MObject passed or the MObject does not support components

unsigned int MFnSkinCluster:: influenceObjects ( MDagPathArray & paths, MStatus *ReturnStatus) const

Description

Returns an array of paths to the influence objects for the skinCluster.

Arguments

  • paths influence objects
  • ReturnStatus return status

Return Value

  • the number of influence objects

Status Codes

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

unsigned int MFnSkinCluster:: indexForInfluenceObject (const MDagPath & mpath, MStatus *ReturnStatus) const

Description

Returns the logical index of the matrix array attribute where the specified influence object is attached.

Arguments

  • path path of the influence object
  • ReturnStatus return status

Return Value

  • the logical index of the influence object

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure operation failed, or transform is not an influence object

MStatus MFnSkinCluster:: getPointsAffectedByInfluence (const MDagPath & path, MSelectionList & result, MDoubleArray & weights)

Description

During deformation, the skinCluster algorithm is applied for a given influence object on all points in the deformer's set whose weights are non-zero. This method allows the user to query the non-zero weights for a particular influence object.

Returns a selection list containing the dag path and the components that are affected by the specified influence object. To retrieve the components from the returned MSelectionList, use MSelectionList::getDagPath. Also returns the corresponding weights for the components. If no components are weighted for a specified influence, the resulting selection list will be empty.

Arguments

  • path path of the influence object
  • result selection list of components affected by the influence object for this skinCluster (return)
  • weights weights for the affected components (return)

Return Value

  • returnStatus

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure operation failed, or path is not an influence object

MStatus MFnSkinCluster:: getPointsAffectedByInfluence (const MDagPath & path, MSelectionList & result, MFloatArray & weights)

Description

This method is obsolete. Maya's skinCluster nodes store their weights as doubles. This method has been replaced by one which uses doubles instead of floats. This method only exists for backwards-compilability of old plug-in code.

Arguments

  • path path of the influence object
  • result selection list of components affected by the influence object for this skinCluster (return)
  • weights weights for the affected components (return)

Return Value

  • returnStatus

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure operation failed, or path is not an influence object

This class has no child classes.


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