ContextMenu
- class omni.kit.widget.layers.ContextMenu(usd_context)
Bases:
object
Context menu for the layers widget
Methods
__init__
(usd_context)Initializes the ContextMenu with a specific USD context.
add_menu
(menu_list)Add the menu to the end of the context menu.
Check if the selected item can be set as authoring target.
Check if the selected item can be deleted.
Check if selected tree view can edit root layer.
Check if selected layer item can edit sublayer.
Check if selected layer item's parent can edit sublayer.
Check if selected layer item can flatten sublayer.
Check if the selected layer item can be merged down.
Check if selected layer item can edit sublayer.
Check if selected layer can set as edit target.
clear_all_linked_prims
(objects)Clear all the linked prims from a specific layer item.
Deprecated.
copy_url
()Copy the selected item's url to clipboard.
Create anonymous sublayer for selected layer item.
create_sublayer
([anonymous])Create sublayer for selected layer item.
Navigate to selected layer's file if found it in content browser.
Faltten selected layer item.
Check any items selected.
Check if the selected item has not layers locked.
checks if prim has references
has_selections
(objects)If the usd context has selectetions.
Check if the selected stage has sublayers.
Insert sublayer into selected layer item.
Check if the selected layer item is anonymous layer.
Check if the selected item is authoring layer.
Check if the selected item is in auto authoring mode.
Check if the selected item is in spec linking mode or auto authoring mode.
Check if the selected item is edit layer item.
Check if the selected item is from session layer tree.
Unused.
Check if the selected layer item is muted and parent muted.
Check if the selected layer item is dirty.
Check if the selected item is layer item.
Check if the selected layer item is locked.
Deprecated.
Check if the selected layer item is not locked.
Check if the selected layer item is not locked by other.
Check if the selected layer item is muted or parent muted.
Check if the selected layer item is not locked.
Check if the selected layer item is writable.
Check if selected layer item is live session layer.
Check if selected layer item is live syncing layer.
Check if the selected item's type is material.
Check if the selected item is missing layer.
Check if the selected layer item is not anonymous layer.
Check if the selected item is not authoring layer.
Check if the selected item is not in spec linking mode and auto authoring mode.
Check if the selected item is not edit layer item.
Check if the selected item is not from session layer tree.
Check if selected layer item is not live syncing layer.
Check if selected layer item is not live session layer.
Check if the selected item is not missing layer.
Check if the selected item is not omniverse layer.
Check if the selected item is not reserved layer.
Check if the selected item is omniverse layer.
is_over_specifier
(objects)Check if the selected prim item's specifier is 'OVER_ONLY'.
Check if the selected item is prim spec item.
Check if the selected item is reserved layer.
Check if the selected item is in spec linking mode.
link_selected_prims
(objects)Link the selected prims to a specific layer item.
link_selected_prims_with_hierarchy
(objects)Link the selected prims to a specific layer item with hierarchy.
Merge selected layer items down to one.
move_prims
(objects)Move selected prim spec item.
Check any items selected.
on_mouse_event
(event)Handles mouse events and show context menu based on the event type.
Delete selected prim spec item.
checks if prims have references/payload and returns name
Reload selected layer item.
Remove selected layer item.
Save selected layer.
Save selected layer, it will open a file picker dialog to select save path.
Save selected layer, it will open a file picker dialog to select save path, and overwrite the exist layer file.
select_linked_prims
(objects)Select the linked prims from a specific layer item.
Set the selected layer as authoring layer.
Set the selected layer as default edit layer.
Toggle tree from a specific layer/prim item.
unlink_selected_prims
(objects)Unlink the selected prims to a specific layer item.
unlink_selected_prims_with_hierarchy
(objects)Unlink the selected prims to a specific layer item with hierarchy.
- __init__(usd_context)
Initializes the ContextMenu with a specific USD context.
- Parameters
usd_context (omni.usd.UsdContext) – The USD context to be associated with this context menu.
- static add_menu(menu_list)
Add the menu to the end of the context menu. Return the object that should be alive all the time. Once the returned object is destroyed, the added menu is destroyed as well.
- can_be_set_as_authoring_target()
Check if the selected item can be set as authoring target.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- can_delete_prim()
Check if the selected item can be deleted.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- can_edit_root_layer()
Check if selected tree view can edit root layer.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- can_edit_sublayer()
Check if selected layer item can edit sublayer.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- can_edit_sublayer_parent()
Check if selected layer item’s parent can edit sublayer.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- can_flatten_sublayers()
Check if selected layer item can flatten sublayer.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- can_merge_layer_down()
Check if the selected layer item can be merged down.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- can_not_edit_sublayer()
Check if selected layer item can edit sublayer.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- can_set_as_edit_target()
Check if selected layer can set as edit target.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- clear_all_linked_prims(objects)
Clear all the linked prims from a specific layer item.
- Parameters
objects (dict) – A dictionary containing selected item information.
- copy_layer_url()
Deprecated.
- copy_url()
Copy the selected item’s url to clipboard.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- create_anonymous_sublayer()
Create anonymous sublayer for selected layer item.
- Parameters
objects (dict) – A dictionary containing selected item information.
- create_sublayer(anonymous=False)
Create sublayer for selected layer item.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- find_in_browser()
Navigate to selected layer’s file if found it in content browser.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- flatten_sublayers()
Faltten selected layer item.
- Parameters
objects (dict) – A dictionary containing selected item information.
- has_any_items_selected()
Check any items selected.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
True if any item selected, otherwise False.
- Return type
bool
- has_no_layers_locked()
Check if the selected item has not layers locked.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- has_payload_or_reference()
checks if prim has references
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- has_selections(objects)
If the usd context has selectetions.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
True if any thing selected in usd context, otherwise False.
- Return type
bool
- has_sublayers()
Check if the selected stage has sublayers.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- insert_sublayer()
Insert sublayer into selected layer item.
- Parameters
objects (dict) – A dictionary containing selected item information.
- is_anonymous_layer()
Check if the selected layer item is anonymous layer.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_authoring_layer()
Check if the selected item is authoring layer.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_auto_authoring_mode()
Check if the selected item is in auto authoring mode.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_auto_authoring_or_spec_linking_mode()
Check if the selected item is in spec linking mode or auto authoring mode.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_edit_layer()
Check if the selected item is edit layer item.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_from_session_layer_tree()
Check if the selected item is from session layer tree.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_item_expaned()
Unused.
- is_layer_and_parent_unmuted()
Check if the selected layer item is muted and parent muted.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_layer_dirty()
Check if the selected layer item is dirty.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_layer_item()
Check if the selected item is layer item.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
True if selected item is layer item, otherwise True.
- Return type
bool
- is_layer_locked()
Check if the selected layer item is locked.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_layer_locked_by_other()
Deprecated.
- is_layer_not_locked()
Check if the selected layer item is not locked.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_layer_not_locked_by_other()
Check if the selected layer item is not locked by other.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_layer_or_parent_muted()
Check if the selected layer item is muted or parent muted.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_layer_read_only()
Check if the selected layer item is not locked.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_layer_writable()
Check if the selected layer item is writable.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_live_session_layer()
Check if selected layer item is live session layer.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_live_syncing_layer()
Check if selected layer item is live syncing layer.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_material()
Check if the selected item’s type is material.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_missing_layer()
Check if the selected item is missing layer.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_not_anonymous_layer()
Check if the selected layer item is not anonymous layer.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_not_authoring_layer()
Check if the selected item is not authoring layer.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_not_auto_authoring_and_spec_linking_mode()
Check if the selected item is not in spec linking mode and auto authoring mode.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_not_edit_layer()
Check if the selected item is not edit layer item.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_not_from_session_layer_tree()
Check if the selected item is not from session layer tree.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_not_live_layer()
Check if selected layer item is not live syncing layer.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_not_live_session_layer()
Check if selected layer item is not live session layer.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_not_missing_layer()
Check if the selected item is not missing layer.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_not_omni_layer()
Check if the selected item is not omniverse layer.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_not_reserved_layer()
Check if the selected item is not reserved layer.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_omni_layer()
Check if the selected item is omniverse layer.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_over_specifier(objects)
Check if the selected prim item’s specifier is ‘OVER_ONLY’.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_prim_spec_item()
Check if the selected item is prim spec item.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
True if selected item is prim spec item, otherwise True.
- Return type
bool
- is_reserved_layer()
Check if the selected item is reserved layer.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- is_spec_linking_mode()
Check if the selected item is in spec linking mode.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- link_selected_prims(objects)
Link the selected prims to a specific layer item.
- Parameters
objects (dict) – A dictionary containing selected item information.
- link_selected_prims_with_hierarchy(objects)
Link the selected prims to a specific layer item with hierarchy.
- Parameters
objects (dict) – A dictionary containing selected item information.
- merge_down_one()
Merge selected layer items down to one.
- Parameters
objects (dict) – A dictionary containing selected item information.
- move_prims(objects)
Move selected prim spec item.
- Parameters
objects (dict) – A dictionary containing selected item information.
- no_items_selected()
Check any items selected.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
False if any item selected, otherwise True.
- Return type
bool
- on_mouse_event(event)
Handles mouse events and show context menu based on the event type.
- Parameters
event – An event object containing details about the mouse event.
- Returns
None if the module is not found or if the event type is not ACTIVATE.
- prim_delete()
Delete selected prim spec item.
- Parameters
objects (dict) – A dictionary containing selected item information.
- refresh_reference_payload_name()
checks if prims have references/payload and returns name
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- reload_layer()
Reload selected layer item.
- Parameters
objects (dict) – A dictionary containing selected item information.
- remove_layer()
Remove selected layer item.
- Parameters
objects (dict) – A dictionary containing selected item information.
- save_layer()
Save selected layer.
- Parameters
objects (dict) – A dictionary containing selected item information.
- save_layer_as()
Save selected layer, it will open a file picker dialog to select save path.
- Parameters
objects (dict) – A dictionary containing selected item information.
- save_layer_as_and_replace()
Save selected layer, it will open a file picker dialog to select save path, and overwrite the exist layer file.
- Parameters
objects (dict) – A dictionary containing selected item information.
- select_linked_prims(objects)
Select the linked prims from a specific layer item.
- Parameters
objects (dict) – A dictionary containing selected item information.
- set_authoring_layer()
Set the selected layer as authoring layer.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- set_edit_layer()
Set the selected layer as default edit layer.
- Parameters
objects (dict) – A dictionary containing selected item information.
- Returns
bool
- show_open_close_tree()
Toggle tree from a specific layer/prim item.
- Parameters
objects (dict) – A dictionary containing selected item information.
- unlink_selected_prims(objects)
Unlink the selected prims to a specific layer item.
- Parameters
objects (dict) – A dictionary containing selected item information.
- unlink_selected_prims_with_hierarchy(objects)
Unlink the selected prims to a specific layer item with hierarchy.
- Parameters
objects (dict) – A dictionary containing selected item information.