CreateMenuExtension
- class omni.kit.menu.create.scripts.create.CreateMenuExtension
Bases:
IExt
A class designed to extend Omniverse Kit’s menu capabilities, specifically for creating various types of primitives.
This class manages the creation and organization of menu items related to creating different types of primitives, such as shapes, lights, audio sources, cameras, and more. It dynamically builds a ‘Create’ menu based on settings and available options, allowing users to quickly access tools for adding new elements into their scene. The class also handles custom actions for creating these items with specific attributes or settings.
Methods
__init__
()Initializes the CreateMenuExtension and sets the default menu priority for the 'Create' menu.
on_create_light
(light_type, attributes)Executes the command to create a light with the specified type and attributes.
on_create_prim
(prim_type, attributes[, ...])Executes the command to create a primitive with the specified type and attributes.
Executes the command to create a set of predefined primitives.
Called when the extension shuts down.
on_startup
(ext_id)Called when the extension starts up.
- __init__()
Initializes the CreateMenuExtension and sets the default menu priority for the ‘Create’ menu.
- static on_create_light(light_type, attributes)
Executes the command to create a light with the specified type and attributes.
- Parameters
light_type (str) – The type of the light to create.
attributes (dict) – The attributes to apply to the light.
- static on_create_prim(prim_type, attributes, use_settings: bool = False)
Executes the command to create a primitive with the specified type and attributes.
- Parameters
prim_type (str) – The type of the primitive to create.
attributes (dict) – The attributes to apply to the primitive.
use_settings (bool, optional) – Whether to use the settings for the primitive creation. Defaults to False.
- static on_create_prims()
Executes the command to create a set of predefined primitives.
- on_shutdown()
Called when the extension shuts down. Deregisters actions and removes the ‘Create’ menu items.
- on_startup(ext_id)
Called when the extension starts up. Registers actions and builds the create menu.
- Parameters
ext_id (str) – The ID of the extension that is starting up.