paya.runtime.nodes.SkinCluster#
- class SkinCluster(*args, **kwargs)#
Inheritance
SkinCluster
GeometryFilter
GeometryFilter
DependNode
DependNode
PyNode
ProxyUnicode
- classmethod create(*args, bindMethod=0, dropoffRate=4.5, maximumInfluences=None, name=None, normalizeWeights=1, obeyMaximumInfluences=False, skinMethod=0, toSelectedBones=True, weightDistribution=0, geometry=None, influence=None, multi=False, replace=False, **kwargs)#
Lightweight convenience wrapper / constructor for skinClusters, with the following differences from the standard
skinCluster()
command:Positional arguments can be omitted, and the ‘geometry’ and ‘influence’ keyword arguments used instead on creation
A select subset of flags are pre-loaded with common defaults (see below)
Added ‘multi’ option
Added ‘replace’ option
- Parameters
*args – forwarded to
skinCluster()
bindMethod/bm (int) – see Maya help; defaults to 0 (closest)
dropoffRate/dr (float) – see Maya help; defaults to 4.5
maximumInfluences/mi (None, int) – see Maya help; defaults to None
name/n (str) – a name for the skinCluster node; defaults to
None
normalizeWeights/nw (int) – see Maya help; defaults to 1 (interactive)
obeyMaximumInfluences/omi (bool) – see Maya help; defaults to False
skinMethod/sm (int) – see Maya help; defaults to 0 (linear)
toSelectedBones/tsb (bool) – see Maya help; defaults to True
weightDistribution/wd (int) – see Maya help; defaults to 0 (distance)
geometry/g (list, tuple,
DeformableShape
,Transform
) – the geometry to bind to; defaults to Noneinfluence/inf (list, tuple,
Transform
) – one or more influences; defaults to Nonemulti (bool) – set this to True to create multiple skinClusters across all passed geometries; defaults to False
replace/rep (bool) – remove any existing skinClusters from the passed geometries; defaults to False
**kwargs – forwarded to
skinCluster()
- Returns
SkinCluster
or [SkinCluster
]
- macro()#
- Returns
A simplified representation of this deformer that can be used by
createFromMacro()
to recreate it.- Return type
- classmethod createFromMacro(macro, **overrides)#
Recreates this skinCluster using the type of macro returned by
macro()
.- Parameters
- Returns
The reconstructed skinCluster.
- Return type
- copyTo(geo, name=None, replace=True, weights=True, method='index', sourceUVSet=None, destUVSet=None)#
Copies this skinCluster to the specified geometry.
- Parameters
geo (str,
DagNode
) – the geometry to copy toname/n (str) – a name for the new skinCluster; defaults to
None
replace/rep (bool) – if the destination geometry already has a skinCluster, remove it; defaults to True
weights/w (bool) – copy weights too; defaults to True
method/m (str) –
the weight-copying method; one of:
index
(via XML)bilinear
(via XML)barycentric
(via XML)nearest
(via XML)over
(via XML)closestPoint
(in-scene)closestComponent
(in-scene)uv
(in-scene)rayCast
(in-scene)
sourceUVSet/suv (str, None) – if specified, ‘method’ will be overriden to ‘uv’; if omitted, and ‘method’ is ‘uv’, the current UV set will be used; defaults to None
destUVSet/duv (str, None) – if specified, ‘method’ will be overriden to ‘uv’; if omitted, and ‘method’ is ‘uv’, the current UV set will be used; defaults to None
- Returns
The new skinCluster.
- Return type
- dumpWeights(filepath, shape=None, remap=None, vertexConnections=None, weightPrecision=None, weightTolerance=None, attribute=None, defaultValue=None)#
Overloads
paya.runtime.nodes.GeometryFilter.dumpWeights()
to include DQ blend weights by default, and to work around this bug:When the
.blendWeights
array on a skinCluster is sparsely populated (as is typically the case), dumping and reloading it viadeformerWeights(at='blendWeights')
results in a wrong index mapping.
- invertShape(correctiveShape, name=None)#
Given a corrective geometry for the current skinCluster pose, returns a reversed geometry suitable for use as a pre-deformation blend shape target.
- classmethod loadAll(sourceDir, method='index', worldSpace=None, positionTolerance=None)#
To-Dos: - add option to just read weights, without recreating skins - add option to filter for shapes