paya.runtime.nodes.Cluster#

class Cluster(*args, **kwargs)#

Inheritance

Cluster WeightGeometryFilter WeightGeometryFilter GeometryFilter GeometryFilter DependNode DependNode PyNode ProxyUnicode

classmethod create(*geos, geometry=None, handle=None, maintainOffset=None, conformShapeName=False, resetVisualOrigin=True, intermediateShape=None, worldMatrix=None, freeze=True, name=None, **mayaKwargs)#

Cluster constructor.

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

  • *geos (None, str, tuple, list, DeformableShape, Transform) – one or more geometries to bind

  • geometry/g (None, str, tuple, list, DeformableShape, Transform) – alternative geometry aggregator; defaults to None

  • handle/hnd – a custom user handle (weighted node) for the cluster; if provided, will override the weightedNode / wn argument for cluster(); defaults to None

  • maintainOffset/mo (bool) – prevent deformation jumps when assigning a custom handle that has transform values; if provided, will override the bindState / bs argument for cluster(); defaults to None

  • conformShapeName/csn (bool) – when using a custom handle, rename the ClusterHandle node accordingly; defaults to True

  • resetVisualOrigin/rvo (bool) – when using a custom handle, modify origin on the ClusterHandle node accordingly; defaults to True

  • intermediateShape/i (bool) – sets the ‘intermediate’ state of the ClusterHandle node; where a custom weighted node is specified, this defaults to True if the destination parent has hero shapes, otherwise False; if no custom handle is specified, defaults to False

  • worldMatrix/wm (None, list, tuple, Matrix) – ignored if a custom handle is specified; modifes the initial matrix of the default cluster handle; defaults to None

  • freeze/fr (bool) – ignored if worldMatrix was omitted, or if a custom handle was specified; after applying custom transformations to the default handle, freeze transform and scale but preserve rotation; defaults to True

  • **mayaKwargs – passed along to cluster(), except where overriden by other options

Returns

The cluster node. To get the handle transform, use getHandle().

getHandle()#

Paya’s flavour of getWeightedNode(). Getter for handle property.

Returns

The cluster handle transform (weighted node).

Return type

Transform

setHandle(transform, maintainOffset=False, intermediateShape=None, resetVisualOrigin=True, deletePreviousHandle=False, conformShapeName=True)#

Swaps-in a custom handle transform (weighted node). Setter for handle property.

Parameters
  • transform (str, Transform) – the node to swap-in

  • maintainOffset/mo (bool) – prevent changes in deformation; defaults to False

  • intermediateShape/i (bool) – after reparenting the ClusterHandle node, set it to intermediate; defaults to True if the destination parent has hero shapes, otherwise False

  • resetVisualOrigin/rvo (bool) – edit the origin attribute on the ClusterHandle so that it matches the new handle; defauls to True

  • deletePreviousHandle/dph (bool) – delete the current weighted node after completing the swap

  • copyName/cn (bool) – copy the name of the current weighted node

  • conformShapeName/csn (bool) – after reparenting the ClusterHandle node, rename it to match the destination transform; defaults to True

Returns

self

Return type

Cluster

renameSystem(*name)#

Renames the cluster node, cluster handle shape and weighted node.

Parameters

*name (str) – if omitted, defaults to contextual naming

Returns

self

Return type

Cluster

getHandleShape()#

Getter for handleShape property.

Returns

The connected class:~paya.runtime.nodes.ClusterHandle node, if any.

Return type

class:~paya.runtime.nodes.ClusterHandle

normalize()#

Compensates transformations on the cluster to un-deform the geometry.

Returns

self

Return type

Cluster