maya.types.mesh

Mesh node type wrapper.

Classes

Mesh

Wrapper for mesh nodes.

Module Contents

class Mesh(node_name)

Bases: maya.core.shapenode.ShapeNode

Wrapper for mesh nodes.

classmethod create(cmd, **kwargs)

Create a mesh or polygon primitive.

Args:

cmd (str): The Maya command to create the mesh (e.g. ‘polySphere’). **kwargs: Additional keyword arguments to pass to the command.

get_vertex_colors(indices=None)

Get vertex colors.

Args:

indices (list[int], optional): List of vertex indices to retrieve colors for.

Returns:

OpenMaya.MColorArray or None: Vertex colors if they exist, else None.

set_vertex_colors(color, indices=None)

Set vertex color for vertices.

Args:
color (tuple or color.Color): RGB color values as a tuple of three floats (0.0 to 1.0)

or color.Color object.

indices (list[int], optional): List of vertex indices to set color for.

unlock_normals(soften=False)

Unlock the normals of the specified geometry.

Args:

soften (bool, optional): If true, Defaults to False.

vertices(space='world')

Return all vertex positions.

Args:
spacestr, optional

Coordinate space to return the vertices in. Accepted values: “world”, “object”, “transform”. Default is “world”.

Returns:
OpenMaya.MPointArray

Array of vertex positions in the requested space.

vertices_in_radius(point_coordinates, radius=0.2)

Return vertex indices within a radius from a point in space.

Args:

point (OpenMaya.MPoint): The center point to measure from. radius (float, optional): The radius distance. Defaults to 0.2.

Returns:

list: List of vertex indices within the radius.

valid_commands
valid_primitives