vtool.maya_lib.geo

Class Summary

MeshTopologyCheck(mesh1[, mesh2])

Rivet(name)

Function Summary

get_object(name)

is_a_mesh(node)

Test whether the node is a mesh or has a shape that is a mesh.

is_a_surface(node)

Test whether the node is a surface or has a shape that is a surface.

is_a_curve(node)

Test whether the node is a curve or has a shape that is a curve.

is_mesh_compatible(mesh1, mesh2)

Check the two meshes to see if they have the same vert, edge and face count.

is_mesh_blend_compatible(mesh1, mesh2)

Check the two meshes to see if they have the same vert, edge and face count.

is_mesh_position_same(mesh1, mesh2[, ...])

Check the positions of the vertices on the two meshes to see if they have the same positions within the tolerance.

is_cv_count_same(source_curve, target_curve)

Check if the cv count is the shame

match_point_position(source_mesh, target_mesh)

Source and target must have the same topology.

match_cv_position(source_curve, target_curve)

Match cv positions.

rotate_shape(transform, x, y, z)

Looks at the shape node and finds components, then rotations using the x,y,z values

get_position_different(mesh1, mesh2[, tolerance])

Get a list of vertex indices that do not match.

get_position_assymetrical(mesh1[, ...])

find assymetrical points on a mesh.

get_thing_from_component(component[, ...])

Given a component, return the shape associated.

get_curve_from_cv(cv)

Given a single cv, get the corresponding curve

get_meshes_in_list(list_of_things)

Given a list of DG nodes, return any transform that has a mesh shape node.

get_curves_in_list(list_of_things)

Given a list of DG nodes, return any transform that has a curve shape node.

get_surfaces_in_list(list_of_things)

Given a list of DG nodes, return any transform that has a surface shape node.

get_selected_edges()

returns

Any edges in the selection list.

get_selected_meshes([selection])

returns

Any meshes in the selection list.

get_selected_curves([selection])

returns

Any curves in the selection list.

get_selected_surfaces([selection])

returns

Any surfaces in the selection list.

get_mesh_shape(mesh[, shape_index])

Get the first mesh shape, or one based in the index.

get_curve_shape(curve[, shape_index])

Get the shape for a curve transform

get_surface_shape(surface[, shape_index])

Get the shape for a surface transform

get_of_type_in_hierarchy(transform, node_type)

Get nodes of type in a hierarchy.

get_matching_geo(source_list, target_list[, ...])

Searches for matches to the source list.

get_vert_edge_face_count(mesh)

edge_to_vertex(edges)

Return the vertices that are part of the edges.

get_edges_in_list(list_of_things)

Given a list of name strings, return anything that is an edge

edge_to_mesh(edge)

This will find the mesh that corresponds to the edge

get_edge_path([edges])

Given a list of edges, return the edge path.

get_edge_names_from_indices(mesh, indices)

Given a list of edge indices and a mesh, this will return a list of edge names.

expand_selected_edge_loop()

Select edges and then expand the selection on the edge loop.

expand_edge_loop(mesh, edge_id)

Expands a edge loop.

multi_expand_loop(mesh, edges, expand_loops)

This will expand the loop multiple times.

edges_to_curve(edges[, description])

Given a list of edges create a curve.

get_mesh_from_edge(edge)

Given an edge name, find the corresponding mesh

get_border_edges(mesh[, edge_names])

is_a_vertex(node)

Checks if the node is a vertex

get_vertices(mesh)

Get the vertices of a mesh.

get_vertex_indices(list_of_vertex_names)

Given a list of vertex names (that are selectable using cmds.select) return the list of vert index numbers.

get_vertex_names_from_indices(mesh, indices)

Given a list of vertex indices and a mesh, this will return a list of vertex names.

get_mesh_from_vertex(vertex)

Given a vertex name return the corresponding mesh

get_vertex_shells(mesh)

Given a mesh that has multiple disconnected vertex islands, this will return the vertex islands format is [[vertex1,vertex2,vertex3],[vertex4,vertex5,vertex6]] This can be really useful in tandem with average_vertex_weights on things like buttons that have been combined into one mesh

get_faces(mesh)

Get the faces of a mesh.

get_face_indices(list_of_face_names)

Given a list of face names (that are selectable using cmds.select) return the list of face index numbers.

get_face_names_from_indices(mesh, indices)

Given a list of face indices and a mesh, this will return a list of face names.

get_face_vert_indices(mesh, face_id)

get the vertices in a face.

get_mesh_from_face(face)

Given a face name return the corresponding mesh

face_to_vertex(faces)

Gets the vertices in a list of faces can pass in a single face or a list of faces

get_triangles(mesh)

Get the triangles of a mesh.

get_non_triangle_non_quad(mesh)

Get faces that are neither quads or triangles.

get_face_center(mesh, face_id)

Get the center position of a face.

get_face_centers(mesh)

Returns: a list of face center positions.

faces_to_new_mesh(faces[, name])

Given a list of a faces, this will break off a duplicate of the faces.

get_render_stats(node_name)

Get the render stat values from a node

