CreateMeshPrimCommand#
- class omni.kit.primitive.mesh.CreateMeshPrimCommand(prim_type: str, **kwargs)#
Bases:
CreateMeshPrimWithDefaultXformCommandA command class for creating a mesh primitive in a USD stage with default transformations.
This class is a specialized command for generating various types of mesh primitives such as Plane, Sphere, Cone, etc., and applies a default transformation to them. It extends the CreateMeshPrimWithDefaultXformCommand class.
- Parameters:
prim_type (str) – The type of primitive mesh to create. Supported types include ‘Plane’, ‘Sphere’, ‘Cone’, ‘Cylinder’, ‘Disk’, ‘Torus’, ‘Cube’.
- Keyword Arguments:
object_origin (Gf.Vec3f) – The position of the mesh center in the stage units.
u_patches (int) – The number of patches for tessellating the U direction.
v_patches (int) – The number of patches for tessellating the V direction.
w_patches (int) – The number of patches for tessellating the W direction; only applies to ‘Cone’, ‘Cylinder’, and ‘Cube’.
half_scale (float) – Half the size of the mesh in centimeters; if None, it’s controlled by settings.
u_verts_scale (int) – Tessellation level multiplier for the U direction.
v_verts_scale (int) – Tessellation level multiplier for the V direction.
w_verts_scale (int) – Tessellation level multiplier for the W direction; for ‘Cone’ and ‘Cylinder’, it tessellates the caps, for ‘Cube’, it tessellates along the z-axis.
above_ground (bool) – If True, offsets the mesh center above the ground plane; applicable when ‘object_origin’ is not provided. Defaults to False.
context_name (str) – The name of the USD context. Defaults to an empty string.
prim_path (str) – The path where the new primitive will be created. If None, a default path is generated.
select_new_prim (bool) – Whether to select the new primitive after creation. Defaults to True.
prepend_default_prim (bool) – If True, prepends the default primitive name to the newly created prim path. Defaults to True.
Methods
__init__(prim_type, **kwargs)Initializes the command to create a mesh primitive.
- __init__(prim_type: str, **kwargs)#
Initializes the command to create a mesh primitive.