SkinCluster

class cgp_maya_utils.scene.SkinCluster(name)

Bases: cgp_maya_utils.scene.GeometryFilter

node object that manipulates a skinCluster node

addInfluence(influence)

add influence to the skinCluster

Parameters:influence (str) – influence to add to the skinCluster
bindPreMatrixes()

get the bindPreMatrixes of the skinCluster

Returns:bindPreMatrixes dictionary - {influence1: matrixAttribute1, influence2: matrixAttribute2 ...}
Return type:dict[str: str]
connectBindPreMatrixes(bindPreMatrixes=None)

connect the bindPreMatrixes of the skinCluster

Parameters:bindPreMatrixes (dict) – bindPreMatrixes of the skinCluster - {influence1: matrixAttribute1, influence2: matrixAttribute2 ...}
copy(shape, byProximity=True)

copy the skinCluster to the shape

Parameters:
  • shape (str or cgp_maya_utils.scene.Shape) – shape on which to copy the skinCluster
  • byProximity (bool) – True : weights are copied by proximity - False : weights are injected on points
Returns:

the created copied SkinCluster

Return type:

cgp_maya_utils.scene.SkinCluster

classmethod create(shapes, influences, weights=None, bindPreMatrixes=None, attributeValues=None, name=None, **__)

create a skinCluster

Parameters:
  • shapes (list[str] or list[cgp_maya_utils.scene.Shape]) – shapes that will be deformed by the skinCluster
  • influences (list[str] or list[cgp_maya_utils.scene.Joint, cgp_maya_utils.scene.Shape]) – influences that will drive the skinCluster
  • weights (dict[str: list[int, float]]) – weights of the skin cluster - {influence1: [], influence2: [] ...}
  • bindPreMatrixes (dict) – bindPreMatrixes of the skinCluster - {influence1: matrixAttribute1, influence2: matrixAttribute2 ...}
  • attributeValues (dict) – attribute values to set on the skinCluster node
  • name (str) – name of the skinCluster node
Returns:

the created skinCluster

Return type:

cgp_maya_utils.scene.SkinCluster

data()

data necessary to store the skinCluster node on disk and/or recreate it from scratch

Returns:the data of the skinCluster node
Return type:dict
influences()

the influences of the skinCluster

Returns:the influences of the skinCluster
Return type:list[cgp_maya_utils.scene.Joint, cgp_maya_utils.scene.Shape]
recacheBindMatrices()

recache the bind matrixes of the skinCluster

removeInfluence(influence)

remove an influence from the skinCluster

Parameters:influence (str or cgp_maya_utils.scene.Joint or cgp_maya_utils.scene.Shape) – the influence to remove from the skinCluster
reset()

reset the skinCluster

setWeights(weights)

set the weights of the skinCluster

Parameters:weights (dict) – weights to set on the skinCluster - {influence1: [], influence2: [] ...}
swapInfluences(oldFlag, newFlag, reset=True)

swap current influences by new influences using the flags

Parameters:
  • oldFlag (str) – flag that will be replaced by the new flag
  • newFlag (str) – flag that will replace the old flag
  • reset (bool) – True : skinCluster will be reset after the swap - False : skinCluster will not be reset
unusedInfluences()

the unused influences of the skinCluster

Returns:the unused influences
Return type:list[cgp_maya_utils.scene.Joint, Shape]
weights()

the weights of the geometry filter node - same weights that are accessible through painting

Returns:the weights of the skinCluster - {joint1: [], joint2: [] ...}
Return type:dict