get_intersection_on_mesh(mesh, ...)

Given a ray vector with source and direction, find the closest intersection on a mesh.

get_closest_uv_on_mesh(mesh, three_value_list)

Find the closest uv on a mesh given a vector.

get_uv_on_mesh_at_curve_base(mesh, curve)

Looks for the closest uv on mesh at the base of the curve

get_closest_uv_on_mesh_at_curve(mesh, curve)

Looks at the curve and tries to find the closest uv on mesh where the curve intersects or has its nearest point

get_axis_intersect_on_mesh(mesh, transform)

This will find the closest intersection on a mesh by rotating incrementally on a rotate axis.

get_closest_parameter_on_curve(curve, ...)

Find the closest parameter value on the curve given a vector.

get_closest_parameter_on_surface(surface, vector)

Find the closest parameter value on the surface given a vector.

get_closest_position_on_surface_at_parameter(...)

Given a surface and a u and v parameter return a position

get_closest_position_on_surface(surface, vector)

Given a surface and a position (3 value list), return the a 3 value list that represents the closest position on the surface

get_closest_normal_on_surface(surface, vector)

Given a surface and a position (3 value list), return the a 3 value list that represents the closest normal on the surface Can be useful when orienting controls cvs or other things to a surface

get_closest_position_on_mesh(mesh, ...)

Get the closes position on a mesh from the given point.

get_closest_normal_on_mesh(mesh, ...)

Given a mesh and a position (3 value list), return the a 3 value list that represents the closest normal on the mesh Can be useful when orienting controls cvs or other things to a surface

get_closest_position_on_curve(curve, ...)

Given a vector, find the closest position on a curve.

get_parameter_from_curve_length(curve, ...)

Find the parameter value given the length section of a curve.

get_curve_length_from_parameter(curve, ...)

Given a parameter return the curve length to that parameter.

get_point_from_curve_parameter(curve, parameter)

Find a position on a curve by giving a parameter value.

get_curve_position_from_parameter(curve, ...)

Find a position on a curve by giving a parameter value.

get_point_from_surface_parameter(surface, ...)

Given a u and v value find the closest position on the surface.

get_occluded_faces(mesh[, within_distance, ...])

Find all the faces occluded by other faces.

get_vertex_normal(vert_name)

Get the position of a normal of a vertex.

get_y_intersection(curve, vector)

Given a vector in space, find out the closest intersection on the y axis to the curve.

check_render_stats_are_default(node_name)

check for nodes with non default render stats

set_default_render_stats(node_name)

check for nodes with non default render stats

set_render_stats_double_sided_default(node_name)

Set renders stats on a node to be double sided on and opposite off.

create_curve_from_mesh_border(mesh[, ...])

Create a curve from the border of a mesh.

create_curve_from_edge_loop(edge[, offset, name])

Create a curve from the border of a mesh.

create_two_transforms_curve(transform1, ...)

Create a curve between two transforms.

create_two_transforms_mesh_strip(transform1, ...)

Create a mesh between two transforms.

create_mesh_from_bounding_box(min_vector, ...)

Given a min and max vector create a mesh cube.

create_shape_from_shape(shape[, name])

Duplication in maya can get slow in reference files.

create_texture_reference_object(mesh)

Good for working with Yeti

create_joint_u_strip_on_surface(surface, ...)

Create joints that go along the u direction of a surface.

create_joint_v_strip_on_surface(surface, ...)

Create joints that go along the v direction of a surface.

create_locators_on_curve(curve, count, ...)

Create locators on curve that do not aim at child.

create_joints_on_curve(curve, joint_count, ...)

Create joints on curve that do not aim at child.

create_joints_on_cvs(curve[, parented])

Given a curve, create a joint at each cv.

create_joints_on_faces(mesh[, faces, ...])

Create joints on the given faces.

create_empty_follicle(description[, uv])

Create a follicle

create_mesh_follicle(mesh[, description, uv])

Create a follicle on a mesh

create_surface_follicle(surface[, ...])

Create a follicle on a surface

create_oriented_joints_on_curve(curve[, ...])

Create joints on curve that are oriented to aim at child.

transforms_to_nurb_surface(transforms[, ...])

Create a nurbs surface from a list of joints.

transforms_to_curve(transforms[, spans, ...])

Create a curve from a list of transforms.

transform_to_polygon_plane(transform[, ...])

Create a single polygon face from the position and orientation of a transform.

transforms_to_polygon(transforms, name[, ...])

Create polygons on each transform.

joints_to_meshes(joints[, radius_override, ...])

curve_to_nurb_surface(curve, description[, ...])

Given a curve, generate a nurbs surface

nurb_surface_u_to_transforms(surface[, ...])

nurb_surface_v_to_transforms(surface[, ...])

polygon_plane_to_curves(plane[, count, u, ...])

snap_to_mesh(transform, mesh[, face])

Snap a transform to the nearest position on the mesh.

attach_to_mesh(transform, mesh[, deform, ...])

Be default this will attach the center point of the transform (including hierarchy and shapes) to the mesh.

