Function set for operating on skinCluster nodes.
SkinCluster nodes are created during a smooth bindSkin. They
store a weight per influence object for each component of the
geometry that is deformed. Influence objects can be joints or
any transform.
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.
__init__()
Initializes a new, empty MFnSkinCluster functionset.
__init__(MObject)
Initializes a new MFnSkinCluster functionset and attaches it to
a skinCluster node.
Method resolution order:
- MFnSkinCluster
- MFnGeometryFilter
- OpenMaya.MFnDependencyNode
- OpenMaya.MFnBase
- __builtin__.object
Inheritance diagram for OpenMayaAnim.MFnSkinCluster:
x.__init__(...) initializes x; see help(type(x)) for signature
Member Function Documentation
OpenMayaAnim.MFnSkinCluster.getBlendWeights
(
)
getBlendWeights(shape, components) -> MDoubleArray
Returns blend weights for the specified components of the deformed
shape. Blend weights are used to determine the blending between
classical linear skinning and dual quaternion bases skinning on a
per vertex basis. The returned array contains one weight per component
in the order given by 'components'.
* shape (MDagPath) - the object being deformed by the skinCluster
* components (MObject) - components for which weights should be returned
getPointsAffectedByInfluence(influence) -> (MSelectionList, MDoubleArray)
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 returns the non-zero weights for a particular
influence object.
The return value is a tuple consisting of a selection list, which
contains the dag path and components that are affected by the
specified influence object, and the corresponding weights for the
components. If no components are weighted for a specified influence
the selection list will be empty.
* influence (MDagPath) - the influence object of interest
OpenMayaAnim.MFnSkinCluster.getWeights
(
)
getWeights(shape, components) -> (MDoubleArray, int)
getWeights(shape, components, influence) -> MDoubleArray
getWeights(shape, components, influences) -> MDoubleArray
Returns the skinCluster weights of the given influence objects on
the specified components of the deformed shape.
If no influence index is provided then a tuple containing the weights
and the number of influence objects will be returned.
If a single influence index is provided the an array of weights will
be returned, one per component in the same order as in 'components'.
If an array of influence indices is provided an array of weights will
be returned containing as many weights for each component as there
are influences in the 'influenceIndices' array. The weights will be
in component order: i.e. all of the weight values for the first
component, followed by all the weight values for the second component,
and so on.
* shape (MDagPath) - the object being deformed by the skinCluster
* components (MObject) - components to return weights for
* influence (int) - index of the single influence to return weights for
* influences (MIntArray) - indices of multiple influences to return weights for
indexForInfluenceObject(influenceObj) -> long
Returns the logical index of the matrix array attribute where the
specified influence object is attached.
* influenceObj (MObject) - influence object for which the index is requested.
OpenMayaAnim.MFnSkinCluster.influenceObjects
(
)
influenceObjects() -> MDagPathArray
Returns an array of paths to the influence objects for the skinCluster.
OpenMayaAnim.MFnSkinCluster.setBlendWeights
(
)
setBlendWeights(shape, components, weights) -> self
Sets blend weights for the specified components of the shape being
deformed by the skinCluster. Blend weights are used to determine the
blending between classical linear skinning and dual quaternion bases
skinning on a per vertex basis.
* shape (MDagPath) - object being deformed by the skinCluster
* components (MObject) - components of 'shape' to set blend weights for
* weights (MDoubleArray) - weights to set, one per component. If the
length of this array does match the number
of components provided then the lesser of
the two will be used.
OpenMayaAnim.MFnSkinCluster.setWeights
(
)
setWeights(shape, components, influence, weight, normalize=True, returnOldWeights=False) -> None or MDoubleArray
setWeights(shape, components, influences, weights, normalize=True, returnOldWeights=False) -> None or MDoubleArray
Sets the skinCluster weights for one or more influence objects on
the specified components of the given shape. If 'returnOldWeights'
is True then the old weights will be returned, otherwise None will
be returned
If only a single influence index and weight are specified then that
weight is applied to all of the specified components. The returned
array of old weights, if requested, will contain weights for ALL of
the skinCluster's influence objects, not just the one specified by
the 'influence' parameter.
If arrays of influence indices and weights are provided then the
behaviour depends upon the number of elements in the 'weights' array.
If it's equal to the number of influences specified then each weight
will be used for all of components for the corresponding influence
object. If it's equal to the number of influences times the number of
components provided, then a separate weight will be used for each
component, with all of the weights for the first component coming
first in the 'weights' array, followed by all of the weights for the
second component, and so on. Within each component the weights will
will correspond with the ordering of influence indices in the
'influences' array. The returned old weights, if requested, will
consist of a separate weight for
The returned old weights will be ordered by influence within
component, i.e. all of the influence weights for the first component
will come first in the array, followed by all the weights for the
second component, and so on.
* shape (MDagPath) - object being deformed by the skinCluster
* components (MObject) - the components to set weights on
* influence (int) - physical index of a single influence object
* weight (float) - single weight to be applied to all components.
* influences (MIntArray) - physical indices of several influence objects.
* weights (MDoubleArray) - weights to be used with several influence objects.
* normalize (bool) - if True, normalize weights on other influence objects
* returnOldWeights(bool) - if True, return the old weights, otherwise return None