trigger.library.functions ========================= .. py:module:: trigger.library.functions Attributes ---------- .. autoapisummary:: trigger.library.functions.LOG Functions --------- .. autoapisummary:: trigger.library.functions.align_and_aim trigger.library.functions.align_between trigger.library.functions.align_to trigger.library.functions.align_to_alter trigger.library.functions.align_to_normal trigger.library.functions.colorize trigger.library.functions.create_offset_group trigger.library.functions.delete_intermediates trigger.library.functions.delete_object trigger.library.functions.duplicate_clean trigger.library.functions.get_closest_transform trigger.library.functions.get_distance trigger.library.functions.get_meshes trigger.library.functions.get_parent trigger.library.functions.get_shapes trigger.library.functions.is_group trigger.library.functions.unique_list trigger.library.functions.validate_group Module Contents --------------- .. py:function:: align_and_aim(node, target_list, aim_target_list, up_object=None, up_vector=None, local_up=(0.0, 1.0, 0.0), rotate_offset=None, translate_offset=None, freeze_transforms=False) Aligns the position of the node to the target and rotation to the aimTarget object. Args: node: Node to be aligned target_list (List): Target nodes for positioning aim_target_list (List): Target nodes for aiming up_object (str): (Optional) if defined the up node will be up axis of this object up_vector (str): (Optional) if defined the up vector will be this vector local_up (tuple): (Optional) if defined the up vector will be this vector rotate_offset (tuple): (Optional) rotation offset with given value translate_offset (tuple): (Optional) translate offset with given value freeze_transforms (bool): (Optional) if set True, freezes transforms of the node at the end Returns: None .. py:function:: align_between(node, target_a, target_b, position=True, aim_b=True, orientation=False, offset=(0, 0, 0)) Align the node between target A and target B Args: node(String): Node to be aligned target_a(String): Target A target_b(String): Target B position(bool): If True, aligns the position between targets. Default True aim_b(bool): If True, node aims to the targetB orientation(bool): If true orients between target_a and target_b offset(tuple): orientation offset vector Returns: None .. py:function:: align_to(node, target, position=True, rotation=False) This is the fastest align method. May not work in all cases www.rihamtoulan.com/blog/2017/12/21/matching-transformation-in-maya-and-mfntransform-pitfalls Args: node: (String) Node to be aligned target: (String) Align target position: (Bool) Match world position. Default True rotation: (Bool) Match rotation. Defaults to False Returns: None .. py:function:: align_to_alter(node1, node2, mode=0, offset=(0, 0, 0)) Aligns the first node to the second. Alternative method to alignTo Args: node1: (String) Node to be aligned. node2: (String) Target Node. mode: (int) the alignment Mode. Valid Values: 0=position only, 1=Rotation Only, 2=Position and Rotation offset: (Tuple or List) Offset Value. Default: (0,0,0) Returns:None .. py:function:: align_to_normal(node, normal_vector) Aligns the object according to the given normal vector Args: node: The node to be aligned normal_vector: Alignment vector Returns: None .. py:function:: colorize(node_list, index=None, custom_color=None, shape=True) Changes the wire color of the node to the index Args: node_list (list): List of nodes to be processed index (int): Index Number custom_color (tuple): Custom color value shape (bool): If True, changes the shape color. Default is True Returns:None .. py:function:: create_offset_group(node, suffix, freeze_transform=True) Creates an Upper Group for the given object. Args: node: (String) Source Object suffix: (String) Suffix for the group. String. freeze_transform: (Boolean) Stands for "makeIdentity" If True, freezes the transformations of the new group. Defaults to True Returns: The created group node .. py:function:: delete_intermediates(transform_node) deletes the intermediate shapes under given transform node .. py:function:: delete_object(keyword, force=True) Deletes the object only if exists. Accepts wildcards. Args: keyword: (String) name of the object with or without wildcards force: (Bool) If True, the node will be deleted even if it's locked. Default True Returns: (List) Non - existing nodes .. py:function:: duplicate_clean(node, name=None) Duplicate a clean version of the given transform without any intermediate shapes. .. py:function:: get_closest_transform(node, list_of_nodes=None) Return the closest transform node from the given list of nodes. .. py:function:: get_distance(node1, node2) Return the distance between two nodes. .. py:function:: get_meshes(node, full_path=False) Gets only the mesh transform nodes under a group .. py:function:: get_parent(node, full_path=False) Return the parent of the given node. .. py:function:: get_shapes(node, full_path=False) Return shapes of the given node. .. py:function:: is_group(node) Check if the given node is a group node or not. .. py:function:: unique_list(seq) Return an ordered unique list from the given list. .. py:function:: validate_group(group_name) Check if the group exist, if not creates it. If there are any non-group object with that name, raises exception .. py:data:: LOG