attach_to_curve(transform, curve[, ...])

Attach the transform to the curve using a point on curve.

attach_motion_path(curve[, name, u_value, ...])

attach_to_motion_path(transform, curve[, ...])

attach_to_surface(transform, surface[, u, ...])

Attach the transform to the surface using a rivet.

follicle_to_mesh(transform, mesh[, u, v, ...])

Use a follicle to attach the transform to the mesh.

follicle_to_surface(transform, surface[, u, ...])

Follicle the transform to a nurbs surface.

pin_to_mesh(transform, mesh[, ...])

pin_to_mesh_existing(existing_pin, ...[, u, v])

cvs_to_transforms(nurbs[, type])

Given a nurbs surface or a curve create a joint or transform at each one.

rebuild_curve(curve[, spans, degree])

Rebuild a curve with fewer arguments

rebuild_curve_at_distance(curve, min_length, ...)

Rebuild curves based on their length.

evenly_position_curve_cvs(curve[, match_curve])

Given a curve, evenly position the cvs along the curve.

snap_transforms_to_curve(transforms, curve)

Snap the transform to the nearest position on the curve.

snap_joints_to_curve(joints[, curve, count])

Snap the joints to a curve.

snap_curve_to_surface(curve, surface[, offset])

Snap curve cvs on a surface.

snap_project_curve_to_surface(curve, surface)

Project curve cvs on a surface

convert_indices_to_mesh_vertices(indices, mesh)

Convenience for converting mesh index numbers to maya names.

convert_indices_to_mesh_faces(indices, mesh)

Given a list of indices convert them to the names of faces.

add_poly_smooth(mesh[, divisions])

create a polySmooth node on the mesh.

smooth_preview(mesh[, bool_value])

Turn off and on smooth preview.

smooth_preview_all([bool_value])

Turn off and on smooth preview on every mesh.

randomize_mesh_vertices(mesh[, range_min, ...])

Randomize the positions of vertices on a mesh.

transfer_uvs_from_mesh_to_group(mesh, group)

currently only works with map1 uv set mesh and group need to have the same topology and point position.

create_extrude(curve, radius, taper, spans)

create_quill(curve, radius[, taper_tip, ...])

transfer_from_curve_to_curve(source_curve, ...)

transforms can be either transform nodes or vertices

move_cvs(curves, position[, pivot_at_center])

This will move the cvs together and maintain their offset and put them at a world position, not local

set_geo_color(geo_name[, rgb, flip_color])

Set the color of geo by setting its vetex colors

get_object(name)
class MeshTopologyCheck(mesh1, mesh2=None)
set_first_mesh(mesh)
set_second_mesh(mesh)
check_vert_count()
check_edge_count()
check_face_count()
check_vert_face_count()
check_vert_edge_face_count()
check_first_face_verts(face2_verts=None)
check_last_face_verts(face2_verts=None)
check_face_order()
class Rivet(name)
set_surface(surface, u, v)
set_create_joint(bool_value)
set_edges(edges)
set_percent_on(bool_value)
set_local(bool_value)
set_use_transform(bool_value)
set_mesh_in(mesh_out_attribute)
create()
is_a_mesh(node)

Test whether the node is a mesh or has a shape that is a mesh.

Parameters

node (str) – The name of a node.

Returns

bool

is_a_surface(node)

Test whether the node is a surface or has a shape that is a surface.

Parameters

node (str) – The name of a node.

Returns

bool

is_a_curve(node)

Test whether the node is a curve or has a shape that is a curve.

Parameters

node (str) – The name of a node.

Returns

bool

is_mesh_compatible(mesh1, mesh2)

Check the two meshes to see if they have the same vert, edge and face count. This also includes a check to see that the first and last face vertices are the same.

is_mesh_blend_compatible(mesh1, mesh2)

Check the two meshes to see if they have the same vert, edge and face count.

is_mesh_position_same(mesh1, mesh2, tolerance=1e-05, check_compatible=True)

Check the positions of the vertices on the two meshes to see if they have the same positions within the tolerance.

is_cv_count_same(source_curve, target_curve)

Check if the cv count is the shame

Parameters
  • source_curve (str) – The name of the source curve

  • target_curve (str) – The name of the target curve

Returns

bool

match_point_position(source_mesh, target_mesh)

Source and target must have the same topology.

match_cv_position(source_curve, target_curve)

Match cv positions.

Parameters
  • source_curve (str) –

  • target_curve (str) –

rotate_shape(transform, x, y, z)

Looks at the shape node and finds components, then rotations using the x,y,z values

get_position_different(mesh1, mesh2, tolerance=1e-05)

Get a list of vertex indices that do not match.

get_position_assymetrical(mesh1, mirror_axis='x', tolerance=1e-05)

find assymetrical points on a mesh.

mirros axis currently doesn’t work. Its always checking on x

get_thing_from_component(component, component_name='vtx')

Given a component, return the shape associated.

get_curve_from_cv(cv)

Given a single cv, get the corresponding curve

get_meshes_in_list(list_of_things)

