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 None

  • influence/inf (list, tuple, Transform) – one or more influences; defaults to None

  • multi (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

dict

classmethod createFromMacro(macro, **overrides)#

Recreates this skinCluster using the type of macro returned by macro().

Parameters
  • macro (dict) – the type of macro returned by macro().

  • **overrides – overrides to the macro, passed-in as keyword arguments

Returns

The reconstructed skinCluster.

Return type

SkinCluster

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 to

  • name/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

SkinCluster

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 via deformerWeights(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.

Parameters
  • correctiveShape (str, Shape, Transform) – the corrective (sculpt) shape

  • name/n (str) – a name for the inverted shape node; defaults to None

Returns

The pre-deformation target.

Return type

GeometryShape

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