vtool.maya_lib.geo¶
Class Summary
|
|
|
Function Summary
|
|
|
Test whether the node is a mesh or has a shape that is a mesh. |
|
Test whether the node is a surface or has a shape that is a surface. |
|
Test whether the node is a curve or has a shape that is a curve. |
|
Check the two meshes to see if they have the same vert, edge and face count. |
|
Check the two meshes to see if they have the same vert, edge and face count. |
|
Check the positions of the vertices on the two meshes to see if they have the same positions within the tolerance. |
|
Check if the cv count is the shame |
|
Source and target must have the same topology. |
|
Match cv positions. |
|
Looks at the shape node and finds components, then rotations using the x,y,z values |
|
Get a list of vertex indices that do not match. |
|
find asymmetrical points on a mesh. |
|
find asymmetrical points on a mesh. |
|
Hash a 3D point |
|
experimental mirroring using a dictionary |
|
Given a component, return the shape associated. |
Given a single cv, get the corresponding curve |
|
Extracts the numeric indices from a NURBS CV path like '|nurbsCylinder1.cv[7][2]'. |
|
|
Given a list of DG nodes, return any transform that has a mesh shape node. |
|
Given a list of DG nodes, return any transform that has a curve shape node. |
|
Given a list of DG nodes, return any transform that has a surface shape node. |
|
|
|
|
|
|
|
|
|
Get the first mesh shape, or one based in the index. |
|
Get the shape for a curve transform |
|
Get the shape for a surface transform |
|
Get nodes of type in a hierarchy. |
|
Searches for matches to the source list. |
|
|
|
Return the vertices that are part of the edges. |
|
Given a list of name strings, return anything that is an edge |
|
This will find the mesh that corresponds to the edge |
|
Given a list of edges, return the edge path. |
|
Given a list of edge indices and a mesh, this will return a list of edge names. |
Select edges and then expand the selection on the edge loop. |
|
|
Expands an edge loop. |
|
This will expand the loop multiple times. |
|
Given a list of edges create a curve. |
|
Given an edge name, find the corresponding mesh |
|
|
|
Checks if the node is a vertex |
|
|
|
Get the vertices of a mesh. |
|
Given a list of vertex names (that are selectable using cmds.select) return the list of vert index numbers. |
|
This get the vertex indices as a string and as they appear, no conversions, etc. |
|
Given a list of vertex indices and a mesh, this will return a list of vertex names. |
|
Given a vertex name return the corresponding 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 the faces of a mesh. |
|
Given a list of face names (that are selectable using cmds.select) return the list of face index numbers. |
|
Given a list of face indices and a mesh, this will return a list of face names. |
|
get the vertices in a face. |
|
Given a face name return the corresponding mesh |
|
Gets the vertices in a list of faces can pass in a single face or a list of faces |
|
Get the triangles of a mesh. |
Get faces that are neither quads nor triangles. |
|
|
Get the center position of a face. |
|
Returns: a list of face center positions. |
|
|
|
|
|
Given a list of a faces, this will break off a duplicate of the faces. |
|
|
|
Get the render stat values from a node |
|
Given a ray vector with source and direction, find the closest intersection on a mesh. |
|
Find the closest uv on a mesh given a vector. |
|
Looks for the closest uv on mesh at the base of the curve |
|
Looks at the curve and tries to find the closest uv on mesh where the curve intersects or has its nearest point |
|
This will find the closest intersection on a mesh by rotating incrementally on a rotate axis. |
|
Find the closest parameter value on the curve given a vector. |
|
Find the closest parameter value on the surface given a vector. |
Given a surface and an u and v parameter return a position |
|
|
Given a surface and a position (3 value list), return a 3 value list that represents the closest |
|
Given a surface and a position (3 value list), return a 3 value list that represents |
|
|
|
Get the closes position on a mesh from the given point. |
|
Given a mesh and a position (3 value list), return 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 |
|
Given a vector, find the closest position on a curve. |
|
Find the parameter value given the length section of a curve. |
|
Given a parameter return the curve length to that parameter. |
|
Find a position on a curve by giving a parameter value. |
|
Find a position on a curve by giving a parameter value. |
|
Given an u and v value find the closest position on the surface. |
|
Find all the faces occluded by other faces. |
|
Get the position of a normal of a vertex. |
|
Given a vector in space, find out the closest intersection on the y-axis to the curve. |
|
check for nodes with non default render stats |
|
check for nodes with non default render stats |
|
Set renders stats on a node to be double-sided on and opposite off. |
|
Create a curve from the border of a mesh. |
|
Create a curve from the border of a mesh. |
|
Create a curve between two transforms. |
|
Create a mesh between two transforms. |
|
Given a min and max vector create a mesh cube. |
|
Duplication in maya can get slow in reference files. |
Good for working with Yeti |
|
|
Create joints that go along the u direction of a surface. |
|
Create joints that go along the v direction of a surface. |
|
Create locators on curve that do not aim at child. |
|
Create joints on curve that do not aim at child. |
|
Given a curve, create a joint at each cv. |
|
Create joints on the given faces. |
|
Create a follicle |
|
Create a follicle on a mesh |
|
Create a follicle on a surface |
|
Create joints on curve that are oriented to aim at child. |
|
Given a mesh tube with at least one hole create a curve by walking the topology. |
|
Given a mesh tube with at least one hole create a joint chain by walking the topology. |
|
Create a nurbs surface from a list of joints. |
|
Create a curve from a list of transforms. |
|
Create a single polygon face from the position and orientation of a transform. |
|
Create polygons on each transform. |
|
|
|
Given a curve, generate a nurbs surface |
|
|
|
|
|
|
|
Snap a transform to the nearest position on the mesh. |
|
Be default this will attach the center point of the transform (including hierarchy and shapes) to the mesh. |
|
Attach the transform to the curve using a point on curve. |
|
|
|
|
|
Attach the transform to the surface using a rivet. |
|
Use a follicle to attach the transform to the mesh. |
|
Follicle the transform to a nurbs surface. |
|
|
|
|
|
Given a nurbs surface or a curve create a joint or transform at each one. |
|
Rebuild a curve with fewer arguments |
|
Rebuild curves based on their length. Useful when you have hundreds of curves, and you want short curves to |
|
Given a curve, evenly position the cvs along the curve. |
|
Snap the transform to the nearest position on the curve. |
|
Snap the joints to a curve. |
|
Snap curve cvs on a surface. |
|
Project curve cvs on a surface |
|
Convenience for converting mesh index numbers to maya names. |
|
Given a list of indices convert them to the names of faces. |
|
create a polySmooth node on the mesh. |
|
Turn off and on smooth preview. |
|
Turn off and on smooth preview on every mesh. |
|
Randomize the positions of vertices on a mesh. |
currently only works with map1 uv set mesh and group need to have the same topology and point position. |
|
|
|
|
|
|
transforms can be either transform nodes or vertices |
|
This will move the cvs together and maintain their offset and put them at a world position, not local |
|
Set the color of geo by setting its vertex colors |
|
This will unlock normals while trying to maintain history |
- 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, stop_on_first=True)¶
Get a list of vertex indices that do not match.
- is_symmetrical(mesh, mirror_axis='X', tolerance=1e-05)¶
find asymmetrical points on a mesh.
mirrors axis currently doesn’t work. It’s always checking on x
- get_position_assymetrical(mesh, mirror_axis='x', tolerance=1e-05)¶
find asymmetrical points on a mesh.
mirrors axis currently doesn’t work. It’s always checking on x
- spatial_hash(vector, precision)¶
Hash a 3D point
- find_asymmetrical_points(mesh_points, mirror_axis='X', tolerance=0.0001, return_index=False)¶
experimental mirroring using a dictionary
- 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
- extract_cv_indices(cv)¶
Extracts the numeric indices from a NURBS CV path like ‘|nurbsCylinder1.cv[7][2]’.
- Parameters
path (str) – The string path to the CV.
- Returns
The (u_index, v_index) if found, otherwise None.
- Return type
tuple[int, int] or None
- 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=None)¶
- Returns
Any meshes in the selection list.
- Return type
list
- get_selected_curves(selection=None)¶
- Returns
Any curves in the selection list.
- Return type
list
- get_selected_surfaces(selection=None)¶
- 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. Checks 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). e.g. [‘mesh_name.e[0]’]
- Returns
The names of vertices on an edge. e.g. [‘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=None)¶
Given a list of edges, return the edge path.
- Parameters
edges (list) – A list of edges (by name) along a path. e.g. [‘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 an 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
- is_a_cv(node)¶
- get_vertices(mesh)¶
Get the vertices of a mesh.
- Returns
list
- get_vertex_indices(list_of_vertex_names, flatten=True)¶
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_strip_vertex_indices(list_of_vertex_names)¶
This get the vertex indices as a string and as they appear, no conversions, etc. For example test.vtx[100:200] will be stripped to [100:200]
- 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 nor 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. e.g. [[0,0,0],[0,0,0]] Each sub list is the face center vector.
- Return type
list
- get_face_area(face_name)¶
- get_face_with_most_area(faces)¶
- 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. Useful 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
- fill_holes_get_faces(mesh)¶
- 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) – e.g. [0,0,0], the source of the ray as a vector.
ray_direction_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) – e.g. [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
e.g. [0,0,0] The vector of the closest 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) – e.g. [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 an u and v parameter return a position
- get_closest_position_on_surface(surface, vector)¶
- Given a surface and a position (3 value list), return 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 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_uv_on_surface(surface, point)¶
- 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 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 an 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 useful 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) – Whether to attach the joints to the curve.
- Returns
- [ joints, group, control_group ] joints is a list of joints, 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) – Whether to attach the joints to the curve.
- Returns
- [ joints, group, control_group ] joints is a list of joints, 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=None, 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) – Whether 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=None)¶
Create a follicle
- Parameters
description (str) – The description of the follicle.
uv (list) – e.g. [0,0]
- Returns
The name of the created follicle.
- Return type
str
- create_mesh_follicle(mesh, description=None, uv=None)¶
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) – e.g. [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=None)¶
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) – e.g. [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.
attach (bool) – TODO: Fill description.
- Returns
The names of the joints created. If rig = True, then return [joints, ik_handle]
- Return type
list
- create_curve_in_tube(mesh, description)¶
Given a mesh tube with at least one hole create a curve by walking the topology.
- create_joints_in_tube(mesh, description, joint_count=6)¶
Given a mesh tube with at least one hole create a joint chain by walking the topology.
- 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. E.g. ‘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.
bezier (bool) – TODO: Fill description.
keep_history (bool) – TODO: Fill description.
- 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, e.g. ‘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.
axis (str) – TODO: Fill description.
- 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) – Whether 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) – Whether to attach with just a point constraint.
auto_parent (bool) – Whether to parent the rivet under the same parent as transform.
hide_shape (bool) – Whether to hide the shape of the rivet locator. Good when parenting the rivet under a control.
inherit_transform (bool) – Whether to have the inheritTransform attribute of the rivet on.
local (bool) – Whether 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) – Whether 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) – Whether 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) – Whether 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.
constrain (bool) – TODO: Fill description.
- 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.
constrain (bool) – TODO: Fill description.
constraint_type (str) – TODO: Fill description.
local (bool) – TODO: Fill description.
- 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.
u (float) – The u value to attach to.
v (float) – The v value to attach to.
constrain (bool) – TODO: Fill description.
- 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, op_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. Useful when you have hundreds of curves, and you want short curves to
have fewer 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.
divisions (int) – TODO: Fill description.
- 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_combine_mesh_to_uncombine_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=None, flip_color=False)¶
Set the color of geo by setting its vertex colors
- unlock_normals(mesh_name)¶
This will unlock normals while trying to maintain history