bgdev.utils.skincluster

Utility methods for skinclusters.

created

26/02/2017

author

Benoit Gielly <benoit.gielly@gmail.com>

add_influences(node, joints)[source]

Add given joints to the skincluster.

Parameters
  • node (str) – Can be either the skincluster or the bound node.

  • joints (list) – List of joints/influences to add.

Raises

RuntimeError – If the skincluster cannot be found.

add_influences_callback()[source]

Call back add_influences().

bind_skincluster(mesh=None, bones=None)[source]

Create a new skincluster with preset options.

Parameters
  • mesh (str) – Name of the geometry to bind.

  • bones (list) – List of bones/influences.

Returns

The created skincluster.

Return type

str

bind_skincluster_callback()[source]

Call back bind_skincluster().

copy_skincluster(source, target, method='closestPoint')[source]

Copy source skincluster onto target and keep same weights.

Parameters
  • source (str) – source mesh to copy skincluster form

  • target (str) – target mesh to paste skincluster to

  • method (str) – influence association method. Default is closestPoint.

Raises

RuntimeError – If the source skincluster cannot be found.

copy_skincluster_callback(method='closestPoint')[source]

Call back copy_skincluster().

detach_skincluster(node, clean=False)[source]

Detach the skin cluster attached to given node.

Parameters
  • node (str) – Name of the node to unbind.

  • clean (bool) – If True, remove shapeOrigs and unlock transforms.

detach_skincluster_callback(clean=False)[source]

Call back detach_skincluster().

get_influences(node, weighted=False)[source]

Get influences of given skincluster.

Parameters
  • node (str) – Can be either the skincluster or the bound node.

  • weighted (bool) – If True, returns only weighted influences.

Returns

List of influences.

Return type

list

Raises

RuntimeError – If the skincluster cannot be found.

get_skincluster(node)[source]

Return the skincluster of given node.

If the passed node already is a skincluster, just return it.

Parameters

node (str) – Can be either the skincluster or the bound node.

Raises

RuntimeError – If the skincluster cannot be found.

Returns

The skincluster bound to the node.

Return type

str

remove_influences(node, joints=None, unused=False, disconnect=False)[source]

Remove given joints from the skincluster.

Parameters
  • node (str) – Can be either the skincluster or the bound node.

  • joints (list) – List of joints/influences to add.

  • unused (bool) – Removed all unused influences found. This flag ignores joints when used.

Raises

RuntimeError – If the skincluster cannot be found.

remove_influences_callback(unused=False)[source]

Call back remove_influences().

reset_skincluster(node)[source]

Reset the skin cluster in place.

Parameters

node (str) – SkinCluster node or the geometry bound to it.

reset_skincluster_callback()[source]

Call back reset_skincluster().

select_influences_callback()[source]

Call back select_influences().