Given a list of DG nodes, return any transform that has a mesh shape node.

get_curves_in_list(list_of_things)

Given a list of DG nodes, return any transform that has a curve shape node.

get_surfaces_in_list(list_of_things)

Given a list of DG nodes, return any transform that has a surface shape node.

get_selected_edges()
Returns

Any edges in the selection list.

Return type

list

get_selected_meshes(selection=[])
Returns

Any meshes in the selection list.

Return type

list

get_selected_curves(selection=[])
Returns

Any curves in the selection list.

Return type

list

get_selected_surfaces(selection=[])
Returns

Any surfaces in the selection list.

Return type

list

get_mesh_shape(mesh, shape_index=0)

Get the first mesh shape, or one based in the index.

Parameters
  • mesh (str) – The name of a mesh.

  • shape_index (int) – Usually zero, but can be given 1 or 2, etc up to the number of shapes - 1.

  • returned. (The shape at the index will be) –

Returns

The name of the shape. If no mesh shapes then returns None.

Return type

str

get_curve_shape(curve, shape_index=0)

Get the shape for a curve transform

Parameters
  • curve (str) – The name of a transform above nurbsCurve shapes

  • shape_index (int) – The index of the shape.

get_surface_shape(surface, shape_index=0)

Get the shape for a surface transform

Parameters
  • surface (str) – The name of a transform above nurbsSurface shapes

  • shape_index (int) – The index of the shape.

get_of_type_in_hierarchy(transform, node_type)

Get nodes of type in a hierarchy.

Parameters
  • transform (str) – The name of a transform.

  • node_type (str) – The node type to search for.

Returns

Nodes that match node_type in the hierarchy below transform. If a shape matches, the transform above the shape will be added.

Return type

list

get_matching_geo(source_list, target_list, strict=False)

Searches for matches to the source list. Only one geo can match each source. Checkes topology first, then naming. Returns a list with [[source, target],[source,target]]

For each geo in the source list, find all the geo in the target_list that matches Return a dictionary with key = source mesh value = list of matching meshes

strict means point position should also match.

get_vert_edge_face_count(mesh)
edge_to_vertex(edges)

Return the vertices that are part of the edges.

Parameters

edges (list) – A list of edges (by name). eg. [‘mesh_name.e[0]’]

Returns

The names of vertices on an edge. eg. [‘mesh_name.vtx[0]’]

Return type

list

get_edges_in_list(list_of_things)

Given a list of name strings, return anything that is an edge

edge_to_mesh(edge)

This will find the mesh that corresponds to the edge

get_edge_path(edges=[])

Given a list of edges, return the edge path.

Parameters

edges (list) – A list of edges (by name) along a path. eg. [‘node_name.e[0]’]

Returns

The names of edges in the edge path.

Return type

list

get_edge_names_from_indices(mesh, indices)

Given a list of edge indices and a mesh, this will return a list of edge names. The names are built in a way that cmds.select can select them.

expand_selected_edge_loop()

Select edges and then expand the selection on the edge loop.

expand_edge_loop(mesh, edge_id)

Expands a edge loop. Can be great for working with eyes and other circular geometry

multi_expand_loop(mesh, edges, expand_loops)

This will expand the loop multiple times. This is good for starting from a single edge and expanding it into a section of an edge loop. This is good when you want to simplify user input for finding a portion of an edge loop Good for areas with circular topology like eyes

edges_to_curve(edges, description=None)

Given a list of edges create a curve.

Parameters
  • edges (list) – List of edge names, eg [‘mesh_name.e[0]’]

  • description (str) – The description to give the new curve. Name = ‘curve_(description)’

Returns

The name of the curve.

Return type

str

get_mesh_from_edge(edge)

Given an edge name, find the corresponding mesh

get_border_edges(mesh, edge_names=False)
is_a_vertex(node)

Checks if the node is a vertex

get_vertices(mesh)

Get the vertices of a mesh.

Returns

list

get_vertex_indices(list_of_vertex_names)

Given a list of vertex names (that are selectable using cmds.select) return the list of vert index numbers. Useful when iterating quickly or working with api that takes an id instead of a name.

get_vertex_names_from_indices(mesh, indices)

Given a list of vertex indices and a mesh, this will return a list of vertex names. The names are built in a way that cmds.select can select them.

get_mesh_from_vertex(vertex)

Given a vertex name return the corresponding mesh

get_vertex_shells(mesh)

Given a mesh that has multiple disconnected vertex islands, this will return the vertex islands format is [[vertex1,vertex2,vertex3],[vertex4,vertex5,vertex6]] This can be really useful in tandem with average_vertex_weights on things like buttons that have been combined into one mesh

get_faces(mesh)

Get the faces of a mesh.

Returns

list

get_face_indices(list_of_face_names)

Given a list of face names (that are selectable using cmds.select) return the list of face index numbers. Useful when iterating quickly or working with api that takes an id instead of a name.

get_face_names_from_indices(mesh, indices)

Given a list of face indices and a mesh, this will return a list of face names. The names are built in a way that cmds.select can select them.

