trigger.library.connection
connections / constrains / attachments / procedural movements
Attributes
Functions
|
Create a average weighted constraint between defined vertices. |
|
Make a mirrored connection between node1 and node2 along the mirrorAxis. |
|
Return the connections for the given node as a dictionary |
|
|
|
Return the UV coordinates of dest_node closest to the source_node. |
|
Get a tuple of u, v values for a point on a given mesh. |
|
|
|
Create a Matrix Constraint. |
|
|
|
Create a matrix blended switch between two locations. |
|
|
|
|
|
Module Contents
- average_constraint(target_mesh, vertex_list, source_object=None, offset_parent=False, force_follicle=False)
Create a average weighted constraint between defined vertices. Works version 2020+ ATTENTION: Follicles won’t follow face normals if the normals are locked Args:
target_mesh (str): Mesh object which holds the defined vertices vertex_list (List): List of Integer vertex IDs source_object (str): If not defined a locator
will be created instead
- offset_parent (bool): If True, the matrix output will be connected
to offset parent matrix of the source object, leaving the transform values available
- force_follicle (bool): If True, follicles will be used instead
of pin constraints.
- Returns:(String) source object. It will be the created locator
if none provided
- connect_mirror(node1, node2, mirror_axis='X')
Make a mirrored connection between node1 and node2 along the mirrorAxis. Args:
node1: Driver Node node2: Driven Node mirror_axis: Mirror axis for the driven node.
Returns: None
- connections(node, exclude_nodes=None, exclude_types=None, return_mode='all')
Return the connections for the given node as a dictionary result_dict = {
- “incoming”: [
- {
“plug_out”: “someNode.outputX”, “plug_in”: “node.inputX”
}
] “outgoing”: [
- {
“plug_out”: “node.outputX”, “plug_in”: “someOtherNode.inputZ
}
- Args:
node (str): Node to get connections exclude_nodes (List): nodes in this list will be excluded exclude_types (List): nodes types in this list will be excluded return_mode (str): modifies return value:
“all” : returns a dictionary with incoming and outgoing keys “incoming”: returns a list of dictionaries for incoming connections “outgoing”: returns a list of dictionaries for outgoing connections defaults to “all”
Returns: (Dictionary) or (List)
- create_follicle(name, surface, uv)
- get_closest_uv(source_node, dest_node)
Return the UV coordinates of dest_node closest to the source_node. Args:
source_node (str): source node to collect position dest_node (str): destination node which will collect
the uv coordinates from
- Returns:
tuple: (float, float) The U and V values.
- get_uv_at_point(position, dest_node)
Get a tuple of u, v values for a point on a given mesh.
- Args:
position (vector3): The world space position to get the uvs of. dest_node (str): The mesh with uvs.
- Returns:
tuple: (float, float) The U and V values.
- get_vertex_uv(mesh, vertex_id)
- matrixConstraint(drivers, driven, maintainOffset=True, prefix='', skipRotate=None, skipTranslate=None, skipScale=None, source_parent_cutoff=None, **short_arguments)
Create a Matrix Constraint. Args:
drivers (List) or (str): Parent Node(s) driven (str): Child Node maintainOffset (bool): Maintain offset.
If True, the existing distance between nodes will be preserved
prefix (str): Prefix for the nodes names which will be created skipRotate (str or list): Skip Rotations. Listed rotation values
will be skipped. “xyz” or [“x”, “y”, “z”]
- skipTranslate (str or list): Skip Translation. Listed translation values
will be skipped. “xyz” or [“x”, “y”, “z”]
- skipScale (str or list): Skip Scale. Listed scale values will be skipped.
“xyz” or [“x”, “y”, “z”]
- source_parent_cutoff (None or str): The transformation matrices above
this node won’t affect to the child.
Returns: (Tuple) mult_matrix, decompose_matrix, wtAddMatrix
- matrix_constrain_localised(inherit, no_inherit, destination, target_attrs='', force=True)
- matrix_switch(parent_a, parent_b, child, control_attribute, position=True, rotation=True, scale=False, source_parent_cutoff=None)
Create a matrix blended switch between two locations. Args:
parent_a (str): first parent node parent_b (str): second parent node child (str): child to be constrained control_attribute (str): switch control attribute.
e.g. masterCont.switch. If missing, will created
position (bool): If True, makes the positional switch. Defaults True rotation (bool): If True, makes the rotational switch. Defaults True scale (bool): If True, makes the scale switch. Default False source_parent_cutoff (str): Any transforms on this node and
above won’t affect the constraint
- Returns:
(str) name of the blend node
- pin_to_surface(node, surface, sr='', st='', ss='xyz')
- replace_connections(source_node, target_node, exclude_nodes=None, exclude_types=None, incoming=True, outgoing=True)
- uv_pin(mesh_transform, coordinates)
- LOG