trigger.library.deformers

Collection of deformer related functions

Attributes

log

Functions

add_object_to_lattice(obj, lattice_deformer)

Add the object to the lattice deformer.

add_target_blendshape(blendshape_node, target_mesh[, ...])

cluster(mesh)

connect_bs_targets(driver_attr, targets_dictionary[, ...])

Creates or adds Blendshape target and connects them into the same controller attribute

create_proximity_wrap(driver, driven[, wrap_mode, ...])

create_shrink_wrap(driver, driven[, name])

Creates the Shrink Wrap deformer

create_wrap(influence, surface[, name, ...])

get_bs_index_by_name(bs_node, target_name)

get_deformers([mesh, names_only])

Collects defomers in a dictionary by type

get_influencers(deformer)

get_pre_blendshapes(mesh)

Returns the blendshape node(s) before the skinCluster

localize(mesh, blendshape_node[, local_target_name, ...])

Creates a local rig by duplicating and using the duplicate as the blendshape target to the original mesh.

Module Contents

add_object_to_lattice(obj, lattice_deformer)

Add the object to the lattice deformer.

This function does not rely on deformer sets which makes the assignment possible where component tags are enabled in Maya versions 2022+

add_target_blendshape(blendshape_node, target_mesh, weight=1.0)
cluster(mesh)
connect_bs_targets(driver_attr, targets_dictionary, driver_range=None, force_new=False, front_of_chain=True, bs_node_name=None)

Creates or adds Blendshape target and connects them into the same controller attribute

Args:

driver_attr (String): driver attribute which controls. tooth_ctrl.gumRetract targets_dictionary (Dict): Dictionary for the targets.

Format: {<base>: <target_blendShape>} Example: {

“face_mesh”: “faceGumRetract”, “meniscus”: “meniscusGumRetract”,

}

driver_range (List): If defined, remaps the driver attribute. Example: [0, 100] force_new (Bool): If True, a new blendshape will be created for each mesh even though there are existing ones. front_of_chain: Created blendshapes will be added front of the chain. Default True bs_node_name: If a new blendshape node will be created it will take this name. If a blendshape node with this

name exists, it will use that one.

create_proximity_wrap(driver, driven, wrap_mode='surface', name='tr_proximityWrap', max_drivers=1, falloff_scale=0.01, smooth_influences=0, smooth_normals=0, soft_normalization=0, span_samples=1)
create_shrink_wrap(driver, driven, name=None, **kwargs)

Creates the Shrink Wrap deformer

Args:

driver: (String) Influence mesh object driven: (String) Deforming mesh object name: (String) Optional. If not provided ‘<object name>_shrinkWrap’ template will be used **kwargs: Attributes of shrink wrap deformer. Supported keys are:

projection (int) closestIfNoIntersection (bool) reverse (bool) bidirectional (bool) offset (float) targetInflation (float) axisReference (int) alongX, alongY, alongZ (bool) targetSmoothLevel (int) falloff (float) falloffIterations (int) shapePreservationEnable (bool) shapePreservationSteps (int) shapePreservationIterations (int) shapePreservationMethod (int) shapePreservationReprojection (int)

Refer to the shrink wrap node for details

Returns: (string) shrink wrap node

create_wrap(influence, surface, name=None, weight_threshold=0.0, max_distance=0.0, exclusive_bind=False, auto_weight_threshold=True, falloff_mode=0)
get_bs_index_by_name(bs_node, target_name)
get_deformers(mesh=None, names_only=False)

Collects defomers in a dictionary by type

Args:

names_only: If True, returns a flattened list with only deformer names mesh (str): Shape or transform node

Return:

dictionary: {<type>: [list of deformers]}

get_influencers(deformer)
get_pre_blendshapes(mesh)

Returns the blendshape node(s) before the skinCluster

localize(mesh, blendshape_node, local_target_name='LocalRig', group_name=None)

Creates a local rig by duplicating and using the duplicate as the blendshape target to the original mesh.

Arguments:

mesh {String} – Original mesh blendshape_node {String} – Name of the existing blendshape node on the original mesh. If this is a non-existing node, a new blendshape will be created with this name

Keyword Arguments:

local_target_name {String} – Name of the localized target. If non given, default duplicate name will be used. (default: {LocalRig})

Returns:

[String] – Name of the local target

log