CreateMeshPrimWithDefaultXformCommand#

class omni.kit.primitive.mesh.CreateMeshPrimWithDefaultXformCommand(prim_type: str, **kwargs)#

Bases: Command

A command class to create mesh primitives with default transformations in a USD stage.

This command supports creating various types of mesh primitives such as Plane, Sphere, Cone, Cylinder, Disk, Torus, and Cube. It also handles setting up default transformations and attributes for the newly created mesh based on persistent settings and keyword arguments provided during initialization.

Methods

__init__(prim_type, **kwargs)

Creates primitive.

do()

Executes the command to create the mesh primitive.

undo()

Undoes the creation of the mesh primitive.

__init__(
prim_type: str,
**kwargs,
)#

Creates primitive.

Parameters:

prim_type (str) – It supports Plane/Sphere/Cone/Cylinder/Disk/Torus/Cube.

kwargs:

object_origin (Gf.Vec3f): Position of mesh center in stage units.

u_patches (int): The number of patches to tessellate U direction.

v_patches (int): The number of patches to tessellate V direction.

w_patches (int): The number of patches to tessellate W direction.

It only works for Cone/Cylinder/Cube.

half_scale (float): Half size of mesh in centimeters. Default is None, which means it’s controlled by settings.

u_verts_scale (int): Tessellation Level of U. It’s a multiplier of u_patches.

v_verts_scale (int): Tessellation Level of V. It’s a multiplier of v_patches.

w_verts_scale (int): Tessellation Level of W. It’s a multiplier of w_patches.

It only works for Cone/Cylinder/Cube. For Cone/Cylinder, it’s to tessellate the caps. For Cube, it’s to tessellate along z-axis.

above_ground (bool): It will offset the center of mesh above the ground plane if it’s True,

False otherwise. It’s False by default. This param only works when param object_origin is not given. Otherwise, it will be ignored.

do()#

Executes the command to create the mesh primitive.

undo()#

Undoes the creation of the mesh primitive.