get_face_vert_indices(mesh, face_id)

get the vertices in a face. Good for comparing meshes without having to compare the whole mesh. face_id can be -1, -2, etc: if you need to get one of the last faces.

get_mesh_from_face(face)

Given a face name return the corresponding mesh

face_to_vertex(faces)

Gets the vertices in a list of faces can pass in a single face or a list of faces

get_triangles(mesh)

Get the triangles of a mesh.

Returns

list

get_non_triangle_non_quad(mesh)

Get faces that are neither quads or triangles.

Returns

list

get_face_center(mesh, face_id)

Get the center position of a face.

Parameters
  • mesh (str) – The name of a mesh.

  • face_id – The index of a face component.

Returns

eg [0,0,0] The vector of the center of the face.

Return type

list

get_face_centers(mesh)

Returns: a list of face center positions.

Parameters

mesh (str) – The name of a mesh.

Returns

A list of lists. eg. [[0,0,0],[0,0,0]] Each sub list is the face center vector.

Return type

list

faces_to_new_mesh(faces, name='new_mesh_from_faces')

Given a list of a faces, this will break off a duplicate of the faces. Usefull when copying weights onto simple geo before copying into back onto complex geo. Might also be useful for create controls from meshes sections Also for creating proxy meshes

get_render_stats(node_name)

Get the render stat values from a node

Args

node_name (str)

Returns

list

get_intersection_on_mesh(mesh, ray_source_vector, ray_direction_vector)

Given a ray vector with source and direction, find the closest intersection on a mesh.

Parameters
  • mesh (str) – The name of the mesh to intersect with.

  • ray_source_vector (list) – eg. [0,0,0], the source of the ray as a vector.

  • ray_directrion_vector (list) – eg [0,0,0], The end point of the ray that starts at ray_source_vector.

Returns

eg [0,0,0] the place where the ray intersects with the mesh.

Return type

list

get_closest_uv_on_mesh(mesh, three_value_list)

Find the closest uv on a mesh given a vector.

Parameters
  • mesh (str) – The name of the mesh with uvs.

  • three_value_list (list) – eg. [0,0,0], the position vector from which to find the closest uv.

Returns

The uv of that is closest to three_value_list

Return type

uv

get_uv_on_mesh_at_curve_base(mesh, curve)

Looks for the closest uv on mesh at the base of the curve

get_closest_uv_on_mesh_at_curve(mesh, curve, samples=50)

Looks at the curve and tries to find the closest uv on mesh where the curve intersects or has its nearest point

get_axis_intersect_on_mesh(mesh, transform, rotate_axis='Z', opposite_axis='X', accuracy=100, angle_range=180)

This will find the closest intersection on a mesh by rotating incrementally on a rotate axis.

Parameters
  • mesh (str) – The name of a mesh.

  • transform (str) – The name of a transform.

  • rotate_axis (str) – ‘X’, ‘Y’, ‘Z’ axis of the transform to rotate.

  • opposite_axis (str) – ‘X’, ‘Y’, ‘Z’ The axis of the transform to point at the mesh while rotating. Should not be the same axis as rotate axis.

  • accuracy (int) – The number of increments in the angle range.

  • angle_range (float) – How far to rotate along the rotate_axis.

Returns

eg. [0,0,0] The vector of the clostest intersection

Return type

list

get_closest_parameter_on_curve(curve, three_value_list)

Find the closest parameter value on the curve given a vector.

Parameters
  • curve (str) – The name of a curve.

  • three_value_list (list) – eg. [0,0,0] The vector from which to search for closest parameter

Returns

The closest parameter.

Return type

float

get_closest_parameter_on_surface(surface, vector)

Find the closest parameter value on the surface given a vector.

Parameters
  • surface (str) – The name of the surface.

  • vector (list) – eg [0,0,0] The position from which to check for closest parameter on surface.

Returns

[0,0] The parameter coordinates of the closest point on the surface.

Return type

list

get_closest_position_on_surface_at_parameter(surface, param_u, param_v)

Given a surface and a u and v parameter return a position

get_closest_position_on_surface(surface, vector)

Given a surface and a position (3 value list), return the a 3 value list that represents the closest position on the surface

get_closest_normal_on_surface(surface, vector)

Given a surface and a position (3 value list), return the a 3 value list that represents the closest normal on the surface Can be useful when orienting controls cvs or other things to a surface

get_closest_position_on_mesh(mesh, three_value_list)

Get the closes position on a mesh from the given point.

Parameters
  • mesh (str) – The name of a mesh.

  • three_value_list (list) – The position to search from.

Returns

The value list, the position on the mesh that’s closest.

Return type

list

get_closest_normal_on_mesh(mesh, three_value_list)

Given a mesh and a position (3 value list), return the a 3 value list that represents the closest normal on the mesh Can be useful when orienting controls cvs or other things to a surface

get_closest_position_on_curve(curve, three_value_list)

Given a vector, find the closest position on a curve.

Parameters
  • curve (str) – The name of a curve.

  • three_value_list (list) – eg [0,0,0] a vector find the closest position from.

Returns

