trigger.library.deformers ========================= .. py:module:: trigger.library.deformers .. autoapi-nested-parse:: Collection of deformer related functions Attributes ---------- .. autoapisummary:: trigger.library.deformers.log Functions --------- .. autoapisummary:: trigger.library.deformers.add_object_to_lattice trigger.library.deformers.add_target_blendshape trigger.library.deformers.cluster trigger.library.deformers.connect_bs_targets trigger.library.deformers.create_proximity_wrap trigger.library.deformers.create_shrink_wrap trigger.library.deformers.create_wrap trigger.library.deformers.get_bs_index_by_name trigger.library.deformers.get_deformers trigger.library.deformers.get_influencers trigger.library.deformers.get_pre_blendshapes trigger.library.deformers.localize Module Contents --------------- .. py:function:: 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+ .. py:function:: add_target_blendshape(blendshape_node, target_mesh, weight=1.0) .. py:function:: cluster(mesh) .. py:function:: 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: {: } 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. .. py:function:: 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) .. py:function:: 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 '_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 .. py:function:: create_wrap(influence, surface, name=None, weight_threshold=0.0, max_distance=0.0, exclusive_bind=False, auto_weight_threshold=True, falloff_mode=0) .. py:function:: get_bs_index_by_name(bs_node, target_name) .. py:function:: 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: {: [list of deformers]} .. py:function:: get_influencers(deformer) .. py:function:: get_pre_blendshapes(mesh) Returns the blendshape node(s) before the skinCluster .. py:function:: 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 .. py:data:: log