vtool.maya_lib.geo

Class Summary

MeshTopologyCheck(mesh1, mesh2)
Rivet(name)

Function Summary

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_position_same(mesh1, mesh2[, tolerance]) 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.
get_position_different(mesh1, mesh2[, tolerance]) Get a list of vertex indices that do not match.
get_position_assymetrical(mesh1[, …])
get_edges_in_list(list_of_things)
get_meshes_in_list(list_of_things)
get_curves_in_list(list_of_things)
get_surfaces_in_list(list_of_things)
get_selected_edges()
returns:Any edges in the selection list.
get_selected_meshes()
returns:Any meshes in the selection list.
get_selected_curves()
returns:Any curves in the selection list.
get_selected_surfaces()
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_edge_path([edges]) Given a list of edges, return the edge path.
get_vertices(mesh) Get the vertices of a mesh.
get_faces(mesh) Get the faces of a mesh.
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.
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_mesh(mesh, …) Get the closes position on a mesh from the given point.
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_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_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_joints_on_curve(*args, **kwargs) Create joints on curve that do not aim at child.
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(*args, **kwargs) 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.
expand_selected_edge_loop() Select edges and then expand the selection on the edge loop.
expand_edge_loop(mesh, edge_id)
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_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.
edges_to_curve(edges, description) Given a list of edges create a curve.
edge_to_vertex(edges) Return the vertices that are part of the edges.
rebuild_curve(curve, spans[, degree]) Rebuild a curve with fewer arguments
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(*args, **kwargs) 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) 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

Functions

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.

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

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) –
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)
get_edges_in_list(list_of_things)
get_meshes_in_list(list_of_things)
get_curves_in_list(list_of_things)
get_surfaces_in_list(list_of_things)
get_selected_edges()
Returns:Any edges in the selection list.
Return type:list
get_selected_meshes()
Returns:Any meshes in the selection list.
Return type:list
get_selected_curves()
Returns:Any curves in the selection list.
Return type:list
get_selected_surfaces()
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.
  • shape at the index will be returned. (The) –
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)

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]]

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_vertices(mesh)

Get the vertices of a mesh.

Returns
list
get_faces(mesh)

Get the faces of a mesh.

Returns:list
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
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_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_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_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

Returns:
Return type:list
set_default_render_stats(node_name)

check for nodes with non default render stats

Returns:
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_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_joints_on_curve(*args, **kwargs)

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_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(*args, **kwargs)

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)

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.

expand_selected_edge_loop()

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

expand_edge_loop(mesh, edge_id)
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)

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_to_motion_path(transform, curve, up_rotate_object=None, constrain=True, local=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=False, 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

edges_to_curve(edges, description)

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

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
rebuild_curve(curve, spans, degree=3)

Rebuild a curve with fewer arguments

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(*args, **kwargs)

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)

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