eg [0,0,0] The closest position on the curve as vector.

Return type

list

get_parameter_from_curve_length(curve, length_value)

Find the parameter value given the length section of a curve.

Parameters
  • curve (str) – The name of a curve.

  • length_value (float) – The length along a curve.

Returns

The parameter value at the length.

Return type

float

get_curve_length_from_parameter(curve, parameter_value)

Given a parameter return the curve length to that parameter.

get_point_from_curve_parameter(curve, parameter)

Find a position on a curve by giving a parameter value.

Parameters
  • curve (str) – The name of a curve.

  • parameter (float) – The parameter value on a curve.

Returns

[0,0,0] the vector found at the parameter on the curve.

Return type

list

get_curve_position_from_parameter(curve, parameter)

Find a position on a curve by giving a parameter value.

Parameters
  • curve (str) – The name of a curve.

  • parameter (float) – The parameter value on a curve.

Returns

[0,0,0] the vector found at the parameter on the curve.

Return type

list

get_point_from_surface_parameter(surface, u_value, v_value)

Given a u and v value find the closest position on the surface.

get_occluded_faces(mesh, within_distance=1, skip_with_area_greater_than=- 1)

Find all the faces occluded by other faces. Good for finding internal geometry.

get_vertex_normal(vert_name)

Get the position of a normal of a vertex.

Parameters

vert_name (str) – The name of a vertex.

Returns

eg [0,0,0] The vector where the normal points.

Return type

list

get_y_intersection(curve, vector)

Given a vector in space, find out the closest intersection on the y axis to the curve. This is usefull for eye blink setups.

Parameters
  • curve (str) – The name of a curve that could represent the btm eyelid.

  • vector (vector list) – A list that looks like [0,0,0] that could represent a position on the top eyelid.

Returns

The parameter position on the curve.

Return type

float

check_render_stats_are_default(node_name)

check for nodes with non default render stats

Return type

list

set_default_render_stats(node_name)

check for nodes with non default render stats

Return type

list

set_render_stats_double_sided_default(node_name)

Set renders stats on a node to be double sided on and opposite off.

create_curve_from_mesh_border(mesh, offset=0.1, name=None)

Create a curve from the border of a mesh. Good for creating controls on feathers.

create_curve_from_edge_loop(edge, offset=0.1, name=None)

Create a curve from the border of a mesh. Good for creating controls on feathers.

create_two_transforms_curve(transform1, transform2, name='')

Create a curve between two transforms.

create_two_transforms_mesh_strip(transform1, transform2, offset_axis='X', u_spans=10, v_spans=3)

Create a mesh between two transforms. Not that useful.

create_mesh_from_bounding_box(min_vector, max_vector, name)

Given a min and max vector create a mesh cube.

create_shape_from_shape(shape, name='new_shape')

Duplication in maya can get slow in reference files. This will create a shape and match it to the given shape without using Maya’s duplicate command.

Parameters
  • shape (str) – The name of a shape to match to.

  • name (str) – The name of the new shape.

Returns

The name of the transform above the new shape.

create_texture_reference_object(mesh)

Good for working with Yeti

create_joint_u_strip_on_surface(surface, u_count, description, u_offset=0, attach=True)

Create joints that go along the u direction of a surface.

create_joint_v_strip_on_surface(surface, v_count, description, v_offset=0, attach=True)

Create joints that go along the v direction of a surface.

create_locators_on_curve(curve, count, description, attach=True)

Create locators on curve that do not aim at child.

Parameters
  • curve (str) – The name of a curve.

  • count (int) – The number of joints to create.

  • description (str) – The description to give the joints.

  • attach (bool) – Wether to attach the joints to the curve.

  • create_controls (bool) – Wether to create controls on the joints.

Returns

[ joints, group, control_group ] joints is a list of joinst, group is the main group for the joints, control_group is the main group above the controls. If create_controls = False then control_group = None

Return type

list

create_joints_on_curve(curve, joint_count, description, attach=True)

Create joints on curve that do not aim at child.

Parameters
  • curve (str) – The name of a curve.

  • joint_count (int) – The number of joints to create.

  • description (str) – The description to give the joints.

  • attach (bool) – Wether to attach the joints to the curve.

  • create_controls (bool) – Wether to create controls on the joints.

Returns

[ joints, group, control_group ] joints is a list of joinst, group is the main group for the joints, control_group is the main group above the controls. If create_controls = False then control_group = None

Return type

list

create_joints_on_cvs(curve, parented=True)

Given a curve, create a joint at each cv. Joints are parented under the last joint created at the previous cv.

create_joints_on_faces(mesh, faces=[], follow=True, name=None)

Create joints on the given faces.

Parameters
  • mesh (str) – The name of a mesh.

  • faces (list) – A list of face ids to create joints on.

  • follow (bool) – Wether the joints should follow.

  • name (str) – The name to applied to created nodes

Returns

Either the list of created joints, or if follow = True then [joints, follicles]

Return type

list

create_empty_follicle(description, uv=[0, 0])

Create a follicle

