trigger.library.functions

Attributes

LOG

Functions

align_and_aim(node, target_list, aim_target_list[, ...])

Aligns the position of the node to the target and rotation to the aimTarget object.

align_between(node, target_a, target_b[, position, ...])

Align the node between target A and target B

align_to(node, target[, position, rotation])

This is the fastest align method. May not work in all cases

align_to_alter(node1, node2[, mode, offset])

Aligns the first node to the second. Alternative method to alignTo

align_to_normal(node, normal_vector)

Aligns the object according to the given normal vector

colorize(node_list[, index, custom_color, shape])

Changes the wire color of the node to the index

create_offset_group(node, suffix[, freeze_transform])

Creates an Upper Group for the given object.

delete_intermediates(transform_node)

deletes the intermediate shapes under given transform node

delete_object(keyword[, force])

Deletes the object only if exists.

duplicate_clean(node[, name])

Duplicate a clean version of the given transform without any intermediate shapes.

get_closest_transform(node[, list_of_nodes])

Return the closest transform node from the given list of nodes.

get_distance(node1, node2)

Return the distance between two nodes.

get_meshes(node[, full_path])

Gets only the mesh transform nodes under a group

get_parent(node[, full_path])

Return the parent of the given node.

get_shapes(node[, full_path])

Return shapes of the given node.

is_group(node)

Check if the given node is a group node or not.

unique_list(seq)

Return an ordered unique list from the given list.

validate_group(group_name)

Check if the group exist, if not creates it.

Module Contents

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

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

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

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

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

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

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

delete_intermediates(transform_node)

deletes the intermediate shapes under given transform node

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

duplicate_clean(node, name=None)

Duplicate a clean version of the given transform without any intermediate shapes.

get_closest_transform(node, list_of_nodes=None)

Return the closest transform node from the given list of nodes.

get_distance(node1, node2)

Return the distance between two nodes.

get_meshes(node, full_path=False)

Gets only the mesh transform nodes under a group

get_parent(node, full_path=False)

Return the parent of the given node.

get_shapes(node, full_path=False)

Return shapes of the given node.

is_group(node)

Check if the given node is a group node or not.

unique_list(seq)

Return an ordered unique list from the given list.

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

LOG