Parameters
  • description (str) – The description of the follicle.

  • uv (list) – eg. [0,0]

Returns

The name of the created follicle.

Return type

str

create_mesh_follicle(mesh, description=None, uv=[0, 0])

Create a follicle on a mesh

Parameters
  • mesh (str) – The name of the mesh to attach to.

  • description (str) – The description of the follicle.

  • uv (list) – eg. [0,0] This corresponds to the uvs of the mesh.

Returns

The name of the created follicle.

Return type

str

create_surface_follicle(surface, description=None, uv=[0, 0])

Create a follicle on a surface

Parameters
  • surface (str) – The name of the surface to attach to.

  • description (str) – The description of the follicle.

  • uv (list) – eg. [0,0] This corresponds to the uvs of the mesh.

Returns

The name of the created follicle.

Return type

str

create_oriented_joints_on_curve(curve, count=20, description=None, attach=False)

Create joints on curve that are oriented to aim at child.

Parameters
  • curve (str) – The name of a curve

  • count (int) – The number of joints.

  • description (str) – The description to give the joints.

  • rig (bool) – Wether to rig the joints to the curve.

Returns

The names of the joints created. If rig = True, than return [joints, ik_handle]

Return type

list

transforms_to_nurb_surface(transforms, description='from_transforms', spans=- 1, offset_axis='Y', offset_amount=1, bezier=False, keep_history=False)

Create a nurbs surface from a list of joints. Good for creating a nurbs surface that follows a spine or a tail.

Parameters
  • transforms (list) – List of transforms

  • description (str) – The description of the surface. Eg. ‘spine’, ‘tail’

  • spans (int) – The number of spans to give the final surface. If -1 the surface will have spans based on the number of transforms.

  • offset_axis (str) – The axis to offset the surface relative to the transform. Can be ‘X’,’Y’, or ‘Z’

  • offset_amount (int) – The amount the surface offsets from the transforms.

Returns

The name of the nurbs surface.

Return type

str

transforms_to_curve(transforms, spans=None, description='from_transforms')

Create a curve from a list of transforms. Good for create the curve for a spine joint chain or a tail joint chain.

Parameters
  • transforms (list) – A list of transforms to generate the curve from. Their positions will be used to place cvs.

  • spans (int) – The number of spans the final curve should have.

  • description (str) – The description to give the curve, eg. ‘spine’, ‘tail’

Returns

The name of the curve.

Return type

str

transform_to_polygon_plane(transform, size=1, axis='Y')

Create a single polygon face from the position and orientation of a transform.

Parameters
  • transform (str) – The name of the transform where the plane should be created.

  • size (float) – The size of the plane.

Returns

The name of the new plane.

Return type

str

transforms_to_polygon(transforms, name, size=1, merge=True, axis='Y')

Create polygons on each transform. The mesh is good to rivet to and then deform.

joints_to_meshes(joints, radius_override=None, subdivision_override=None)
curve_to_nurb_surface(curve, description, spans=- 1, offset_axis='X', offset_amount=1)

Given a curve, generate a nurbs surface

nurb_surface_u_to_transforms(surface, count=4, value=0.5, orient_example=None)
nurb_surface_v_to_transforms(surface, description='', count=4, value=0.5, orient_example=None)
polygon_plane_to_curves(plane, count=5, u=True, description='')
snap_to_mesh(transform, mesh, face=None)

Snap a transform to the nearest position on the mesh.

attach_to_mesh(transform, mesh, deform=False, priority=None, face=None, point_constrain=False, auto_parent=False, hide_shape=True, inherit_transform=False, local=False, rotate_pivot=False, constrain=True, mesh_in=None)

Be default this will attach the center point of the transform (including hierarchy and shapes) to the mesh. Important: If you need to attach to the rotate pivot of the transform make sure to set rotate_pivot = True This uses a rivet.

Parameters
  • transform (str) – The name of a transform.

  • mesh (str) – The name of a mesh.

  • deform (bool) – Wether to deform into position instead of transform. This will create a cluster.

  • priority (str) – The name of a transform to attach instead of transform. Good if you need to attach to something close to transform, but actually want to attach the parent instead.

  • face (int) – The index of a face on the mesh, to create the rivet on. Good if the algorithm doesn’t automatically attach to the best face.

  • point_constrain (bool) – Wether to attach with just a point constraint.

  • auto_parent (bool) – Wether to parent the rivet under the same parent as transform.

  • hide_shape (bool) – Wether to hide the shape of t he rivet locator. Good when parenting the rivet under a control.

  • inherit_transform (bool) – Wether to have the inheritTransform attribute of the rivet on.

  • local (bool) – Wether to constrain the transform to the rivet locally. Such that the rivet can be grouped and the group can move without affecting the transform.

  • rotate_pivot (bool) – Wether to find the closest face to the rotate pivot of the transform. If not it will search the center of the transform, including shapes.

  • constrain (bool) – Wether to parent the transform under the rivet.

Returns

The name of the rivet.

Return type

str

attach_to_curve(transform, curve, maintain_offset=False, parameter=None)

Attach the transform to the curve using a point on curve.

Parameters
  • transform (str) – The name of a transform.

  • curve (str) – The name of a curve

  • maintain_offset (bool) – Wether to attach to transform and maintain its offset from the curve.

  • parameter (float) – The parameter on the curve where the transform should attach.

Returns

The name of the pointOnCurveInfo

Return type

str

attach_motion_path(curve, name='motionPath', u_value=0, up_rotate_object=None, use_parameter=False, local=False)
attach_to_motion_path(transform, curve, up_rotate_object=None, constrain=True, local=False, use_parameter=False, u_value=None, direct=False, translate_only=False)
attach_to_surface(transform, surface, u=None, v=None, constrain=True)

Attach the transform to the surface using a rivet. If no u and v value are supplied, the command will try to find the closest position on the surface.

Parameters
  • transform (str) – The name of a transform.

  • surface (str) – The name of the surface to attach to.

  • u (float) – The u value to attach to.

  • v (float) – The v value to attach to.

Returns

The name of the rivet.

Return type

str

follicle_to_mesh(transform, mesh, u=None, v=None, constrain=True, constraint_type='parentConstraint', local=False)

Use a follicle to attach the transform to the mesh. If no u and v value are supplied, the command will try to find the closest position on the mesh.

Parameters
  • transform (str) – The name of a transform to follicle to the mesh.

  • mesh (str) – The name of a mesh to attach to.

  • u (float) – The u value to attach to.

  • v (float) – The v value to attach to.

Returns

The name of the follicle created.

Return type

str

follicle_to_surface(transform, surface, u=None, v=None, constrain=False)

Follicle the transform to a nurbs surface. If no u and v value are supplied, the command will try to find the closest position on the surface.

Parameters
  • transform (str) – The name of a transform to follicle to the surface.

  • mesh (str) – The name of a surface to attach to.

  • u (float) – The u value to attach to.

  • v (float) – The v value to attach to.

Returns

The name of the follicle created.

Return type

str

pin_to_mesh(transform, mesh, input_mesh_attribute=None, u=None, v=None, orig_mesh=None, name='')
pin_to_mesh_existing(existing_pin, transform, mesh, u=None, v=None)
cvs_to_transforms(nurbs, type='transform')

Given a nurbs surface or a curve create a joint or transform at each one. These will be unparented from each other

rebuild_curve(curve, spans=- 1, degree=3)

Rebuild a curve with fewer arguments

rebuild_curve_at_distance(curve, min_length, max_length, min_spans=3, max_spans=10)

Rebuild curves based on their length. Usefull when you have hundreds of curves and you want short curves to have less spans than long.

evenly_position_curve_cvs(curve, match_curve=None)

Given a curve, evenly position the cvs along the curve.

snap_transforms_to_curve(transforms, curve)

Snap the transform to the nearest position on the curve.

snap_joints_to_curve(joints, curve=None, count=10)

Snap the joints to a curve. If count is greater than the number of joints, than joints will be added along the curve.

Parameters
  • joints (list) – A list of joints to snap to the curve.

  • curve (str) – The name of a curve. If no curve given a simple curve will be created based on the joints. Helps to smooth out joint positions.

  • count (int) – The number of joints. if the joints list doesn’t have the same number of joints as count, then new joints are created.

snap_curve_to_surface(curve, surface, offset=1)

Snap curve cvs on a surface.

snap_project_curve_to_surface(curve, surface, offset=1)

Project curve cvs on a surface

convert_indices_to_mesh_vertices(indices, mesh)

Convenience for converting mesh index numbers to maya names. eg [mesh.vtx[0]] if index = [0] :param indices: A list of indices. :type indices: list :param mesh: The name of a mesh. :type mesh: str

Returns

A list of properly named vertices out of a list of indices.

Return type

list

convert_indices_to_mesh_faces(indices, mesh)

Given a list of indices convert them to the names of faces.

add_poly_smooth(mesh, divisions=1)

create a polySmooth node on the mesh.

Parameters

mesh (str) – The name of a mesh.

Returns

The name of the poly smooth node.

Return type

str

smooth_preview(mesh, bool_value=True)

Turn off and on smooth preview.

smooth_preview_all(bool_value=True)

Turn off and on smooth preview on every mesh.

randomize_mesh_vertices(mesh, range_min=0.0, range_max=0.1)

Randomize the positions of vertices on a mesh.

transfer_uvs_from_mesh_to_group(mesh, group)

currently only works with map1 uv set mesh and group need to have the same topology and point position. Also this deletes history

create_extrude(curve, radius, taper, spans, description='')
create_quill(curve, radius, taper_tip=True, spans=10, description='')
transfer_from_curve_to_curve(source_curve, destination_curve, transforms, reference_mesh_for_normal=None, twist=0)

transforms can be either transform nodes or vertices

move_cvs(curves, position, pivot_at_center=False)

This will move the cvs together and maintain their offset and put them at a world position, not local

set_geo_color(geo_name, rgb=[1, 0, 0], flip_color=False)

Set the color of geo by setting its vetex colors