file_path
stringlengths
5
148
content
stringlengths
150
498k
size
int64
150
498k
omni.ui.WidgetMouseDropEvent.md
# WidgetMouseDropEvent ## WidgetMouseDropEvent Bases: `pybind11_object` Holds the data which is sent when a drag and drop action is completed. ### Methods | Method | Description | |--------|-------------| | `__init__(*args, **kwargs)` | | ### Attributes | Attribute | Description | |-----------|-------------| | `mime_data` | The data that was dropped on the widget. | | `x` | Position where the drop was made. | | `y` | Position where the drop was made. | ### `__init__(*args, **kwargs)` ## Properties ### mime_data The data that was dropped on the widget. ### x Position where the drop was made. ### y Position where the drop was made.
649
omni.ui.Window.md
# Window The Window class represents a window in the underlying windowing system. This window is a child window of main Kit window. And it can be docked. Rasterization omni.ui generates vertices every frame to render UI elements. One of the features of the framework is the ability to bake a DrawList per window and reuse it if the content has not changed, which can significantly improve performance. However, in some cases, such as the Viewport window and Console window, it may not be possible to detect whether the window content has changed, leading to a frozen window. To address this problem, you can control the rasterization behavior by adjusting RasterPolicy. The RasterPolicy is an enumeration class that defines the rasterization behavior of a window. It has three possible values: - NEVER: Do not rasterize the widget at any time. - ON_DEMAND: Rasterize the widget as soon as possible and always use the rasterized version. The widget will only be updated when the user calls invalidateRaster. - AUTO: Automatically determine whether to rasterize the widget based on performance considerations. If necessary, the widget will be rasterized and updated when its content changes. To resolve the frozen window issue, you can manually set the RasterPolicy of the problematic window to Never. This will force the window to rasterize its content and use the rasterized version until the user explicitly calls invalidateRaster to request an update. ```python window = ui.Window("Test window", raster_policy=ui.RasterPolicy.NEVER) ``` ## Methods - `__init__(self, title, dockPreference, **kwargs)` - Construct the window, add it to the underlying windowing system, and makes it appear. - `call_key_pressed_fn(self, arg0, arg1, arg2)` - Sets the function that will be called when the user presses the keyboard key on the focused window. - `deferred_dock_in(self, target_window, ...)` - Deferred docking. - `destroy(self)` - Destroy the window. - **destroy** (self) - Removes all the callbacks and circular references. - **dock_in_window** (self, title, dockPosition[, ...]) - place the window in a specific docking position based on a target window name. - **get_window_callback** (self) - Returns window set draw callback pointer for the given UI window. - **has_key_pressed_fn** (self) - Sets the function that will be called when the user presses the keyboard key on the focused window. - **move_to_app_window** (self, arg0) - Moves the window to the specific OS window. - **move_to_main_os_window** (self) - Bring back the Window callback to the Main Window and destroy the Current OS Window. - **move_to_new_os_window** (self) - Move the Window Callback to a new OS Window. - **notify_app_window_change** (self, arg0) - Notifies the window that window set has changed. - **setPosition** (self, x, y) - This property set/get the position of the window in both axis calling the property. - **set_docked_changed_fn** (self, arg0) - Has true if this window is docked. - **set_focused_changed_fn** (self, arg0) - Read only property that is true when the window is focused. - **set_height_changed_fn** (self, arg0) - This property holds the window Height. - **set_key_pressed_fn** (self, fn) - Sets the function that will be called when the user presses the keyboard key on the focused window. - **set_position_x_changed_fn** (self, arg0) - This property set/get the position of the window in the X Axis. - **set_position_y_changed_fn** (self, arg0) - This property set/get the position of the window in the Y Axis. - **set_selected_in_dock_changed_fn** (self, arg0) - This property set/get the position of the window in the Y Axis. ### Methods | Description | | --- | | `set_selected_in_dock_changed_fn(self, arg0)` - Has true if this window is currently selected in the dock. | | `set_top_modal(self)` - Brings this window to the top level of modal windows. | | `set_visibility_changed_fn(self, arg0)` - This property holds whether the window is visible. | | `set_width_changed_fn(self, arg0)` - This property holds the window Width. | ### Attributes | Attribute | Description | | --- | --- | | `app_window` | | | `auto_resize` | setup the window to resize automatically based on its content | | `detachable` | If the window is able to be separated from the main application window. | | `docked` | Has true if this window is docked. | | `exclusive_keyboard` | When true, only the current window will receive keyboard events when it's focused. | | `flags` | This property set the Flags for the Window. | | `focus_policy` | How the Window gains focus. | | `focused` | Read only property that is true when the window is focused. | | `frame` | The main layout of this window. | | `height` | This property holds the window Height. | | `menu_bar` | | | `noTabBar` | setup the visibility of the TabBar Handle, this is the small triangle at the corner of the view If it is not shown then it is not possible to undock that window and it need to be closed/moved programatically | | Property | Description | |----------|-------------| | padding_x | This property set the padding to the frame on the X axis. | | padding_y | This property set the padding to the frame on the Y axis. | | position_x | This property set/get the position of the window in the X Axis. | | position_y | This property set/get the position of the window in the Y Axis. | | raster_policy | Determine how the content of the window should be rastered. | | selected_in_dock | Has true if this window is currently selected in the dock. | | tabBar_tooltip | This property sets the tooltip when hovering over window's tabbar. | | title | This property holds the window's title. | | visible | This property holds whether the window is visible. | | width | This property holds the window Width. | ### omni.ui.Window.__init__ ```python __init__(self: omni.ui._ui.Window, title: str, dockPreference: omni.ui._ui.DockPreference = <DockPreference.DISABLED: 0>, **kwargs) -> None ``` Construct the window, add it to the underlying windowing system, and makes it appear. #### Arguments: - `title :` The window title. It’s also used as an internal window ID. - `dockPreference :` In the old Kit determines where the window should be docked. In Kit Next it’s unused. - `kwargs` See below #### Keyword Arguments: - `flags` This property set the Flags for the Window. - `visible` This property holds whether the window is visible. ``` <dl> <dt>title <dd> <p>This property holds the window’s title. <dt>padding_x <dd> <p>This property set the padding to the frame on the X axis. <dt>padding_y <dd> <p>This property set the padding to the frame on the Y axis. <dt>width <dd> <p>This property holds the window Width. <dt>height <dd> <p>This property holds the window Height. <dt>position_x <dd> <p>This property set/get the position of the window in the X Axis. The default is kWindowFloatInvalid because we send the window position to the underlying system only if the position is explicitly set by the user. Otherwise the underlying system decides the position. <dt>position_y <dd> <p>This property set/get the position of the window in the Y Axis. The default is kWindowFloatInvalid because we send the window position to the underlying system only if the position is explicitly set by the user. Otherwise the underlying system decides the position. <dt>auto_resize <dd> <p>setup the window to resize automatically based on its content <dt>noTabBar <dd> <p>setup the visibility of the TabBar Handle, this is the small triangle at the corner of the view If it is not shown then it is not possible to undock that window and it need to be closed/moved programatically <dt>tabBarTooltip <dd> <p>This property sets the tooltip when hovering over window’s tabbar. <dt>raster_policy <dd> <p>Determine how the content of the window should be rastered. <dt>width_changed_fn <dd> <p>This property holds the window Width. <dt>height_changed_fn <dd> <p>This property holds the window Height. <dt>visibility_changed_fn <dd> <p>This property holds whether the window is visible. <dl class="py method"> <dt>call_key_pressed_fn <dd> <p>Sets the function that will be called when the user presses the keyboard key on the focused window. <dl class="py method"> <dt>deferred_dock_in <dd> <p>TODO: Add description for deferred_dock_in method. ## omni.ui.Window.deferred_dock_in Deferred docking. We need it when we want to dock windows before they were actually created. It’s helpful when extension initialization, before any window is created. ### Arguments: - `targetWindowTitle :` Dock to window with this title when it appears. - `activeWindow :` Make target or this window active when docked. ## omni.ui.Window.destroy Removes all the callbacks and circular references. ## omni.ui.Window.dock_in_window place the window in a specific docking position based on a target window name. We will find the target window dock node and insert this window in it, either by spliting on ratio or on top if the window is not found false is return, otherwise true ### Arguments: - `self : omni.ui._ui.Window` - `title : str` - `dockPosition : omni.ui._ui.DockPosition` - `ratio : float = 0.5` ## omni.ui.Window.get_window_callback Returns window set draw callback pointer for the given UI window. ## omni.ui.Window.has_key_pressed_fn Returns whether there is a key pressed function set for the window. ### Sets the function that will be called when the user presses the keyboard key on the focused window. ### move_to_app_window ```python move_to_app_window(self: omni.ui._ui.Window, arg0: omni::kit::IAppWindow) -> None ``` Moves the window to the specific OS window. ### move_to_main_os_window ```python move_to_main_os_window(self: omni.ui._ui.Window) -> None ``` Bring back the Window callback to the Main Window and destroy the Current OS Window. ### move_to_new_os_window ```python move_to_new_os_window(self: omni.ui._ui.Window) -> None ``` Move the Window Callback to a new OS Window. ### notify_app_window_change ```python notify_app_window_change(self: omni.ui._ui.Window, arg0: omni::kit::IAppWindow) -> None ``` Notifies the window that window set has changed. ### setPosition ```python setPosition(self: omni.ui._ui.Window, x: float, y: float) -> None ``` This property set/get the position of the window in both axis calling the property. ### set_docked_changed_fn ```python set_docked_changed_fn(self: omni.ui._ui.Window) -> None ``` ### set_docked_changed_fn ```python set_docked_changed_fn(self: omni.ui._ui.Window, arg0: Callable[[bool], None]) -> None ``` - Has true if this window is docked. False otherwise. It’s a read-only property. ### set_focused_changed_fn ```python set_focused_changed_fn(self: omni.ui._ui.Window, arg0: Callable[[bool], None]) -> None ``` - Read only property that is true when the window is focused. ### set_height_changed_fn ```python set_height_changed_fn(self: omni.ui._ui.Window, arg0: Callable[[float], None]) -> None ``` - This property holds the window Height. ### set_key_pressed_fn ```python set_key_pressed_fn(self: omni.ui._ui.Window, fn: Callable[[int, int, int], None]) -> None ``` - Sets the function to be called when a key is pressed. ### omni.ui.Window.set_key_pressed_fn Sets the function that will be called when the user presses the keyboard key on the focused window. ### omni.ui.Window.set_position_x_changed_fn This property set/get the position of the window in the X Axis. The default is kWindowFloatInvalid because we send the window position to the underlying system only if the position is explicitly set by the user. Otherwise the underlying system decides the position. ### omni.ui.Window.set_position_y_changed_fn This property set/get the position of the window in the Y Axis. The default is kWindowFloatInvalid because we send the window position to the underlying system only if the position is explicitly set by the user. Otherwise the underlying system decides the position. ### omni.ui.Window.set_selected_in_dock_changed_fn <em class="sig-param"> <span class="n"> <span class="pre"> arg0 <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> Callable <span class="p"> <span class="pre"> [ <span class="p"> <span class="pre"> [ <span class="pre"> bool <span class="p"> <span class="pre"> ] <span class="p"> <span class="pre"> , <span class="w"> <span class="pre"> None <span class="p"> <span class="pre"> ] <span class="sig-paren"> ) <span class="sig-return"> <span class="sig-return-icon"> → <span class="sig-return-typehint"> <span class="pre"> None <dd> <p> Has true if this window is currently selected in the dock. False otherwise. It’s a read-only property. <dl class="py method"> <dt class="sig sig-object py" id="omni.ui.Window.set_top_modal"> <span class="sig-name descname"> <span class="pre"> set_top_modal <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> self <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> omni.ui._ui.Window <span class="sig-paren"> ) <span class="sig-return"> <span class="sig-return-icon"> → <span class="sig-return-typehint"> <span class="pre"> None <dd> <p> Brings this window to the top level of modal windows. <dl class="py method"> <dt class="sig sig-object py" id="omni.ui.Window.set_visibility_changed_fn"> <span class="sig-name descname"> <span class="pre"> set_visibility_changed_fn <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> self <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> omni.ui._ui.Window , <em class="sig-param"> <span class="n"> <span class="pre"> arg0 <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> Callable <span class="p"> <span class="pre"> [ <span class="p"> <span class="pre"> [ <span class="pre"> bool <span class="p"> <span class="pre"> ] <span class="p"> <span class="pre"> , <span class="w"> <span class="pre"> None <span class="p"> <span class="pre"> ] <span class="sig-paren"> ) <span class="sig-return"> <span class="sig-return-icon"> → <span class="sig-return-typehint"> <span class="pre"> None <dd> <p> This property holds whether the window is visible. <dl class="py method"> <dt class="sig sig-object py" id="omni.ui.Window.set_width_changed_fn"> <span class="sig-name descname"> <span class="pre"> set_width_changed_fn <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> self <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> omni.ui._ui.Window , <em class="sig-param"> <span class="n"> <span class="pre"> arg0 <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> Callable <span class="p"> <span class="pre"> [ <span class="p"> <span class="pre"> [ <span class="pre"> float <span class="p"> <span class="pre"> ] <span class="p"> <span class="pre"> , <span class="w"> <span class="pre"> None <span class="p"> <span class="pre"> ] <span class="sig-paren"> ) <span class="sig-return"> <span class="sig-return-icon"> → <span class="sig-return-typehint"> <span class="pre"> None <dd> <p> This property holds the window Width. - **property auto_resize** - setup the window to resize automatically based on its content - **property detachable** - If the window is able to be separated from the main application window. - **property docked** - Has true if this window is docked. False otherwise. It’s a read-only property. - **property exclusive_keyboard** - When true, only the current window will receive keyboard events when it’s focused. It’s useful to override the global key bindings. - **property flags** - This property set the Flags for the Window. - **property focus_policy** - How the Window gains focus. - **property focused** - Read only property that is true when the window is focused. - **property frame** - The main layout of this window. - **property height** - This property holds the window Height. - **property noTabBar** - setup the visibility of the TabBar Handle, this is the small triangle at the corner of the view If it is not shown then it is not possible to undock that window and it need to be closed/moved programatically - **property padding_x** - This property set the padding to the frame on the X axis. - **property padding_y** - This property set the padding to the frame on the Y axis. - **property position_x** - This property set/get the position of the window in the X Axis. The default is kWindowFloatInvalid because we send the window position to the underlying system only if the position is explicitly set by the user. Otherwise the underlying system decides the position. ### position_y This property set/get the position of the window in the Y Axis. The default is kWindowFloatInvalid because we send the window position to the underlying system only if the position is explicitly set by the user. Otherwise the underlying system decides the position. ### raster_policy Determine how the content of the window should be rastered. ### selected_in_dock Has true if this window is currently selected in the dock. False otherwise. It’s a read-only property. ### tabBar_tooltip This property sets the tooltip when hovering over window’s tabbar. ### title This property holds the window’s title. ### visible This property holds whether the window is visible. ### width This property holds the window Width.
19,802
omni.ui.WindowHandle.md
# WindowHandle ## WindowHandle WindowHandle is a handle object to control any of the windows in Kit. It can be created any time, and if it’s destroyed, the source window doesn’t disappear. ### Methods | Method | Description | |--------|-------------| | `__init__(*args, **kwargs)` | | | `dock_in(self, window, dock_position[, ratio])` | Dock the window to the existing window. | | `focus(self)` | Brings the window to the top. | | `is_selected_in_dock(self)` | Return true is the window is the current window in the docking area. | | `notify_app_window_change(self, arg0)` | Notifies the UI window that the AppWindow it attached to has changed. | | `undock(self)` | Undock the window and make it floating. | ## Attributes - `dock_id`: Returns ID of the dock node this window is docked to. - `dock_order`: The position of the window in the dock. - `dock_tab_bar_enabled`: Checks if the current docking space is disabled. - `dock_tab_bar_visible`: Checks if the current docking space has the tab bar. - `docked`: True if this window is docked. - `height`: The height of the window in points. - `position_x`: The position of the window in points. - `position_y`: The position of the window in points. - `title`: The title of the window. - `visible`: Returns whether the window is visible. - `width`: The width of the window in points. ## Methods ### `__init__(*args, **kwargs)` ### `dock_in(self: omni.ui._ui.WindowHandle, window: omni.ui._ui.WindowHandle)` - **dock_in**(*dock_position*: `omni.ui._ui.DockPosition`, ratio: `float` = 0.5) -> `None` - Dock the window to the existing window. It can split the window to two parts or it can convert the window to a docking tab. - **focus**(self: `omni.ui._ui.WindowHandle`) -> `None` - Brings the window to the top. If it’s a docked window, it makes the window currently visible in the dock. - **is_selected_in_dock**(self: `omni.ui._ui.WindowHandle`) -> `bool` - Return true is the window is the current window in the docking area. - **notify_app_window_change**(self: `omni.ui._ui.WindowHandle`, arg0: `omni::kit::IAppWindow`) -> `None` - Notifies the UI window that the AppWindow it attached to has changed. - **undock**(self: `omni.ui._ui.WindowHandle`) -> `None` - Undock the window and make it floating. - **dock_id** - Returns ID of the dock node this window is docked to. <dl class="py property"> <dt class="sig sig-object py" id="omni.ui.WindowHandle.dock_order"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> dock_order <dd> <p> The position of the window in the dock. <dl class="py property"> <dt class="sig sig-object py" id="omni.ui.WindowHandle.dock_tab_bar_enabled"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> dock_tab_bar_enabled <dd> <p> Checks if the current docking space is disabled. The disabled docking tab bar can’t be shown by the user. <dl class="py property"> <dt class="sig sig-object py" id="omni.ui.WindowHandle.dock_tab_bar_visible"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> dock_tab_bar_visible <dd> <p> Checks if the current docking space has the tab bar. <dl class="py property"> <dt class="sig sig-object py" id="omni.ui.WindowHandle.docked"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> docked <dd> <p> True if this window is docked. False otherwise. <dl class="py property"> <dt class="sig sig-object py" id="omni.ui.WindowHandle.height"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> height <dd> <p> The height of the window in points. <dl class="py property"> <dt class="sig sig-object py" id="omni.ui.WindowHandle.position_x"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> position_x <dd> <p> The position of the window in points. <dl class="py property"> <dt class="sig sig-object py" id="omni.ui.WindowHandle.position_y"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> position_y <dd> <p> The position of the window in points. <dl class="py property"> <dt class="sig sig-object py" id="omni.ui.WindowHandle.title"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> title <dd> <p> The title of the window. <dl class="py property"> <dt class="sig sig-object py" id="omni.ui.WindowHandle.visible"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> visible <dd> <p> Returns whether the window is visible. <dl class="py property"> <dt class="sig sig-object py" id="omni.ui.WindowHandle.width"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> width <dd> <p> The width of the window in points.
6,115
omni.ui.Workspace.md
# Workspace ## omni.ui.Workspace Bases: `pybind11_object` Workspace object provides access to the windows in Kit. ### Methods - `__init__(*args, **kwargs)` - `clear()` - Undock all. - `compare_workspace([compare_delegate])` - Compare current docked windows according to the workspace description. - `dump_workspace()` - Capture current workspace and return the dict with the description of the docking state and window size. - `get_dock_children_id(dock_id)` - Get two dock children of the given dock ID. - `get_dock_id_height(dock_id)` - Returns the height of the docking node. - `get_dock_id_width(dock_id)` - Returns the width of the docking node. - `get_dock_position(dock_id)` - Returns the position of the given dock ID. - `get_docked_neighbours(member)` - Get all the windows that docked with the given widow. - `get_docked_windows(dock_id)` - Get all the windows of the given dock ID. - `get_dpi_scale()` - Returns current DPI Scale. - `get_main_window_height()` - Get the height in points of the current main window. - `get_main_window_width()` - Get the width in points of the current main window. - `get_parent_dock_id(dock_id)` - Return the parent Dock Node ID. - `get_selected_window_index(dock_id)` - Get currently selected window index from the given dock id. - `get_window(title)` - Find Window by name. - `get_window_from_callback(callback)` - Find Window by window callback. - `get_windows()` - Returns the list of windows ordered from back to front. - `remove_window_visibility_changed_callback(fn)` - Remove the callback that is triggered when window's visibility changed. - `restore_workspace([keep_windows_open])` - Dock the windows according to the workspace description. - `set_dock_id_height(dock_id, height)` - Set the height of the dock node. - `set_dock_id_width(dock_id, width)` - Set the width of the dock node. | Method | Description | |--------|-------------| | `set_dock_id_width(dock_id, width)` | Set the width of the dock node. | | `set_show_window_fn(title, fn)` | Add the callback to create a window with the given title. | | `set_window_created_callback(fn)` | Add the callback that is triggered when a new window is created. | | `set_window_visibility_changed_callback(fn)` | Add the callback that is triggered when window's visibility changed. | | `show_window(title[, show])` | Makes the window visible or create the window with the callback provided with set_show_window_fn. | ### omni.ui.Workspace.__init__(*args, **kwargs) - Initializes the Workspace. ### omni.ui.Workspace.clear() - Undock all. ### omni.ui.Workspace.compare_workspace(compare_delegate: ~omni.ui.workspace_utils.CompareDelegate = <omni.ui.workspace_utils.CompareDelegate object>) - Compare current docked windows according to the workspace description. - ### Arguments - `workspace_dump List[Any]` - The dictionary with the description of the layout. It’s the dict received from `dump_workspace`. ### omni.ui.Workspace.dump_workspace() - Capture current workspace and return the dict with the description of the docking state and window size. ### omni.ui.Workspace.get_dock_children_id(dock_id: int)` - Returns the children IDs of a given dock ID. Get two dock children of the given dock ID. true if the given dock ID has children ### Arguments: > `dockId :` > the given dock ID > > `first :` > output. the first child dock ID > > `second :` > output. the second child dock ID Returns the height of the docking node. It’s different from the window height because it considers dock tab bar. ### Arguments: > `dockId :` > the given dock ID Returns the width of the docking node. ### Arguments: > `dockId :` > the given dock ID Returns the position of the given dock ID. Left/Right/Top/Bottom. Get all the windows that docked with the given widow. ### get_docked_windows(dock_id: int) -> List[omni.ui._ui.WindowHandle] Get all the windows of the given dock ID. ### get_dpi_scale() -> float Returns current DPI Scale. ### get_main_window_height() -> float Get the height in points of the current main window. ### get_main_window_width() -> float Get the width in points of the current main window. ### get_parent_dock_id(dock_id: int) -> int Return the parent Dock Node ID. #### Arguments: - `dockId :` the child Dock Node ID to get parent ### get_selected_window_index(dock_id: int) -> int Get currently selected window index from the given dock id. ## omni.ui.Workspace.get_window **static** `get_window`(name: str) → omni.ui._ui.WindowHandle - Find Window by name. ## omni.ui.Workspace.get_window_from_callback **static** `get_window_from_callback`(callback: omni::ui::windowmanager::IWindowCallback) → omni.ui._ui.WindowHandle - Find Window by window callback. ## omni.ui.Workspace.get_windows **static** `get_windows`() → List[omni.ui._ui.WindowHandle] - Returns the list of windows ordered from back to front. If the window is a Omni::UI window, it can be upcasted. ## omni.ui.Workspace.remove_window_visibility_changed_callback **static** `remove_window_visibility_changed_callback`(fn: int) → None - Remove the callback that is triggered when window’s visibility changed. ## omni.ui.Workspace.restore_workspace `restore_workspace`(keep_windows_open = False) - Dock the windows according to the workspace description. ### Arguments - `workspace_dump` List[Any] - The dictionary with the description of the layout. It’s the dict received from `dump_workspace`. - `keep_windows_open` bool - Determines if it’s necessary to hide the already opened windows that are not present in `workspace_dump`. ## omni.ui.Workspace.set_dock_id_height **static** `set_dock_id_height`(dock_id: int, height: int) - Set the height of a specific dock ID. <dt> <em class="property"> <span class="pre"> static <span class="w"> <span class="sig-name descname"> <span class="pre"> set_dock_id_height <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> dock_id <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> int , <em class="sig-param"> <span class="n"> <span class="pre"> height <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> float <span class="sig-paren"> ) <span class="sig-return"> <span class="sig-return-icon"> → <span class="sig-return-typehint"> <span class="pre"> None <dd> <p> Set the height of the dock node. It also sets the height of parent nodes if necessary and modifies the height of siblings. <p> ### Arguments: <blockquote> <div> <dl class="simple"> <dt> `dockId :` <dd> <p> the given dock ID <dt> `height :` <dd> <p> the given height <dt> <em class="property"> <span class="pre"> static <span class="w"> <span class="sig-name descname"> <span class="pre"> set_dock_id_width <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> dock_id <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> int , <em class="sig-param"> <span class="n"> <span class="pre"> width <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> float <span class="sig-paren"> ) <span class="sig-return"> <span class="sig-return-icon"> → <span class="sig-return-typehint"> <span class="pre"> None <dd> <p> Set the width of the dock node. It also sets the width of parent nodes if necessary and modifies the width of siblings. <p> ### Arguments: <blockquote> <div> <dl class="simple"> <dt> `dockId :` <dd> <p> the given dock ID <dt> `width :` <dd> <p> the given width <dt> <em class="property"> <span class="pre"> static <span class="w"> <span class="sig-name descname"> <span class="pre"> set_show_window_fn <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> title <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> str , <em class="sig-param"> <span class="n"> <span class="pre"> fn <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> Callable <span class="p"> <span class="pre"> [ <span class="p"> <span class="pre"> [ <span class="pre"> bool <span class="p"> <span class="pre"> ] <span class="p"> <span class="pre"> , <span class="w"> <span class="pre"> None <span class="p"> <span class="pre"> ] <span class="sig-paren"> ) <span class="sig-return"> <span class="sig-return-icon"> → <span class="sig-return-typehint"> <span class="pre"> None <dd> <p> Add the callback to create a window with the given title. When the callback’s argument is true, it’s necessary to create the window. Otherwise remove. <dt> <em class="property"> <span class="pre"> static <span class="w"> <span class="sig-name descname"> <span class="pre"> set_window_created_callback <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> fn <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> Callable <span class="p"> <span class="pre"> [ <span class="p"> <span class="pre"> [ <span class="pre"> omni.ui._ui.WindowHandle <span class="p"> <span class="pre"> ] <span class="p"> <span class="pre"> , <span class="w"> <span class="pre"> None <span class="p"> <span class="pre"> ] <span class="sig-paren"> ) <span class="sig-return"> <span class="sig-return-icon"> → <span class="sig-return-typehint"> <span class="pre"> None <dl class="py method"> <dt class="sig sig-object py" id="omni.ui.Workspace.set_window_created_callback"> <em class="property"> <span class="pre"> static <span class="w"> <span class="sig-name descname"> <span class="pre"> set_window_created_callback <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> fn <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> Callable <span class="p"> <span class="pre"> [ <span class="p"> <span class="pre"> [ <span class="pre"> None <span class="p"> <span class="pre"> ] <span class="p"> <span class="pre"> , <span class="w"> <span class="pre"> None <span class="p"> <span class="pre"> ] <span class="sig-paren"> ) <span class="sig-return"> <span class="sig-return-icon"> → <span class="sig-return-typehint"> <span class="pre"> None <dd> <p> Add the callback that is triggered when a new window is created. <dl class="py method"> <dt class="sig sig-object py" id="omni.ui.Workspace.set_window_visibility_changed_callback"> <em class="property"> <span class="pre"> static <span class="w"> <span class="sig-name descname"> <span class="pre"> set_window_visibility_changed_callback <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> fn <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> Callable <span class="p"> <span class="pre"> [ <span class="p"> <span class="pre"> [ <span class="pre"> str <span class="p"> <span class="pre"> , <span class="w"> <span class="pre"> bool <span class="p"> <span class="pre"> ] <span class="p"> <span class="pre"> , <span class="w"> <span class="pre"> None <span class="p"> <span class="pre"> ] <span class="sig-paren"> ) <span class="sig-return"> <span class="sig-return-icon"> → <span class="sig-return-typehint"> <span class="pre"> int <dd> <p> Add the callback that is triggered when window’s visibility changed. <dl class="py method"> <dt class="sig sig-object py" id="omni.ui.Workspace.show_window"> <em class="property"> <span class="pre"> static <span class="w"> <span class="sig-name descname"> <span class="pre"> show_window <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> title <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> str , <em class="sig-param"> <span class="n"> <span class="pre"> show <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> bool <span class="w"> <span class="o"> <span class="pre"> = <span class="w"> <span class="default_value"> <span class="pre"> True <span class="sig-paren"> ) <span class="sig-return"> <span class="sig-return-icon"> → <span class="sig-return-typehint"> <span class="pre"> bool <dd> <p> Makes the window visible or create the window with the callback provided with set_show_window_fn. true if the window is already created, otherwise it’s necessary to wait one frame <p> ### Arguments: <blockquote> <div> <dl class="simple"> <dt> `title :` <dd> <p> the given window title <dt> `show :` <dd> <p> true to show, false to hide
15,787
omni.ui.workspace_utils.CompareDelegate.md
# CompareDelegate ## Methods - `__init__()` - `compare_dock_in_value_dock_id(key, value, target)` - `compare_dock_in_value_height(key, value, target)` - `compare_dock_in_value_position_x(key, value, ...)` - `compare_dock_in_value_position_y(key, value, ...)` - `compare_dock_in_value_width(key, value, target)` - `compare_value(key, value, target)` - `compare_window_value_dock_id(key, value, target)`
403
omni.ui.workspace_utils.compare_workspace.md
# compare_workspace ## compare_workspace ```python omni.ui.workspace_utils.compare_workspace( workspace_dump: typing.List[typing.Any], compare_delegate: omni.ui.workspace_utils.CompareDelegate = <omni.ui.workspace_utils.CompareDelegate object> ) ``` Compare current docked windows according to the workspace description. ### Arguments - `workspace_dump List[Any]` - The dictionary with the description of the layout. It’s the dict received from `dump_workspace`. ```
479
omni.ui.workspace_utils.Functions.md
# omni.ui.workspace_utils Functions ## Functions Summary: | Function Name | Description | |---------------|-------------| | `compare_workspace` | Compare current docked windows according to the workspace description. | | `dump_workspace` | Capture current workspace and return the dict with the description of the workspace. | | `handle_exception` | Decorator to print exception in async functions | | `restore_workspace` | Dock the windows according to the workspace description. |
484
omni.ui.workspace_utils.handle_exception.md
# handle_exception ## handle_exception ```python omni.ui.workspace_utils.handle_exception(func) ``` Decorator to print exception in async functions ```
153
omni.ui.workspace_utils.md
# omni.ui.workspace_utils ## Classes Summary - **CompareDelegate** ## Functions Summary - **compare_workspace** - Compare current docked windows according to the workspace description. - **dump_workspace** - Capture current workspace and return the dict with the description of the - **handle_exception** - Decorator to print exception in async functions - **restore_workspace** - Dock the windows according to the workspace description.
446
omni.ui.workspace_utils.restore_workspace.md
# restore_workspace  ## restore_workspace  ### Arguments #### `workspace_dump List[Any]` The dictionary with the description of the layout. It’s the dict received from `dump_workspace`. #### `keep_windows_open bool` Determines if it’s necessary to hide the already opened windows that are not present in `workspace_dump`.
323
omni.ui_api.md
# Omniverse Kit API ## Class Hierarchy - namespace omni - namespace ui - class WindowHandle - class Workspace - enum Alignment ## File Hierarchy - Directory omni - Directory ui - File Alignment.h - File WindowHandle.h - File Workspace.h ## Namespaces - omni - omni::kit - omni::ui - omni::ui::windowmanager ## Classes and Structs - omni::ui::WindowHandle ## Classes - **omni::ui::WindowHandle**: is a handle object to control any of the windows in Kit. - **omni::ui::Workspace**: object provides access to the windows in Kit. ## Enums - **omni::ui::Alignment**
597
omni.usd.attach_all_hydra_engines.md
# attach_all_hydra_engines ## attach_all_hydra_engines ```python omni.usd.attach_all_hydra_engines(context: omni.usd._usd.UsdContext) -> None ``` Attach all Hydra engines to the given context. ```
198
omni.usd.audio.AssetLoadStatus.md
# AssetLoadStatus ## Class Overview The `AssetLoadStatus` class is a part of the `omni.usd.audio` module and is based on `pybind11_object`. It defines the status of asset loading. ### Members - **IN_PROGRESS** - **DONE** - **FAILED** - **NOT_REGISTERED** ### Methods - **__init__(self, value)** ### Attributes - **DONE** - **FAILED** - **IN_PROGRESS** - **NOT_REGISTERED** - **name** - **value** __init__ ( self: omni.usd.audio._audio.AssetLoadStatus , value: int ) → None property name
499
omni.usd.audio.Classes.md
# omni.usd.audio Classes ## Classes Summary: | Class | Description | |-------|-------------| | [AssetLoadStatus](#) | Members: | | [EventType](#) | Members: | | [FeatureDefault](#) | Members: | | [IStageAudio](#) | This module contains bindings for the omni::usd::audio module. | | [SoundLengthType](#) | Members: | | [StreamListener](#) | |
344
omni.usd.audio.EventType.md
# EventType ## EventType ``` class omni.usd.audio.EventType ``` Bases: ``` pybind11_object ``` Members: - METADATA_CHANGE - LISTENER_LIST_CHANGE - ACTIVE_LISTENER_CHANGE ### Methods | Method | Description | |--------|-------------| | `__init__(self, value)` | | ### Attributes | Attribute | Description | |-----------|-------------| | `ACTIVE_LISTENER_CHANGE` | | | `LISTENER_LIST_CHANGE` | | | `METADATA_CHANGE` | | | `name` | | | `value` | | ``` omni.usd.audio._audio.EventType , value : int ) → None property name
531
omni.usd.audio.FeatureDefault.md
# FeatureDefault ## Members - ON - OFF - FORCE_ON - FORCE_OFF ## Methods | Method | Description | | --- | --- | | `__init__(self, value)` | | ## Attributes | Attribute | Description | | --- | --- | | `FORCE_OFF` | | | `FORCE_ON` | | | `OFF` | | | `ON` | | | `name` | | | `value` | | __init__(self: omni.usd.audio._audio.FeatureDefault, value: int) -> None property name
380
omni.usd.audio.Functions.md
# omni.usd.audio Functions ## Functions Summary - **get_stage_audio_interface** - helper method to retrieve a cached version of the IStageAudio interface. - **test_hydra_plugin** - test_hydra_plugin() -> bool
215
omni.usd.audio.get_stage_audio_interface.md
# get_stage_audio_interface ## get_stage_audio_interface ```python omni.usd.audio.get_stage_audio_interface() ``` Returns: The `omni.usd.audio.IStageAudio` interface. Helper method to retrieve a cached version of the IStageAudio interface.
242
omni.usd.audio.IStageAudio.md
# IStageAudio ## IStageAudio - Bases: `object` - This module contains bindings for the omni::usd::audio module. This provides functionality for playing and managing sound prims in USD scenes. - Sound files may be in RIFF/WAV, Ogg, or FLAC format. Data in the sound files may use 8, 16, 24, or 32 bit integer samples, or 32 bit floating point samples. Channel counts may be from 1 to 64. If more channels of data are provided than the audio device can play, some channels will be blended together automatically. ### Methods - `__init__()`: Constructor for the IStageAudio interface instance. - `create_capture_streamer()`: Creates a new capture streamer. - `create_event_stream_for_capture(id)`: Creates an event stream that the capture streamer will send data to. - `destroy_capture_streamer(id)`: Destroys a capture streamer. - `draw_waveform(prim, width, height[, flags, ...])`: This will draw an RGBA image of the waveform of the sound asset in use by a `Sound` prim. - `get_active_listener()` - Get the active listener prim in the scene. - `get_concurrent_voices()` - Get the minimum number of sounds in a scene that can be played concurrently. - `get_distance_delay_default()` - Get the default value for whether distance delayed audio is enable for the current USD Stage. - `get_doppler_default()` - Get the default value for whether doppler calculations are enabled for the current USD Stage. - `get_doppler_limit()` - Gets the Limit on the maximum Doppler pitch shift that can be applied to a playing voice. - `get_doppler_scale()` - Gets the scaler that can exaggerate or lessen the Doppler effect. - `get_interaural_delay_default()` - Get the default value for whether interaural delay is enabled for the current USD Stage. - `get_listener_by_index(index)` - Retrieves a single listener prim currently in the stage. - `get_listener_count()` - Retrieves the total number of listener prims currently in the stage. - `get_metadata_change_stream()` - Retrieve the event stream for metadata changes. - `get_nonspatial_time_scale()` - Gets the timescale modifier for all non-spatial voices. - `get_sound_asset_status(prim)` - Queries whether the asset of an individual sound has been fully loaded. - `get_sound_count()` - Retrieves the total number of registered sound objects in the USD stage. - `get_sound_length(prim[, length_type])` - Retrieves length of a sound in seconds (if known). - `get_spatial_time_scale()` - Gets the timescale for all spatial voices. ```code get_spatial_time_scale ``` () This gets the timescale modifier for all spatial voices. ```code get_speed_of_sound ``` () Gets the speed of sound in the medium surrounding the listener. ```code has_audio ``` () Test if audio is working. ```code is_sound_playing ``` (prim) Queries whether a sound object is currently playing. ```code play_sound ``` (prim) Immediately plays the requested USD stage sound if it is loaded. ```code set_active_listener ``` (prim) Change the active Listener prim in the scene. ```code set_capture_filename ``` (id, filename) Sets the filename that a capture streamer will write to. ```code set_concurrent_voices ``` ([value]) The minimum number of sounds in a scene that can be played concurrently. ```code set_device ``` (deviceName) Switches to use a new device for for audio output. ```code set_distance_delay_default ``` ([value]) Set the default value for whether distance delayed audio is enable for the current USD Stage. ```code set_doppler_default ``` ([value]) Set the default value for whether doppler calculations are enabled for the current USD Stage. ```code set_doppler_limit ``` ([value]) Sets a Limit on the maximum Doppler pitch shift that can be applied to a playing voice. ```code set_doppler_scale ``` ([value]) Sets a scaler that can exaggerate or lessen the Doppler effect. ```code set_interaural_delay_default ``` ([value]) Set the default value for whether interaural delay is enabled for the current USD Stage. ```code set_nonspatial_time_scale ``` ([value]) ``` | Description | | --------------------------------------------------------------------------- | | Sets the timescale modifier for all non-spatial voices. | | Method | Description | | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | | `set_spatial_time_scale([value])` | This sets the timescale modifier for all spatial voices. | | `set_speed_of_sound([value])` | Sets the speed of sound in the medium surrounding the listener (typically air). | | `spawn_voice(prim)` | Immediately plays the requested USD stage sound as a new carb.audio.Voice if it is loaded. | | `start_capture(id[, filename])` | Starts the capture on a single streamer. | | `start_captures(ids)` | Starts multiple streamers simultaneously. | | `stop_all_sounds()` | Stops all currently playing USD stage sounds. | | `stop_capture(id)` | Stops the capture on a single streamer. | | `stop_captures(ids)` | Stops the capture on multiple streamers simultaneously. | | `stop_sound(prim)` | Immediately schedules the stop of the playback of a sound. | | `subscribe_to_asset_load(prim, callback)` | Bind a callback for when assets are loaded. | | `wait_for_capture(id, timeout_milliseconds)` | Wait until the capture streamer has been disconnected. | | Attribute | Description | | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | | `INVALID_STREAMER_ID` | | | `mgr` | | | Method | Description | | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | | `__init__()` | Constructor for the IStageAudio interface instance. This will raise an Exception if it was unable to obtain an instance of the USD context interface. | | `create_capture_streamer()` | | ### create_capture_streamer Creates a new capture streamer. This streamer object may be used multiple times to capture audio for a stage. Once a capture has been stopped on it, this streamer can be reused for another capture without issue. It must be destroyed with destroy_capture_streamer() when it is no longer needed. #### Parameters - **mgr** – the audio manager to create the new streamer on. This may not be None. #### Returns - The handle to a new capture streamer if it is successfully created. When this handle is no longer needed, it must be destroyed with destroy_capture_streamer(). - INVALID_STREAMER_ID if the new capture streamer could not be created. ### create_event_stream_for_capture Creates an event stream that the capture streamer will send data to. #### Parameters - **mgr** – the audio manager that owns the streamer id. This may not be None. - **id** – the streamer to set the filename for. This handle will have been returned from a previous call to create_capture_streamer(). This may not be INVALID_STREAMER_ID. #### Returns An event stream object. Call omni.usd.audio.create_event_listener() to receive callbacks for this object. Although you can directly subscribe to this callback, python is unsuitable for the required data conversion this needs. ### destroy_capture_streamer Destroys a capture streamer. Note that if the capture streamer is still running, this will asynchronously stop the capture streamer, so the file may not be finished being written by the time this call returns. If you need to ensure that capture has finished, call stop_capture() then call wait_for_capture() on that streamer before calling this function. #### Parameters - **mgr** – the audio manager to destroy the streamer for. This may not be None. - **id** – the streamer to be destroyed. If this streamer is currently running a capture, it will be stopped first. Note that currently stopping one streamer will stop all installed streamers. All but the removed one will be restarted afterward. This will have the side effect of overwriting each other streamer’s file though. This can be avoided by stopping all streamers simultaneously first with stop_captures(). #### Returns no return value. ### draw_waveform This will draw an RGBA image of the waveform of the sound asset in use by a `Sound` prim. #### Parameters - **prim** - **width** - **height** - **flags** = 34 - **channel** = 0 - **background** = [0, 0, 0, 1.0] - **colors** = [] ## Parameters - **prim** – The prim which has the sound asset that will be rendered. Note that the `mediaOffsetStart` and `mediaOffsetEnd` properties of the prim are used to choose the region of the sound that is drawn. The asset for this prim must have been loaded or the call will fail. - **width** – The width, in pixels, of the output image. - **height** – The width, in pixels, of the output image. - **flags** – Flags that alter the style of the rendered image. This must be a combination of carb.audio.AUDIO_IMAGE_FLAG*. - AUDIO_IMAGE_FLAG_USE_LINES: The sound samples in the output image will be connected with lines, rather than just being individual points. - AUDIO_IMAGE_FLAG_NOISE_COLOR: Each sound sample is given a random color and the colors parameter is ignored. - AUDIO_IMAGE_FLAG_MULTI_CHANNEL: Each channel is drawn on top of the previous channel. The channel parameter is not used when this flag is set. - AUDIO_IMAGE_FLAG_ALPHA_BLEND: Each pixel drawn is alpha blended into the output image. This is only useful if the colors specified don’t have an alpha component of 1.0. - AUDIO_IMAGE_FLAG_SPLIT_CHANNELS: Each channel is rendered separately, organized vertically. This cannot be used in combination with AUDIO_IMAGE_FLAG_MULTI_CHANNEL; the rendering style chosen in this case is undefined. The channel parameter is not used when this flag is set. - **channel** – Which audio channel will be rendered. This is only used if AUDIO_IMAGE_FLAG_MULTI_CHANNEL and AUDIO_IMAGE_FLAG_SPLIT_CHANNELS are not set. - **background** – A normalized RGBA color to use as the background of the image. - **colors** – Normalized RGBA colors to use for each channel. If AUDIO_IMAGE_FLAG_MULTI_CHANNEL or AUDIO_IMAGE_FLAG_SPLIT_CHANNELS are used, each index into this list is the color of that audio channel. When those flags are not set, index 0 into this list is always used to render the selected channel. If a color is not specified, a default color is used instead. ## Returns A raw RGBA image with the rendered waveform. If the prim was not a sound prim or its asset had not been loaded yet, an empty list will be returned. ## get_active_listener Get the active listener prim in the scene. - **Parameters** - **arguments** (No) – - **Returns** - The active listener is returned, if an active listener prim is bound. - None is returned if no active listener prim is bound, which means the active camera is being used as the active listener. ## get_concurrent_voices Get the minimum number of sounds in a scene that can be played concurrently. - **Parameters** - **arguments** (No) – - **Returns** - The minimum number of sounds in a scene that can be played concurrently. ## get_distance_delay_default Get the default value for whether distance delayed audio is enable for the current USD Stage. - **Parameters** - **arguments** (No) – - **Returns** - The default value for whether distance delayed audio is enable for the current USD Stage. ## get_doppler_default Get the default value for whether doppler calculations are enabled for the current USD Stage. - **Parameters** - **arguments** (No) – - **Returns** - The default value for whether doppler calculations are enabled for the current USD Stage. - **arguments.** (No) – - Returns - The default value for whether doppler calculations are enabled for the current USD Stage. - **get_doppler_limit**() - Gets the Limit on the maximum Doppler pitch shift that can be applied to a playing voice. - Parameters - **arguments.** (No) – - Returns - The Limit on the maximum Doppler pitch shift that can be applied to a playing voice. - **get_doppler_scale**() - Gets the scaler that can exaggerate or lessen the Doppler effect. - Parameters - **arguments.** (No) – - Returns - The scaler that can exaggerate or lessen the Doppler effect. - **get_interaural_delay_default**() - Get the default value for whether interaural delay is enabled for the current USD Stage. - Parameters - **arguments.** (No) – - Returns - The default value for whether interaural delay is enabled for the current USD Stage. - **get_listener_by_index**(index) - Retrieves a single listener prim currently in the stage. - Parameters - **index** – The zero based index of the listener to retrieve the SDF path for. This should be strictly less than the most recent return value of _get_listener_count(). - Returns - The requested indexed listener prim in the stage if the index is valid. - None is returned if the given index was out of bounds of the number of listeners in the stage. - **get_listener_count**() - Retrieves the total number of listener prims currently in the stage. - Parameters - **arguments.** (No) – - Returns - The total number of listener prims currently in the stage. Note that this may change at any time due to user or script action so it is best to call this immediately before enumerating listeners. - **get_metadata_change_stream**() - Retrieve the event stream for metadata changes. - Parameters - **mgr** – The stage audio manager instance that this function acts upon. This must not be None. - Returns - An IEventStream which is pushed when metadata is changed. None if the event stream could not be created for some reason. ## get_nonspatial_time_scale Gets the timescale modifier for all non-spatial voices. ### Parameters - **arguments.** (No) – ### Returns The timescale modifier for all non-spatial voices. ## get_sound_asset_status Queries whether the asset of an individual sound has been fully loaded. Once the asset of a sound has been fully loaded, it should be possible to play with play_sound(). NOTE: this function is deprecated and will be replaced with a sound asset loaded callback. ### Parameters - **of.** (path The path to sound prim to retrieve the status) – ### Returns - AssetLoadStatus.IN_PROGRESS if the asset is in the process of loading. - AssetLoadStatus.DONE if the asset has finished loading and is ready for immediate playback. - AssetLoadStatus.FAILED if the audio manager has not loaded. - AssetLoadStatus.FAILED if the asset has failed to load. - AssetLoadStatus.NOT_REGISTERED if the sound prim is not of type Sound or the path corresponds to a prim that doesn’t exist. ## get_sound_count Retrieves the total number of registered sound objects in the USD stage. ### Returns - The total number of sound prims in the current USD stage. - Sounds that have not had their asset loaded yet (or their asset failed to load) will not show up in the sound count unless they’ve been passed to an IStageAudio function. ## get_sound_length Retrieves length of a sound in seconds (if known). This calculates the length of a USD stage sound in seconds. This will be the lesser of the difference between the sound’s start and end times (if an end time is set on the prim) or the length of the actual sound asset itself (if not looping). In either case, this will be the amount of time that the sound would be expected to play for if it were triggered. For sounds that are set to loop, the returned time will include all scheduled loop iterations. For sounds that are set to loop infinitely, this will be INFINITY. ### Parameters - **prim** – The USD prim to query the length of. This must be of type OmniAudioSchemaOmniSound. - **length_type** – How the length of the sound is measured. - **Valid values** – - SoundLengthType.PLAY_LENGTH: The length of time the sound is estimated to play for in the stage once it’s triggered. This will be the lesser of the difference between the sound’s start and end times (if an end time is set on the prim) or the length of the actual sound itself, multiplied by loop count. Note that timeScale is taken into account when calculating the play time of an asset. For sounds that are set to loop infinitely, this will be a very large number (on the scale of 100 days). - SoundLengthType.SOUND_LENGTH: The length of the sound. This doesn’t include the sound’s start time, end time or loop count. This is calculated using mediaOffsetStart and mediaOffsetEnd if those are set; otherwise, this just returns the sound asset’s length. - SoundLengthType.ASSET_LENGTH: The length of the underlying sound asset, ignoring any USD parameters. ### Returns The play length of the sound in seconds if the asset is loaded and the length can be calculated. 0.0 if the sound asset is not available yet or the length could not be properly calculated. This gets the timescale modifier for all spatial voices. **Parameters** - **arguments.** (No) – **Returns** - The timescale modifier for all spatial voices. Gets the speed of sound in the medium surrounding the listener. This is measured in meters per second. **Parameters** - **arguments.** (No) – **Returns** - The speed of sound in the medium surrounding the listener. Test if audio is working. If the audio manager has failed to load or has been explicitly disabled, this function will return False. This function will otherwise return True. **Returns** - True if audio is in a working state. - False if audio is in a disabled state. Queries whether a sound object is currently playing. This queries whether a sound is currently playing. If this fails, that may mean that the sound ended naturally on its own or it was explicitly stopped. Note that this may continue to return true for a short period after a sound has been stopped with stop_sound() or stop_all_sounds(). This period may be up to 20 milliseconds in extreme cases but will usually not exceed 10 milliseconds. This only checks the most recently playing instance of a sound, if multiple simultaneous sounds have been spawned with playSound(). **Parameters** - **prim** – The USD prim to query the playing state for. This must be of type OmniAudioSchemaOmniSound. **Returns** - true if the sound object is currently playing. - false if the sound has either finished playing or has not been played yet. Immediately plays the requested USD stage sound if it is loaded. This plays a single non-looping instance of a USD stage sound immediately. The sound must have already been loaded. If the sound resource was missing or couldn’t be loaded, this call will simply be ignored. This will return immediately after scheduling the sound to play. It will never block for the duration of the sound playback. This sound may be prematurely stopped with stop_sound(). The loopCount parameter of the prim parameter is ignored in this call. This functionality will be added in a future revision. Sound prims that are scheduled to play in an animation should not also be played with playSound(), since it may prevent them from playing when they are scheduled to play. This will be fixed in a future revision. **Parameters** - **prim** – The USD prim to play. This must be of type OmniAudioSchemaOmniSound. **Returns** - No return value. Change the active Listener prim in the scene. Note that updating the active Listener’s uniform attributes, such as orientationFromView, will reset the active listener back to the active camera. - **Parameters** - **prim** – The prim to set as the active listener. This can be None to use the active camera as the active listener. - **Returns** - True if the prim at @p path was set as the active prim. False if the prim at @p path was not registered with hydra. This can occur if hydra has not informed the audio manager about its existence yet. - **set_capture_filename** - Sets the filename that a capture streamer will write to. - **Parameters** - **mgr** – the audio manager that owns the streamer id. This may not be None. - **id** – the streamer to set the filename for. This handle will have been returned from a previous call to create_capture_streamer(). This may not be INVALID_STREAMER_ID. - **filename** – the name and path of the file to write the streamer’s data to once its capture is started. If the filename is set here, a None filename may be passed into start_capture(). - **Returns** - No return value. - **set_concurrent_voices** - The minimum number of sounds in a scene that can be played concurrently. - In a scene where `concurrentVoices` is set to `N` and `N + 1` sounds are played concurrently, Omniverse Kit will choose to not play the `N+1` th sound to the audio device and just track it as a ‘virtual’ voice. The voices chosen to become ‘virtual’ will be the lowest priority or silent. A ‘virtual’ voice should begin playing again once there is an empty voice to play on. - **Parameters** - **value** – The new value for the number of concurrent voices. - **Returns** - No return value. - **set_device** - Switches to use a new device for for audio output. - This sets the device that the audio manager will use for its output. If the requested device cannot be used for any reason, the default output device will be used instead. The device may change the final output format. If a streamer is attached to the previous output, its stream will be closed before opening a new stream on the new device. Even if the new device name matches the current device’s name, the device will still be changed and any stream reset. - If multiple devices attached to the system have the same name, the one that is chosen may be undefined. This can be a common issue with certain devices showing up in the system as simply “Speakers”. Using the device’s GUID instead will allow a specific device to be used instead, even its name exactly matches that of another device. - **Parameters** - **deviceName** – The name or GUID of the device to set as active. This must exactly match the name or GUID of one of the devices attached to the system at the time. If the given name or GUID doesn’t match one of the connected devices, the default device will be used instead. This may be set to nullptr or an empty string to use the system’s default device. This device name or identifier may be retrieved from the IAudioDeviceEnum interface. - **Returns** - No return value. - **set_distance_delay_default** - Set the default value for whether distance delayed audio is enable for the current USD Stage. - This will append the USD Stage metadata to add this new scene setting. - **Parameters** - **value** – The new value for whether distance delayed audio is enable for the current USD Stage. - **Returns** - No return value. ## Parameters **value** – The value to set this as. This must be one of the following values: - **FeatureDefault.ON**: Sounds with enableDistanceDelay set to "default" will have distance delay effects applied. - **FeatureDefault.OFF**: Sounds with enableDistanceDelay set to "default" will not have distance delay effects applied. This is the default because distance delay can have a very confusing effect if worldUnitScale hasn’t been set correctly. - **FeatureDefault.FORCE_ON**: all Sounds will have distance delay effects applied. This setting is intended to let users test what effect distance delay is having on their scene without requiring all Sounds to have their enableDistanceDelay property set to "default". - **FeatureDefault.FORCE_OFF**: all Sounds will have distance delay effects disabled. This setting is intended to let users test what effect distance delay having on their scene without requiring all Sounds to have their enableDistanceDelay property set to "default". ## Returns No return value. ## set_doppler_default Set the default value for whether doppler calculations are enabled for the current USD Stage. This will append the USD Stage metadata to add this new scene setting. ### Parameters **value** – The value to set this as. This must be one of the following values: - **FeatureDefault.ON**: Sounds with enableDoppler set to "default" will have Doppler effects applied. - **FeatureDefault.OFF**: Sounds with enableDoppler set to "default" will not have Doppler effects applied. This is the default because Doppler effect’s implementation is still experimental. The default will be switched to FeatureDefault.ON when the feature is stabilized. - **FeatureDefault.FORCE_ON**: all Sounds will have Doppler effects applied. This setting is intended to let users test what effect the Doppler effect is having on their scene without requiring all Sounds to have their enableDoppler property set to "default". - **FeatureDefault.FORCE_OFF**: all Sounds will have Doppler effects disabled. This setting is intended to let users test what effect the Doppler effect having on their scene without requiring all Sounds to have their enableDoppler property set to "default". ### Returns No return value. ## set_doppler_limit Sets a Limit on the maximum Doppler pitch shift that can be applied to a playing voice. Since Omniverse Kit does not handle supersonic spatial audio, a maximum frequency shift must be set for prims that move toward the listener at or faster than the speed of sound. This is mostly useful for handling edge cases such as teleporting an object far away while it’s playing a sound. ### Parameters **value** – The new value for the doppler limit. ### Returns No return value. ## set_doppler_scale Sets a scaler that can exaggerate or lessen the Doppler effect. Setting this above 1.0 will exaggerate the Doppler effect. Setting this below 1.0 will lessen the Doppler effect. Negative values and zero are not allowed. Doppler effects alter the pitch of a sound based on its relative velocity to the listener. ### Parameters **value** – The new value for the doppler scale. ### Returns No return value. 1. <span class="sig-paren"> ) <a class="headerlink" href="#omni.usd.audio.IStageAudio.set_interaural_delay_default" title="Permalink to this definition">  <dd> <p> Set the default value for whether interaural delay is enabled for the current USD Stage. <p> This will append the USD Stage metadata to add this new scene setting. <dl class="field-list simple"> <dt class="field-odd"> Parameters <dd class="field-odd"> <p> <strong> value – <p> The value to set. This must be one of the following values: <ul class="simple"> <li> <p> FeatureDefault.ON: Sounds with enableInterauralDelay set to “default” will have interaural delay effects applied. This is the default. <li> <p> FeatureDefault.OFF: Sounds with enableInterauralDelay set to “default” will not have interaural delay effects applied. <li> <p> FeatureDefault.FORCE_ON: all Sounds will have interaural delay effects applied. This setting is intended to let users test what effect interaural delay is having on their scene without requiring all Sounds to have their enableInterauralDelay property set to “default”. <li> <p> FeatureDefault.FORCE_OFF: all Sounds will have distance delay effects disabled. This setting is intended to let users test what effect interaural delay having on their scene without requiring all Sounds to have their enableInterauralDelay property set to “default”. <dt class="field-even"> Returns <dd class="field-even"> <p> No return value. <dl class="py method"> <dt class="sig sig-object py" id="omni.usd.audio.IStageAudio.set_nonspatial_time_scale"> <span class="sig-name descname"> <span class="pre"> set_nonspatial_time_scale <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> value <span class="o"> <span class="pre"> = <span class="default_value"> <span class="pre"> 1.0 <span class="sig-paren"> ) <a class="headerlink" href="#omni.usd.audio.IStageAudio.set_nonspatial_time_scale" title="Permalink to this definition">  <dd> <p> Sets the timescale modifier for all non-spatial voices. Each prim multiplies its timeScale attribute by this value. For example, setting this to 0.5 will play all non-spatial sounds at half speed and setting this to 2.0 will play all non-spatial sounds at double speed. Altering the playback speed of a sound will affect the pitch of the sound. The limits of this setting under Omniverse Kit are [1/1024, 1024]. <dl class="field-list simple"> <dt class="field-odd"> Parameters <dd class="field-odd"> <p> <strong> value – The new value for the non-spatial timescale. <dt class="field-even"> Returns <dd class="field-even"> <p> No return value. <dl class="py method"> <dt class="sig sig-object py" id="omni.usd.audio.IStageAudio.set_spatial_time_scale"> <span class="sig-name descname"> <span class="pre"> set_spatial_time_scale <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> value <span class="o"> <span class="pre"> = <span class="default_value"> <span class="pre"> 1.0 <span class="sig-paren"> ) <a class="headerlink" href="#omni.usd.audio.IStageAudio.set_spatial_time_scale" title="Permalink to this definition">  <dd> <p> This sets the timescale modifier for all spatial voices. Each prim multiplies its timeScale attribute by this value. For example, setting this to 0.5 will play all spatial sounds at half speed and setting this to 2.0 will play all non-spatial sounds at double speed. This affects delay times for the distance delay effect. Altering the playback speed of a sound will affect the pitch of the sound. The limits of this setting under Omniverse Kit are [1/1024, 1024]. This feature is intended to allow time-dilation to be performed with the sound effects in the scene without affecting non-spatial elements like the background music. <dl class="field-list simple"> <dt class="field-odd"> Parameters <dd class="field-odd"> <p> <strong> value – The new value for the spatial timescale. <dt class="field-even"> Returns <dd class="field-even"> <p> No return value. <dl class="py method"> <dt class="sig sig-object py" id="omni.usd.audio.IStageAudio.set_speed_of_sound"> <span class="sig-name descname"> <span class="pre"> set_speed_of_sound <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> value <span class="o"> <span class="pre"> = <span class="default_value"> <span class="pre"> 340.0 <span class="sig-paren"> ) <a class="headerlink" href="#omni.usd.audio.IStageAudio.set_speed_of_sound" title="Permalink to this definition">  <dd> <p> Sets the speed of sound in the medium surrounding the listener (typically air). This is measured in meters per second. This would typically be adjusted when doing an underwater scene. The speed of sound in dry air at sea level is approximately 340.0m/s. <dl class="field-list simple"> <dt class="field-odd"> Parameters <dd class="field-odd"> <p> <strong> value – The new value for the speed of sound. <dt class="field-even"> Returns <dd class="field-even"> <p> No return value. <dl class="py method"> <dt class="sig sig-object py" id="omni.usd.audio.IStageAudio.spawn_voice"> <span class="sig-name descname"> <span class="pre"> spawn_voice <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> prim <span class="sig-paren"> ) <a class="headerlink" href="#omni.usd.audio.IStageAudio.spawn_voice" title="Permalink to this definition">  <dd> Immediately plays the requested USD stage sound as a new carb.audio.Voice if it is loaded. This begins playing the requested sound as a new carb.audio.Voice. The sound must have already been loaded or None will be returned. The spawned voice plays the sound asynchronously for the lifetime of the voice. This is intended for cases where the behavior of playSound() is too limiting. stopAllSounds() and stopSound() do not affect the playing voices spawned from this call. Unlike playSound(), the loopCount parameter of the prim is used, so the voice must be explicitly stopped if the voice is infinitely looping. Unlike playSound(), these voice handles are managed separately from the voice handles of the timeline, so spawning a voice from a sound that will play on the timeline shouldn’t affect that sound’s timeline playback. Stopping the timeline will also not stop these playing voices. ### Parameters - **path** – The path to sound prim to spawn a voice from. ### Returns This returns the new voice that was spawned. This voice’s settings are only a snapshot of the sound prim that they were based off. Updates to these parameters will have to be performed on the returned voice through the IAudioPlayback interface. this returns nullptr if a new voice could not be spawned. ### start_capture ```python start_capture(id, filename=None) ``` Starts the capture on a single streamer. #### Parameters - **mgr** – the audio manager that owns the streamer id. This may not be None. - **id** – the handle of the streamer to start. This handle will have been returned from a previous call to create_capture_streamer(). This may not be INVALID_STREAMER_ID. - **filename** – the name and path of the filename to write the streamer’s data to once its capture is started. If a filename was set with a previous call to set_capture_filename() on the same streamer, this may be None to use that filename. If a non-None and non-empty filename is given here, it will always override any filename previously set on the streamer. #### Returns True if the streamer is successfully started. Note that starting a streamer currently has the side effect of stopping and restarting all other streamers that are currently running a capture. This will result in each streamer’s output file being overwritten. If multiple streamers need to be started simultaneously, start_captures() should be used instead. False if the streamer could not be started. ### start_captures ```python start_captures(ids) ``` Starts multiple streamers simultaneously. This attempts to start one or more streamers simultaneously. If successful, all streamers are guaranteed to be started in sync with each other such that their first written audio frame matches. If this method is used to start multiple streamers, the stop_captures() function must also be used to stop those same streamers simultaneously. If another streamer starts or stops independently, it will cause all streamers to be closed then reopened which will overwrite each of their files. #### Parameters - **mgr** – the audio manager that owns the streamer handles in ids. This may not be None. - **ids** – the list of streamers to start a capture on. Any entries that are set to INVALID_STREAMER_ID in this list will be ignored. Each valid entry must have had its filename set with set_capture_filename() first otherwise it will be skipped. Any streamer that is already running a capture will be skipped, but a side effect of this operation will be that its stream will be closed and reopened thereby overwriting its file. this may not be None. #### Returns True if at least one streamer is successfully started. False if no streamers could be started or all streamers were skipped for one of the reasons listed under streamers. ### stop_all_sounds ```python stop_all_sounds() ``` Stops all currently playing USD stage sounds. This stops all currently playing stage sounds. Any sounds that have been queued for playback will be stopped. UI sounds will not be affected. This is intended to be used to reset the sound playback system when an animation sequence is stopped. This will be automatically called internally whenever the animation sequence is stopped or it loops. #### Returns No return value. ### stop_capture ```python stop_capture(id) ``` Stops the capture on a single streamer. This will asynchronously stop the capture streamer, so the file may not be finished being written by the time this call returns. If you need to ensure that capture has finished, call wait_for_capture(). #### Parameters - **mgr** – the audio manager that owns the streamer id. This may not be None. - **id** – the handle to the streamer to stop. This will have been returned from a previous call to create_capture_streamer(). If a capture is not running on this streamer, it will be ignored. This may not be INVALID_STREAMER_ID. #### Returns - True if the streamer is successfully stopped. - False if the streamer handle was invalid or a capture was not running on it. ### stop_captures ```python stop_captures(ids) ``` Stops the capture on multiple streamers simultaneously. This will asynchronously stop the capture streamer, so the file may not be finished being written by the time this call returns. If you need to ensure that capture has finished, call wait_for_capture(). #### Parameters - **mgr** – the audio manager that owns the streamer handles in ids. This may not be None. - **ids** – the list of streamers to stop the capture on. Any INVALID_STREAMER_ID entries will be ignored. Each valid entry must be currently running a capture otherwise it will be skipped. This may not be None. #### Returns - True if at least one streamer is successfully stopped. - False if no streamers could be stopped. ### stop_sound ```python stop_sound(prim) ``` Immediately schedules the stop of the playback of a sound. This stops the playback of an active sound. If the sound was not playing or had already naturally stopped on its own, this call is ignored. Note that is_sound_playing() may continue to return true for a short period after a sound has been stopped for a period of up to 20 milliseconds in extreme cases but will usually not exceed 10 milliseconds. This only stops the most recently played instance of a sound, if multiple overlapping instances of a sound were played with playSound(). #### Parameters - **prim** – The USD prim to stop. This must be of type OmniAudioSchemaOmniSound. #### Returns - No return value. ### subscribe_to_asset_load ```python subscribe_to_asset_load(prim, callback) ``` Bind a callback for when assets are loaded. This will fire the callback when the sound’s asset is loaded or immediately if the asset was already loaded. The callback will only fire once. #### Parameters - **prim** – The sound prim to bind a callback to. - **callback** – The callback to fire once a load has occurred. #### Returns - true if the callback was bound successfully. - true if the callback was executed immediately. - false if the prim path passed corresponds to a prim that’s not of type Sound. - false if an unexpected error prevents the callback from occurring. ### IStageAudio.wait_for_capture(id, timeout_milliseconds) Wait until the capture streamer has been disconnected. Because stop_capture() does not stop the audio system or otherwise block to ensure that the streamer is disconnected, you must call wait_for_capture() to verify that a capture streamer has actually finished. This is mainly useful if you need to verify that a file written by a streamer has finished being written. #### Parameters - **id** – the handle to the streamer to wait for. This will have been returned from a previous call to create_capture_streamer(). If a capture is not running on this streamer, it will be ignored. This may not be INVALID_STREAMER_ID. - **timeout_milliseconds** – The maximum number of milliseconds to wait for the streamer to close. #### Returns - True if the capture streamer has disconnected. - False if the call timed out before the streamer could disconnect.
41,289
omni.usd.audio.md
# omni.usd.audio ## Classes Summary - **AssetLoadStatus** - Members: - **EventType** - Members: - **FeatureDefault** - Members: - **IStageAudio** - This module contains bindings for the omni::usd::audio module. - **SoundLengthType** - Members: - **StreamListener** ## Functions Summary - **get_stage_audio_interface** - helper method to retrieve a cached version of the IStageAudio interface. - **test_hydra_plugin** - test_hydra_plugin() -> bool
462
omni.usd.audio.SoundLengthType.md
# SoundLengthType ## Overview The `SoundLengthType` class, derived from `pybind11_object`, defines various types of sound lengths used in audio processing. ### Members - `PLAY_LENGTH` - `SOUND_LENGTH` - `ASSET_LENGTH` ### Methods | Method | Description | |--------|-------------| | `__init__(self, value)` | Initializes the `SoundLengthType` instance. | ### Attributes | Attribute | Description | |-----------|-------------| | `ASSET_LENGTH` | Description not provided. | | `PLAY_LENGTH` | Description not provided. | | `SOUND_LENGTH` | Description not provided. | | `name` | Description not provided. | | `value` | Description not provided. | <em class="sig-param"> <span class="n"> <span class="pre"> omni.usd.audio._audio.SoundLengthType , <em class="sig-param"> <span class="n"> <span class="pre"> value <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> int <span class="sig-paren"> ) <span class="sig-return"> <span class="sig-return-icon"> → <span class="sig-return-typehint"> <span class="pre"> None <dd> <dl class="py property"> <dt class="sig sig-object py" id="omni.usd.audio.SoundLengthType.name"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> name <dd>
1,473
omni.usd.audio.StreamListener.md
# StreamListener ## omni.usd.audio.StreamListener Bases: `pybind11_object` ### Methods | Method | Description | |--------|-------------| | `__init__(self, p, open, writeData, close)` | | #### __init__(self, p, open, writeData, close) - **Parameters**: - `self`: An instance of `omni.usd.audio._audio.StreamListener` - `p`: `carb.events._events.IEventStream` - `open`: `Callable[[carb.audio.SoundFormat], None]` - `writeData`: `Callable[[bytes], None]` - `close`: `Callable[[], None]` **Callable**[list], **None**], **close**: **Callable**[[], **None**]
568
omni.usd.audio.test_hydra_plugin.md
# test_hydra_plugin ## test_hydra_plugin Test whether the Hydra audio plugin is accessible. This is intended to allow the tests to check whether the Hydra audio plugin is still working. **Parameters** - **arguments** (No) – **Returns** - True if the plugin is accessible. False otherwise.
291
omni.usd.AudioManager.md
# AudioManager ## AudioManager ```python class omni.usd.AudioManager(pybind11_object) ``` ### Methods | Method | Description | |--------|-------------| | `__init__(*args, **kwargs)` | | ```python def __init__(*args, **kwargs): pass ```
243
omni.usd.Classes.md
# omni.usd Classes ## Classes Summary: | Class Name | Description | |------------|-------------| | AudioManager | - | | EngineCreationConfig | EngineCreationConfig structure. | | EngineCreationFlags | Specifies the flags for the hydra engine creation. | | OpaqueSharedHydraEngineContext | - | | PickingMode | Members: | | PrimCaching | - | | Selection | omni.usd.Selection manages all stage selections and provides APIs for querying/setting selections. | | StageEventType | Stage Event Type. | | StageRenderingEventType | Rendering Events. | | StageState | Stage states. | | TransformHelper | - | | UsdContext | - | | UsdContextInitialLoadSet | - | | 属性 | 描述 | | --- | --- | | `initialSetOfPrims` | Specifies the initial set of prims to load when opening a UsdStage. | | `UsdExtension` | | | `UsdWatcher` | | | `Value_On_Layer` | An enumeration. |
851
omni.usd.clear_attr_val_at_time.md
# clear_attr_val_at_time ## clear_attr_val_at_time ```python omni.usd.clear_attr_val_at_time(attr: Attribute, time_code=Usd.TimeCode.Default(), auto_target_layer: bool = True) ``` Clears attribute at specified timecode. ### Parameters - **attr** (Usd.Attribute) – Attribute handle. - **time_code** (_type_, optional) – specified timecode. Defaults to Usd.TimeCode.Default(). - **auto_target_layer** (bool, optional) – When it’s True and the property exists in session layer or its sublayers, it will switch EditTarget to the session layer instead to clear the strongest opinion. Defaults to True.
599
omni.usd.commands.AddPayloadCommand.md
# AddPayloadCommand ## Class Definition ```python class omni.usd.commands.AddPayloadCommand(stage, prim_path: Path, payload: Payload, position=Usd.ListPositionBackOfPrependList) ``` **Bases:** ```python PayloadCommandBase ``` ### Methods | Method | Description | |--------|-------------| | `__init__(stage, prim_path, payload[, position])` | | | `do()` | | ``` Path, payload: Payload, position = Usd.ListPositionBackOfPrependList)
436
omni.usd.commands.AddReferenceCommand.md
# AddReferenceCommand ## Class Definition ```python class omni.usd.commands.AddReferenceCommand(stage, prim_path: Path, reference: Reference, position=Usd.ListPositionBackOfPrependList) ``` **Bases:** ```python ReferenceCommandBase ``` ### Methods | Method | Description | |--------|-------------| | `__init__(stage, prim_path, reference[, position])` | | | `do()` | | ### Detailed Method Descriptions #### `__init__(stage, prim_path, reference[, position])` ```python __init__(stage, prim_path, reference[, position]) ``` #### `do()` ```python do() ``` Path : Reference , reference : Reference , position = Usd.ListPositionBackOfPrependList )
652
omni.usd.commands.AddRelationshipTargetCommand.md
# AddRelationshipTargetCommand ## AddRelationshipTargetCommand ```python class omni.usd.commands.AddRelationshipTargetCommand(relationship: Relationship, target: Path, position=Usd.ListPositionBackOfPrependList) ``` **Bases:** [RelationshipTargetBase](omni.usd.commands.RelationshipTargetBase.html#omni.usd.commands.RelationshipTargetBase) **Description:** Add target to a relationship ### Methods | Method | Description | |--------|-------------| | `__init__(relationship, target[, position])` | | | `do()` | | ``` , **target** : **Path**, **position** = **Usd.ListPositionBackOfPrependList**
601
omni.usd.commands.BindMaterialCommand.md
# BindMaterialCommand ## BindMaterialCommand ## BindMaterialCommand **Bases:** - `Command` - `UsdStageHelper` **Description:** Bind material undoable **Command**. ### Parameters - **prim_path** (str or list) – Path(s) to prim or collection - **material_path** (str) – Path to material to bind. - **strength** (float) – Strength. - **stage** (Usd.Stage) – Stage to operate. Optional. - **context_name** (str) – The usd context to operate. Optional. - **material_purpose** (str) – Material purpose. Optional. ### Methods - `__init__(prim_path, material_path[, ...])` - `do()` - `undo()` #### `__init__(prim_path, material_path, strength=None, stage=None, context_name=None)` - **prim_path**: Union[str, list] - **material_path**: str - **strength**: Optional[float] = None - **stage**: Optional[Stage] = None - **context_name**: Optional[str] = None <dl class="sig sig-object py" id="omni.usd.commands.BindMaterialCommand.__init__"> <dt class="sig sig-object py"> <em class="sig-object"> <span class="n"> <span class="pre"> __init__ <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> self <span class="sig-paren"> , <em class="sig-param"> <span class="n"> <span class="pre"> material_path <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> Optional <span class="p"> <span class="pre"> [ <span class="pre"> str <span class="p"> <span class="pre"> ] <span class="w"> <span class="o"> <span class="pre"> = <span class="w"> <span class="default_value"> <span class="pre"> None , <em class="sig-param"> <span class="n"> <span class="pre"> material_purpose <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> Optional <span class="p"> <span class="pre"> [ <span class="pre"> str <span class="p"> <span class="pre"> ] <span class="w"> <span class="o"> <span class="pre"> = <span class="w"> <span class="default_value"> <span class="pre"> '' <span class="sig-paren"> ) <dd> <dl class="py class"> <dt class="sig sig-object py" id="omni.usd.commands.BindMaterialCommand.PathType"> <em class="property"> <span class="pre"> class <span class="w"> <span class="sig-name descname"> <span class="pre"> PathType <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> value <span class="sig-paren"> ) <dd> <p> Bases: <code> <span class="pre"> Enum <p> An enumeration.
3,846
omni.usd.commands.ChangeAttributesColorSpaceCommand.md
# ChangeAttributesColorSpaceCommand ## ChangeAttributesColorSpaceCommand ```python class omni.usd.commands.ChangeAttributesColorSpaceCommand(attributes: List[Attribute], color_space: Any) ``` Bases: `Command` Change attribute color space undoable **Command**. ### Parameters - **attributes** (List[str]) – attributes to set color space on. - **color_space** – Value of metadata to change to. ### Methods - `__init__(attributes, color_space)` - `do()` ``` | undo | | ---- | | () | ``` ``` __init__(attributes: List[Attribute], color_space: Any) ``` ```
561
omni.usd.commands.ChangeMetadataCommand.md
# ChangeMetadataCommand ## ChangeMetadataCommand ```python class omni.usd.commands.ChangeMetadataCommand(object_paths: List[str], key: Any, value: Any, usd_context_name: str = '') ``` Bases: `Command` Change object metadata undoable **Command**. ### Parameters - **object_paths** (List[str]) – Object paths, can be attribute or prim. - **key** – Key of metadata to change. - **value** – Value of metadata to change to. - **usd_context_name** (str) – (default is '') ``` ( <em> str ) – Name of the usd context to work on. Leave to “” to use default USD context. ## Methods | | | | ---- | --------------------------------------------------------------- | | | [__init__](#omni.usd.commands.ChangeMetadataCommand.__init__)(object_paths, key, value[, ...]) | | | do() | | | undo() | ### __init__ __init__(object_paths: List[str], key: Any, value: Any, usd_context_name: str = '')
1,085
omni.usd.commands.ChangeMetadataInPrimsCommand.md
# ChangeMetadataInPrimsCommand ## ChangeMetadataInPrimsCommand ```python class omni.usd.commands.ChangeMetadataInPrimsCommand(prim_paths: List[str], key: Any, value: Any, usd_context_name: str = '') ``` Bases: `Command` Change prim metadata undoable **Command**. ### Parameters - **prim_paths** (List[str]) – Prim paths. - **key** – Key of metadata to change. - **value** – Value of metadata to change to. - **usd_context_name** (str) – (default: '') ``` **Methods** - `__init__(prim_paths, key, value[, usd_context_name=""])` - `prim_paths`: List[str] - `key`: Any - `value`: Any - `usd_context_name`: str = '' - `do()` - `undo()`
647
omni.usd.commands.ChangePropertyCommand.md
# ChangePropertyCommand ## ChangePropertyCommand ```python class omni.usd.commands.ChangePropertyCommand(prop_path: str, value: Any, prev: Any, timecode=Usd.TimeCode.Default(), type_to_create_if_not_exist: Optional[ValueTypeNames] = None, target_layer: Optional[Layer] = None) Union[str, UsdContext, Stage] = '' , bool = False , Variability = Sdf.VariabilityVarying ) Bases: ``` Command ``` Change prim property undoable **Command**. **Parameters** - **prop_path** (str) – Prim property path. - **value** (Any) – Value to change to. If it’s None, current attribute value is cleared. - **prev** (Any) – Value to undo to. - **timecode** (Usd.TimeCode) – The timecode to set property value to. - **type_to_create_if_not_exist** (Sdf.ValueTypeName) – If not None AND property does not already exist, a new property will be created with given type and value. - **target_layer** (sdf.Layer) – Target layer to write value to. Leave to None to use current stage’s EditTarget. - **usd_context_name** (Union[str, Usd.Stage]) – Union that could be: * Name of the usd context to work on. Leave to “” to use default USD context. * Instance of UsdContext. * Or stage instance. - **is_custom** (bool) – If the property is created, specify if it is a ‘custom’ property (not part of the Schema). - **variability** (Sdf.Variability) – If the property is created, specify the variability. **Methods** - **__init__**(prop_path, value, prev[, timecode, ...]) - **do**() - **undo**() **Attributes** - **overriden_notification** <dl class="py method"> <dt class="sig sig-object py" id="omni.usd.commands.ChangePropertyCommand.__init__"> <span class="sig-name descname"> <span class="pre"> __init__ <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> prop_path <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> str , <em class="sig-param"> <span class="n"> <span class="pre"> value <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> Any , <em class="sig-param"> <span class="n"> <span class="pre"> prev <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> Any , <em class="sig-param"> <span class="n"> <span class="pre"> timecode <span class="o"> <span class="pre"> = <span class="default_value"> <span class="pre"> Usd.TimeCode.Default() , <em class="sig-param"> <span class="n"> <span class="pre"> type_to_create_if_not_exist <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> Optional <span class="p"> <span class="pre"> [ <span class="pre"> ValueTypeNames <span class="p"> <span class="pre"> ] <span class="w"> <span class="o"> <span class="pre"> = <span class="w"> <span class="default_value"> <span class="pre"> None , <em class="sig-param"> <span class="n"> <span class="pre"> target_layer <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> Optional <span class="p"> <span class="pre"> [ <span class="pre"> Layer <span class="p"> <span class="pre"> ] <span class="w"> <span class="o"> <span class="pre"> = <span class="w"> <span class="default_value"> <span class="pre"> None , <em class="sig-param"> <span class="n"> <span class="pre"> usd_context_name <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> Union <span class="p"> <span class="pre"> [ <span class="pre"> str <span class="p"> <span class="pre"> , <span class="w"> <span class="pre"> UsdContext <span class="p"> <span class="pre"> , <span class="w"> <span class="pre"> Stage <span class="p"> <span class="pre"> ] <span class="w"> <span class="o"> <span class="pre"> = <span class="w"> <span class="default_value"> <span class="pre"> '' , <em class="sig-param"> <span class="n"> <span class="pre"> is_custom <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> bool <span class="w"> <span class="o"> <span class="pre"> = <span class="w"> <span class="default_value"> <span class="pre"> False , <em class="sig-param"> <span class="n"> <span class="pre"> variability <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> Variability <span class="w"> <span class="o"> <span class="pre"> = <span class="w"> <span class="default_value"> <span class="pre"> Sdf.VariabilityVarying <span class="sig-paren"> ) <a class="headerlink" href="#omni.usd.commands.ChangePropertyCommand.__init__" title="Permalink to this definition">  <dd>
7,011
omni.usd.commands.Classes.md
# omni.usd.commands Classes ## Classes Summary: | Class Name | Description | |------------|-------------| | AddPayloadCommand | Base class for all **Commands**. | | AddReferenceCommand | Base class for all **Commands**. | | AddRelationshipTargetCommand | Add target to a relationship | | BindMaterialCommand | Bind material undoable **Command**. | | ChangeAttributesColorSpaceCommand | Change attribute color space undoable **Command**. | | ChangeMetadataCommand | Change object metadata undoable **Command**. | | ChangeMetadataInPrimsCommand | Change prim metadata undoable **Command**. | | ChangePropertyCommand | Change prim property undoable **Command**. | | ClearCurvesSplitsOverridesCommand | Clear Curves Splits Overrides **Command**. | | ClearRefinementOverridesCommand | Clear Refinement Overrides **Command**. | | CopyPrimCommand | Description not provided. | | Command | Description | |---------|-------------| | CopyPrimCommand | Copy primitive undoable **Command**. | | CopyPrimsCommand | Copy multiple primitives undoable **Command**. | | CreateAudioPrimFromAssetPathCommand | Create reference undoable **Command**. | | CreateDefaultXformOnPrimCommand | Create DefaultXform On Prim undoable **Command**. | | CreateInstanceCommand | Instance primitive undoable **Command**. | | CreateInstancesCommand | Instance multiple primitives undoable **Command**. | | CreateMdlMaterialPrimCommand | Create Mdl Material undoable **Command**. | | CreateMtlxMaterialPrimCommand | Create MaterialX Material undoable **Command**. | | CreatePayloadCommand | Create payload undoable **Command**. | | CreatePreviewSurfaceMaterialPrimCommand | Create Preview Surface Material undoable **Command**. | | CreatePreviewSurfaceTextureMaterialPrimCommand | Create Preview Surface Texture Material undoable **Command**. | | CreatePrimCommand | Create primitive undoable **Command**. It is same as `CreatePrimWithDefaultXformCommand`. | | CreatePrimCommandBase | Base class to create a prim (and remove when undo) | | CreatePrimWithDefaultXformCommand | Create primitive undoable **Command**. | | CreatePrimsCommand | Create multiple primitives undoable **Command**. | | CreateReferenceCommand | Create reference undoable **Command**. | | CreateShaderPrimFromSdrCommand | Load the shader specified by ‘identifier’ from the SDR registry and create and a shader prim under | | CreateUsdAttributeCommand | Create USD Attribute **Command**. | | CreateUsdAttributeOnPathCommand | Create USD Attribute **Command**. | | DeletePrimsCommand | Delete primitives undoable **Command**. | | FramePrimsCommand | Transform a primitive to encompass the bounds of a list of paths. | - **GroupPrimsCommand**: Group primitive undoable **Command**. - **MovePrimCommand**: Move primitive undoable **Command**. - **MovePrimsCommand**: Move primitives undoable **Command**. - **ParentPrimsCommand**: Base class for all **Commands**. - **PayloadCommandBase**: Base class for all **Commands**. - **ReferenceCommandBase**: Base class for all **Commands**. - **RelationshipTargetBase**: Base class for all **Commands**. - **RemovePayloadCommand**: Base class for all **Commands**. - **RemovePropertyCommand**: Remove Property **Command**. - **RemoveReferenceCommand**: Base class for all **Commands**. - **RemoveRelationshipTargetCommand**: Remove target from a relationship - **RenamePrimCommand**: Rename a primitive undoable **Command**. - **ReplacePayloadCommand**: Base class for all **Commands**. - **ReplaceReferenceCommand**: Base class for all **Commands**. - **ReplaceReferencesCommand**: Clears/Add references undoable **Command**. - **SelectPrimsCommand**: Select primitives undoable **Command**. - **SetMaterialStrengthCommand**: Set material binding strength undoable **Command**. - **SetPayLoadLoadSelectedPrimsCommand**: Base class for all **Commands**. - **SetRelationshipTargetsCommand**: Set target(s) to a relationship - **ToggleActivePrimsCommand**: Undoable command to toggle the active state of prims. - **TogglePayLoadLoadSelectedPrimsCommand**: Base class for all **Commands**. | Command Name | Description | |--------------|-------------| | ToggleVisibilitySelectedPrimsCommand | Toggles the visibility of the selected primitives undoable **Command**. | | TransformPrimCommand | Transform primitive undoable **Command**. | | TransformPrimSRTCommand | Transform primitive undoable **Command**. | | TransformPrimsCommand | Transform multiple primitives undoable **Command**. | | TransformPrimsSRTCommand | Transform multiple primitives undoable **Command**. | | UngroupPrimsCommand | Ungroup primitive undoable **Command**. | | UnhideAllPrimsCommand | Base class for all **Commands**. | | UnparentPrimsCommand | Base class for all **Commands**. | | UsdStageHelper | Keeps the stage ID or returns the stage from the current context |
4,819
omni.usd.commands.ClearCurvesSplitsOverridesCommand.md
# ClearCurvesSplitsOverridesCommand ## ClearCurvesSplitsOverridesCommand ```python class ClearCurvesSplitsOverridesCommand(Command): ``` Clear Curves Splits Overrides Command. ### Methods | Name | Description | | --- | --- | | `do()` | | ```python def __init__(self): ```
277
omni.usd.commands.ClearRefinementOverridesCommand.md
# ClearRefinementOverridesCommand ## ClearRefinementOverridesCommand Bases: `Command` Clear Refinement Overrides **Command**. ### Methods - `__init__()` - `do()` - `undo()` #### `__init__()` ```
200
omni.usd.commands.CopyPrimCommand.md
# CopyPrimCommand ## CopyPrimCommand ```python class omni.usd.commands.CopyPrimCommand: def __init__( path_from: str, path_to: Optional[str] = None, duplicate_layers: bool = False, combine_layers: bool = False, exclusive_select: bool = True, usd_context_name: str = None ): ``` <span class="n"> <span class="pre"> str <span class="w"> <span class="o"> <span class="pre"> = <span class="w"> <span class="default_value"> <span class="pre"> '' , <em class="sig-param"> <span class="n"> <span class="pre"> flatten_references <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> bool <span class="w"> <span class="o"> <span class="pre"> = <span class="w"> <span class="default_value"> <span class="pre"> False , <em class="sig-param"> <span class="n"> <span class="pre"> copy_to_introducing_layer <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> bool <span class="w"> <span class="o"> <span class="pre"> = <span class="w"> <span class="default_value"> <span class="pre"> False ) <a class="headerlink" href="#omni.usd.commands.CopyPrimCommand" title="Permalink to this definition">  <dd> <p> Bases: <code> Command <p> Copy primitive undoable <strong> Command . <dl class="field-list simple"> <dt class="field-odd"> Parameters <dd class="field-odd"> <ul class="simple"> <li> <p> <strong> path_from ( <em> str ) – Path to copy from. <li> <p> <strong> path_to ( <em> str ) – Path to copy to. If `None` next free path is generated. <li> <p> <strong> duplicate_layers ( <em> bool ) – Duplicate layers on copy. <li> <p> <strong> combine_layers ( <em> bool ) – Combine layers on copy. When it’s in omni.usd.LayerEditMode.AUTO_AUTHORING mode, this will always be true. <li> <p> <strong> exclusive_select ( <em> bool ) – If to exclusively select (clear old selections) the newly create object. <li> <p> <strong> flatten_references ( <em> bool ) – Flatten references during copy. It’s only valid when combine_layers is True, and not in AUTO_AUTHORING mode. <li> <p> <strong> copy_to_introducing_layer ( <em> bool ) – If to copy it to the introducing layer, or the current edit target. By default, it’s current edit target. <p class="rubric"> Methods <table class="autosummary longtable docutils align-default"> <colgroup> <col style="width: 10%"/> <col style="width: 90%"/> <tbody> <tr class="row-odd"> <td> <p> <code> __init__ (path_from[, path_to, ...]) <td> <p> <tr class="row-even"> <td> <p> <code> do () <td> <p> <tr class="row-odd"> <td> <p> <code> modify_callback_info (cb_type, cmd_args) <td> <p> Returns a dictionary of information to be passed to callbacks of the given type. <tr class="row-even"> <td> <p> <code> undo () <td> <p> <dl class="py method"> <dt class="sig sig-object py" id="omni.usd.commands.CopyPrimCommand.__init__"> <span class="sig-name descname"> <span class="pre"> __init__ <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> path_from <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> str , <em class="sig-param"> <span class="n"> <span class="pre"> path_to <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> Optional <span class="p"> <span class="pre"> [ <span class="pre"> str <span class="p"> <span class="pre"> ] <span class="w"> <span class="o"> <span class="pre"> = <span class="w"> <span class="default_value"> <span class="pre"> None , <em class="sig-param"> duplicate_layers: bool = False combine_layers: bool = False exclusive_select: bool = True usd_context_name: str = '' flatten_references: bool = False copy_to_introducing_layer: bool = False modify_callback_info(cb_type: str, cmd_args: Dict[str, Any]) -> Dict[str, Any] - Returns a dictionary of information to be passed to callbacks of the given type. - By default callbacks are passed a copy of the arguments which were passed to execute() when the command was invoked. This method can be overridden to modify that information for specific callback types. - Parameters - cb_type – Type of callback the information will be passed to. - args – A dictionary containing a copy of the arguments with which the command was invoked. This is a shallow copy so implementations may add, remove or replace dictionary elements but should not ## Function Documentation ### `register_callback_type` ``` register_callback_type(type: str) -> dict ``` #### Description Registers a new callback type. Once a callback type is registered, it can be used to register callbacks, and no other code can modify any of the objects contained within it. #### Returns A dictionary of information to be passed to callbacks of the specified type. ```
6,186
omni.usd.commands.CopyPrimsCommand.md
# CopyPrimsCommand ## Overview ```python class omni.usd.commands.CopyPrimsCommand: def __init__( self, paths_from: List[str], paths_to: Optional[List[str]] = None, duplicate_layers: bool = False, combine_layers: bool = False, flatten_references: bool = False ): pass ``` ### Parameters - `paths_from`: A list of strings representing the source paths. - `paths_to`: An optional list of strings representing the destination paths. Default is None. - `duplicate_layers`: A boolean indicating whether to duplicate layers. Default is False. - `combine_layers`: A boolean indicating whether to combine layers. Default is False. - `flatten_references`: A boolean indicating whether to flatten references. Default is False. <span class="o"> <span class="pre"> = <span class="w"> <span class="default_value"> <span class="pre"> False , <em class="sig-param"> <span class="n"> <span class="pre"> copy_to_introducing_layer <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> bool <span class="w"> <span class="o"> <span class="pre"> = <span class="w"> <span class="default_value"> <span class="pre"> False <span class="sig-paren"> )  <dd> <p> Bases: <code> Command <p> Copy multiple primitives undoable <strong> Command . <dl class="field-list simple"> <dt class="field-odd"> Parameters <dd class="field-odd"> <ul class="simple"> <li> <p> <strong> List <strong> [ <strong> str <strong> ] ( <em> paths_to ) – Paths to copy from. <li> <p> <strong> List <strong> [ <strong> str <strong> ] – Paths to copy to. If `None` or length smaller than paths_from, then next free path is generated for missing paths. <li> <p> <strong> duplicate_layers ( <em> bool ) – Duplicate layers on copy. <li> <p> <strong> combine_layers ( <em> bool ) – Combine layers on copy. <li> <p> <strong> flatten_references ( <em> bool ) – Flatten references during copy. It’s only valid when combine_layers is True, and not in AUTO_AUTHORING mode. <li> <p> <strong> copy_to_introducing_layer ( <em> bool ) – If to copy it to the introducing layer, or the current edit target. By default, it’s current edit target. Its’s valid only when combine_layers is true. <p class="rubric"> Methods <table class="autosummary longtable docutils align-default"> <colgroup> <col style="width: 10%"/> <col style="width: 90%"/> <tbody> <tr class="row-odd"> <td> <p> <code> __init__ (paths_from[, paths_to, ...]) <td> <p> <tr class="row-even"> <td> <p> <code> do () <td> <p> <tr class="row-odd"> <td> <p> <code> undo () <td> <p> <dl class="py method"> <dt class="sig sig-object py" id="omni.usd.commands.CopyPrimsCommand.__init__"> <span class="sig-name descname"> <span class="pre"> __init__ <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> paths_from <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> List <span class="p"> <span class="pre"> [ <span class="pre"> str <span class="p"> <span class="pre"> ] , <em class="sig-param"> <span class="n"> <span class="pre"> paths_to <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> Optional <span class="p"> <span class="pre"> [ <span class="pre"> List <span class="p"> <span class="pre"> [ <span class="pre"> str <span class="p"> <span class="pre"> ] <span class="p"> <span class="pre"> ] <span class="w"> <span class="o"> <span class="pre"> = <span class="w"> <span class="default_value"> <span class="pre"> None , <em class="sig-param"> <span class="n"> <span class="pre"> duplicate_layers <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> bool <span class="w"> <span class="o"> <span class="pre"> = <span class="w"> <span class="default_value"> <span class="pre"> False , <em class="sig-param"> <span class="n"> <span class="pre"> combine_layers :bool = False , :flatten_references:bool = False , :copy_to_introducing_layer:bool = False
5,620
omni.usd.commands.CreateAudioPrimFromAssetPathCommand.md
# CreateAudioPrimFromAssetPathCommand ## CreateAudioPrimFromAssetPathCommand ``` class omni.usd.commands.CreateAudioPrimFromAssetPathCommand(usd_context: omni.usd.UsdContext, path_to: Path, asset_path: str, select_prim: bool = True) ``` Bases: `CreatePrimCommandBase` Create reference undoable **Command**. It creates a new Audio prim. ### Parameters - **usd_context** (omni.usd.UsdContext) – UsdContext this command to run on. - **path_to** (Sdf.Path) – Path to create a new prim. - **asset_path** (str) – The asset path to create the prim from. - **select_prim** (bool) – Whether to select the new prim after creation. Default is True. ``` **asset_path** (*str*) – The asset it’s necessary to add to references. **select_prim** (*bool*) – = True, Whether to select the newly created UsdPrim or not. ### Methods | Method | Description | | --- | --- | | `__init__(usd_context, path_to, asset_path[, ...])` | | | `do()` | | #### __init__(usd_context: UsdContext, path_to: Path, asset_path: str, select_prim: bool = True) ```
1,035
omni.usd.commands.CreateDefaultXformOnPrimCommand.md
# CreateDefaultXformOnPrimCommand ## CreateDefaultXformOnPrimCommand ``` class omni.usd.commands.CreateDefaultXformOnPrimCommand(prim_path: str, stage: Stage) ``` **Bases:** `Command` Create DefaultXform On Prim undoable **Command**. **Parameters** - **prim_path** (str) – Path of the primitive to be create xform attribtues **Methods** - `__init__(prim_path, stage)` - `do()` - `undo()` ``` : str , stage : Stage )
422
omni.usd.commands.CreateInstanceCommand.md
# CreateInstanceCommand ## CreateInstanceCommand ```python class omni.usd.commands.CreateInstanceCommand(path_from: str) ``` **Bases:** `Command` Instance primitive undoable **Command**. It creates a new prim, adds the master object to references, and flags this prim as instanceable. If the prim is Xform, this command copies the transforms from the current frame. If the source prim is already instanceable, it tries to find master prim of this prim and uses it, so it’s perfectly safe to press Ctrl-I multiple times. **Parameters:** - **path_from** (str) – Path to instance from. **Methods:** - `__init__(path_from)` - `do()` - `undo()` ``` <section name="omni.usd.commands"> <dl class="function"> <dt id="omni.usd.commands.CreateInstanceCommand.__init__"> <em> <span class="pre">def <span class="pre">__init__ <span class="sig-paren">( <span class="pre">self <span class="sig-paren">, <span class="pre">usd_prim <span class="sig-paren">: <span class="pre">Usd.Prim <span class="sig-paren">) <span class="pre">-> <span class="pre">None <span class="sig-paren">: <span class="pre"> str <dd>
1,260
omni.usd.commands.CreateInstancesCommand.md
# CreateInstancesCommand ## CreateInstancesCommand Instance multiple primitives undoable **Command**. ### Parameters - **List** **[str]** (paths_from) – Paths to instance from. ### Methods | Method | Description | |--------|-------------| | `__init__(paths_from)` | | | `do()` | | | `undo()` | | List [ str ]
316
omni.usd.commands.CreateMdlMaterialPrimCommand.md
# CreateMdlMaterialPrimCommand ## Overview The `CreateMdlMaterialPrimCommand` class is a part of the `omni.usd.commands` module. This class is used to create a new MDL material prim. ## Class Definition ```python class omni.usd.commands.CreateMdlMaterialPrimCommand: def __init__( self, mtl_url: str, mtl_name: str, mtl_path: str, select_new_prim: bool = False, stage: Optional[Stage] = None, context_name: Optional[str] = None ): # Class implementation details ``` ### Parameters - `mtl_url`: The URL of the material. - `mtl_name`: The name of the material. - `mtl_path`: The path where the material prim will be created. - `select_new_prim`: A boolean indicating whether to select the new prim after creation. Default is `False`. - `stage`: An optional Stage object. If not provided, the current stage will be used. - `context_name`: An optional string representing the context name. ## Usage To use this class, you need to instantiate it with the required parameters and call its methods as needed. ```python # Example usage cmd = omni.usd.commands.CreateMdlMaterialPrimCommand( mtl_url="http://example.com/material.mdl", mtl_name="MyMaterial", mtl_path="/World/Materials/MyMaterial", select_new_prim=True ) cmd.execute() ``` ## Notes - Ensure that the `mtl_url` is accessible and the material file exists at the specified URL. - The `mtl_path` should be a valid path within the USD stage. - If `select_new_prim` is set to `True`, the newly created prim will be selected in the viewport. ## CreateMdlMaterialPrimCommand ### Bases - Command - UsdStageHelper ### Description Create Mdl Material undoable **Command**. ### Parameters - **mtl_url** (str) – - **mtl_name** (str) – - **mtl_path** (str) – - **select_new_prim** (bool) – - **stage** (Optional[Usd.Stage]) – Stage to operate. Optional. - **context_name** (Optional[str]) – The usd context to operate. Optional. ### Methods - `__init__(mtl_url, mtl_name, mtl_path, select_new_prim=False, stage=None, context_name=None)` - `do()` - `undo()` None )
2,108
omni.usd.commands.CreateMtlxMaterialPrimCommand.md
# CreateMtlxMaterialPrimCommand ## Overview The `CreateMtlxMaterialPrimCommand` class is a part of the `omni.usd.commands` module. This class is used to create a material prim from a mtlx file. ### Parameters - **mtlx_url** (`str`): The URL of the mtlx file. - **base_path** (`str`): The base path for the mtlx file. - **select_new_prim** (`bool`): A boolean indicating whether to select the new prim. Default is `False`. - **stage** (`Optional[Stage]`): The stage where the prim will be created. Default is `None`. - **context_name** (`Optional[str]`): The context name for the operation. Default is `None`. ### Usage ```python # Example usage of CreateMtlxMaterialPrimCommand from omni.usd.commands import CreateMtlxMaterialPrimCommand command = CreateMtlxMaterialPrimCommand( mtlx_url="path/to/mtlx/file.mtlx", base_path="base/path", select_new_prim=True, stage=some_stage, context_name="context_name" ) ``` This command will create a new material prim from the specified mtlx file and place it on the given stage. If `select_new_prim` is set to `True`, the newly created prim will be selected. Bases: ```python Command ``` , ```python UsdStageHelper ``` Create MaterialX Material undoable **Command**. Field List: - Parameters - **mtlx_url** (str) – - **base_path** (str) – - **select_new_prim** (bool) – - **stage** (Usd.Stage) – Stage to operate. Optional. - **context_name** (str) – The usd context to operate. Optional. Methods: - `__init__(mtlx_url, base_path[, ...])` - `do()` - `undo()` Method Details: ```python __init__(mtlx_url: str, base_path: str, select_new_prim: bool = False, stage: Optional[Stage] = None, context_name: Optional[str] = None) ``` ```
1,711
omni.usd.commands.CreatePayloadCommand.md
# CreatePayloadCommand ## Description ```python class omni.usd.commands.CreatePayloadCommand: def __init__( usd_context: omni.usd.UsdContext, path_to: Path, asset_path: Optional[str] = None, prim_path: Optional[Path] = None, instanceable: bool = True, select_prim: bool = True ) ``` ## Attributes - **usd_context** (*omni.usd.UsdContext*): The USD context. - **path_to** (*Path*): The path to the payload. - **asset_path** (*Optional\[str\]*): The path to the asset, optional. - **prim_path** (*Optional\[Path\]*): The primary path, optional. - **instanceable** (*bool*): Whether the prim is instanceable, default is True. - **select_prim** (*bool*): Whether to select the prim, default is True. ## CreatePayloadCommand ### Description Create payload undoable **Command**. It creates a new prim and adds the asset and path as payloads. ### Bases - `CreatePrimCommandBase` ### Parameters - **usd_context** (`omni.usd.UsdContext`) – UsdContext this command to run on. - **path_to** (`Sdf.Path`) – Path to create a new prim. - **asset_path** (`str`) – The asset it’s necessary to add to payloads. - **prim_path** (`Sdf.Path`) – The prim in asset to payload. - **instanceable** (`bool`) – Whether to set the prim instanceable. It works together with `/persistent/app/stage/instanceableOnCreatingReference` setting. - **select_prim** (`bool`) – = True, Whether to select the newly created UsdPrim or not. ### Methods - `__init__(usd_context, path_to, [asset_path=None], [prim_path=None], instanceable=True, select_prim=True)` - `do()` - `undo()` <dl class="method"> <dt class="sig sig-object" id="omni.usd.commands.CreatePayloadCommand.__init__"> <em class="sig-param"> <span class="n"> <span class="pre"> self <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> omni.usd.commands.CreatePayloadCommand <span class="w"> <span class="o"> <span class="pre"> = <span class="w"> <span class="default_value"> <span class="pre"> None , <em class="sig-param"> <span class="n"> <span class="pre"> enable_prim <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> bool <span class="w"> <span class="o"> <span class="pre"> = <span class="w"> <span class="default_value"> <span class="pre"> True , <em class="sig-param"> <span class="n"> <span class="pre"> select_prim <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> bool <span class="w"> <span class="o"> <span class="pre"> = <span class="w"> <span class="default_value"> <span class="pre"> True ) <dd>
3,384
omni.usd.commands.CreatePreviewSurfaceMaterialPrimCommand.md
# CreatePreviewSurfaceMaterialPrimCommand ## CreatePreviewSurfaceMaterialPrimCommand ```python class omni.usd.commands.CreatePreviewSurfaceMaterialPrimCommand(mtl_path: str, shader_prim_name: str = 'Shader', select_new_prim: bool = False) ``` Bases: `Command` Create Preview Surface Material undoable **Command**. ### Parameters - **mtl_path** (str) – The material path to create. - **shader_prim_name** (str) – The name of the root shader prim. Optional - **select_new_prim** (bool) – Optional ### Methods - `__init__` ``` | 操作 | 描述 | |------|------| | `do` | () | | `undo` | () | ```python __init__(mtl_path: str, shader_prim_name: str = 'Shader', select_new_prim: bool = False) ```
691
omni.usd.commands.CreatePreviewSurfaceTextureMaterialPrimCommand.md
# CreatePreviewSurfaceTextureMaterialPrimCommand ## CreatePreviewSurfaceTextureMaterialPrimCommand ```python class omni.usd.commands.CreatePreviewSurfaceTextureMaterialPrimCommand(mtl_path, select_new_prim: bool = False) ``` Bases: `Command` Create Preview Surface Texture Material undoable **Command**. ### Parameters - **mtl_path** (str) – - **select_new_prim** (bool) – ### Methods - `__init__(mtl_path[, select_new_prim])` - `do()` - `undo()` ``` __init__(mtl_path, select_new_prim: bool = False)
506
omni.usd.commands.CreatePrimCommand.md
# CreatePrimCommand ## Overview The `CreatePrimCommand` class is a part of the `omni.usd.commands` module. This class is used to create a new primitive in the scene. ## Class Definition ```python class omni.usd.commands.CreatePrimCommand(prim_type: str, prim_path: Optional[str] = None, select_new_prim: bool = True, attributes: Dict[str, Any] = {}, create_default_xform: bool = True) ``` ### Parameters - **prim_type** (`str`): The type of the primitive to be created. - **prim_path** (`Optional[str]`): The path where the primitive will be created. Default is `None`. - **select_new_prim** (`bool`): Whether to select the newly created primitive. Default is `True`. - **attributes** (`Dict[str, Any]`): A dictionary of attributes to be assigned to the primitive. Default is an empty dictionary `{}`. - **create_default_xform** (`bool`): Whether to create a default xform for the primitive. Default is `True`. ### omni.usd.commands.CreatePrimCommand **Parameters** - **prim_type** (`str`) – Primitive type, e.g. “Sphere”, “Cube” etc. - **prim_path** (`Optional[str]`) – Path of the primitive to be created at. If None is provided, it will be placed at stage root or under default prim using Type name. - **select_new_prim** (`bool`) – Whether to select the prim after it’s created. - **attributes** (`Dict[str, Any]`) – optional attributes dict to set after creation. **Methods** - `__init__(prim_type, prim_path=None, select_new_prim=True, attributes=None)` **Description** Create primitive undoable **Command**. It is same as `CreatePrimWithDefaultXformCommand`. Kept for backward compatibility. **Bases** - `CreatePrimWithDefaultXformCommand` **Parameters:** - `prim_path`: str - default value: {} - `create_default_xform`: bool - default value: True - `stage`: Optional[Stage] - default value: None - `context_name`: Optional[str] - default value: None
1,878
omni.usd.commands.CreatePrimCommandBase.md
# CreatePrimCommandBase ## Overview Base class to create a prim (and remove when undo) ### Parameters - **usd_context** (`omni.usd.UsdContext`) – UsdContext this command to run on. - **path_to** (`Sdf.Path`) – Path to create a new prim. - **asset_path** (`str`) – The asset it’s necessary to add to references. - **select_prim** (`bool = True`) – (Default is True) ## Methods | Method | Description | | --- | --- | | `__init__(usd_context, path_to, asset_path[, ...])` | | | `do()` | | | `undo()` | | ### __init__(usd_context, path_to, asset_path, select_prim=True) - `usd_context`: [UsdContext](../omni.usd/omni.usd.UsdContext.html#omni.usd.UsdContext) - `path_to`: Path - `asset_path`: str - `select_prim`: bool = True
729
omni.usd.commands.CreatePrimsCommand.md
# CreatePrimsCommand ## CreatePrimsCommand ```python class omni.usd.commands.CreatePrimsCommand(prim_types: List[str], usd_context_name: Optional[str] = None) ``` **Bases:** `Command` Create multiple primitives undoable **Command**. Example of command which calls other commands. Undo/Redo grouping handled automatically. **Parameters** - **prim_types** (`List[str]`) – List of primitive types to create, e.g [“Sphere”, “Cone”]. **Methods** - `__init__(prim_types[, usd_context_name])` ``` | do | | --- | | undo | __init__(prim_types: List[str], usd_context_name: Optional[str] = None)
595
omni.usd.commands.CreatePrimWithDefaultXformCommand.md
# CreatePrimWithDefaultXformCommand ## Overview The `CreatePrimWithDefaultXformCommand` class is a part of the `omni.usd.commands` module. It is used to create a prim with a default xform. ### Class Definition ```python class omni.usd.commands.CreatePrimWithDefaultXformCommand(prim_type: str, prim_path: Optional[str] = None, select_new_prim: bool = True, attributes: Dict[str, Any] = {}, create_default_xform: bool = True) ``` ### Parameters - **prim_type** (`str`): The type of the prim to be created. - **prim_path** (`Optional[str]`): The path where the prim should be created. Defaults to `None`. - **select_new_prim** (`bool`): Whether to select the newly created prim. Defaults to `True`. - **attributes** (`Dict[str, Any]`): A dictionary of attributes to be set on the prim. Defaults to an empty dictionary. - **create_default_xform** (`bool`): Whether to create a default xform for the prim. Defaults to `True`. ### Usage Here is an example of how to use the `CreatePrimWithDefaultXformCommand` class: ```python from omni.usd.commands import CreatePrimWithDefaultXformCommand # Create a cube at the root path with default xform and select it CreatePrimWithDefaultXformCommand(prim_type="Cube", prim_path="/", select_new_prim=True, attributes={"size": 1.0}, create_default_xform=True) ``` This will create a cube at the root path with a default xform and select it for further operations. ### Parameters - **prim_type** (str) – Primitive type, e.g. "Sphere", "Cube" etc. - **prim_path** (Optional[str]) – Path of the primitive to be created at. If None is provided, it will be placed at stage root or under default prim using Type name. - **select_new_prim** (bool) – Whether to select the prim after it’s created. - **attributes** (Dict[str, object]) – optional attributes dict to set after creation. ### Methods - **__init__(prim_type[, prim_path, select_new_prim=True, attributes=None])** - **do()** - **undo()** attributes : Dict[str, Any] = {} create_default_xform = True stage : Optional[Stage] = None context_name : Optional[str] = None
2,064
omni.usd.commands.CreateReferenceCommand.md
# CreateReferenceCommand ## Overview The `CreateReferenceCommand` class is a part of the `omni.usd.commands` module, which is used to create references in the USD (Universal Scene Description) context. ## Class Definition ``` class omni.usd.commands.CreateReferenceCommand(usd_context: omni.usd.UsdContext, path_to: Path, asset_path: Optional[str] = None, prim_path: Optional[Path] = None, instanceable: bool = True) ``` ### Parameters - `usd_context`: An instance of `omni.usd.UsdContext` which provides the USD context. - `path_to`: A `Path` object specifying the path where the reference should be created. - `asset_path`: An optional string specifying the path to the asset to be referenced. Default is `None`. - `prim_path`: An optional `Path` object specifying the path to the prim. Default is `None`. - `instanceable`: A boolean indicating whether the prim should be instanceable. Default is `True`. ``` ## CreateReferenceCommand ### Bases - `CreatePrimCommandBase` ### Description Create reference undoable **Command**. It creates a new prim and adds the asset and path as references. ### Parameters - **usd_context** (`omni.usd.UsdContext`) – UsdContext this command to run on. - **path_to** (`Sdf.Path`) – Path to create a new prim. - **asset_path** (`str`) – The asset it’s necessary to add to references. - **prim_path** (`Sdf.Path`) – The prim in asset to reference. - **instanceable** (`bool`) – Whether to set the prim instanceable. It works together with `/persistent/app/stage/instanceableOnCreatingReference` setting. - **select_prim** (`bool`) – = True, Whether to select the newly created UsdPrim or not. ### Methods - `__init__(usd_context, path_to, [asset_path=None], [prim_path=None], [instanceable=None], [select_prim=True])` - `do()` - `undo()` bool : bool = True, select_prim : bool = True
1,825
omni.usd.commands.CreateShaderPrimFromSdrCommand.md
# CreateShaderPrimFromSdrCommand ## Overview The `CreateShaderPrimFromSdrCommand` class is a part of the `omni.usd.commands` module. This class is used to create a shader primitive from an SDR (Shader Descriptor) command. ## Class Definition ```python class omni.usd.commands.CreateShaderPrimFromSdrCommand: def __init__(self, parent_path: str, identifier: str, name: Optional[str] = None, select_new_prim: bool = False, stage_or_context: Optional[Union[str, Stage, UsdContext]] = None): ``` ### Parameters - `parent_path` (str): The path of the parent prim. - `identifier` (str): The identifier for the new prim. - `name` (Optional[str]): The name of the new prim. Default is None. - `select_new_prim` (bool): If True, select the newly created prim. Default is False. - `stage_or_context` (Optional[Union[str, Stage, UsdContext]]): The stage or context where the prim is created. Default is None. ## Usage Here is an example of how to use the `CreateShaderPrimFromSdrCommand` class: ```python from omni.usd.commands import CreateShaderPrimFromSdrCommand # Create a new shader prim command = CreateShaderPrimFromSdrCommand("/path/to/parent", "shader_identifier") command.execute() ``` This will create a new shader primitive under the specified parent path with the given identifier. ## CreateShaderPrimFromSdrCommand ### Bases: - `Command` ### Description: Load the shader specified by ‘identifier’ from the SDR registry and create and a shader prim under the location specified by parent_path. The parent location must be of type UsdShade.Material or UsdShade.NodeGraph. ### Parameters: - **parent_path** (str) – The path of the parent UsdShade.Material or UsdShade.NodeGraph. - **identifier** (str) – The identifer of the node Sdr registry which will be used to define the shader. - **name** (str) – The name of the UsdShade.Shader prim to be created, if empty identifier will be used. Optional. - **select_new_prim** (bool) – Optional. - **stage_or_context** – (Union[str, Usd.Stage, omni.usd.UsdContext]): Stage or UsdContext applies the changes to. It can be instance of Usd.Stage or omni.usd.UsdContext, or context name. By default, it will apply the changes to the stage in default UsdContext. ### Methods: - `__init__(parent_path, identifier[, name, ...])` - `do()` - `undo()` ### Detailed Method Description: - `__init__(parent_path: str, identifier: str, name: Optional[str] = None, select_new_prim: bool = False, stage_or_context: Optional[Union[str, Stage, omni.usd.UsdContext]] = None)` , UsdContext ] ] = None )
2,552
omni.usd.commands.CreateUsdAttributeCommand.md
# CreateUsdAttributeCommand ## CreateUsdAttributeCommand ```python class omni.usd.commands.CreateUsdAttributeCommand(prim: Prim, attr_name: str, attr_type: ValueTypeName, custom: bool = True, variability: Variability = Sdf.VariabilityVarying, attr_value: Optional[Any] = None) ``` This class represents a command to create a USD attribute. ### Parameters - **prim** (`Prim`): The prim on which to create the attribute. - **attr_name** (`str`): The name of the attribute. - **attr_type** (`ValueTypeName`): The type of the attribute. - **custom** (`bool`, optional): Whether the attribute is custom. Default is `True`. - **variability** (`Variability`, optional): The variability of the attribute. Default is `Sdf.VariabilityVarying`. - **attr_value** (`Optional[Any]`, optional): The initial value of the attribute. Default is `None`. Bases: ```python Command ``` Create USD Attribute **Command**. Parameters: - **prim** (`Usd.Prim`) – Usd.Prim that will get a new attribute. - **attr_name** (`str`) – New attribute’s name. - **attr_type** (`Sdf.ValueTypeName`) – New attribute’s type. - **custom** (`bool`) – If the attribute is custom. - **variability** (`Sdf.Variability`) – whether the attribute may vary over time and value coordinates, and if its value comes through authoring or from its owner. - **attr_value** (`Any`, optional) – New attribute’s value. Leave it as None to use default value. Example of usage: ```python omni.kit.commands.execute("CreateUsdAttribute", prim=prim, attr_name="custom", attr_type=Sdf.ValueTypeNames.Double3) ``` Methods: - `__init__(prim: Prim, attr_name: str, attr_type: ValueTypeName, custom: bool = True, variability: Variability = Sdf.VariabilityVarying, attr_value: Optional[Any] = None)` - `do()` - `undo()` # 欢迎来到我的网站 ## 关于我们 我们是一个专业的团队,致力于提供高质量的服务。 ### 服务内容 - 服务1 - 服务2 ## 联系我们 - 邮箱:contact@example.com - 电话:1234567890 ## 版权信息 © 2023 我的网站
1,899
omni.usd.commands.CreateUsdAttributeOnPathCommand.md
# CreateUsdAttributeOnPathCommand ## Overview The `CreateUsdAttributeOnPathCommand` class is a part of the `omni.usd.commands` module. It is used to create a USD attribute on a specified path. ## Class Definition ```python class omni.usd.commands.CreateUsdAttributeOnPathCommand(attr_path: Union[Path, str], attr_type: ValueTypeName, custom: bool = True, variability: Variability = Sdf.VariabilityVarying, attr_value: Optional[Any] = None) ``` ### Parameters - **attr_path** (`Union[Path, str]`): The path where the attribute will be created. - **attr_type** (`ValueTypeName`): The type of the attribute to be created. - **custom** (`bool`, optional): Indicates if the attribute is custom. Default is `True`. - **variability** (`Variability`, optional): The variability of the attribute. Default is `Sdf.VariabilityVarying`. - **attr_value** (`Optional[Any]`, optional): The initial value of the attribute. Default is `None`. <em class="sig-param"> <span class="n"> <span class="pre"> usd_context_name <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> str <span class="w"> <span class="o"> <span class="pre"> = <span class="w"> <span class="default_value"> <span class="pre"> '' <span class="sig-paren"> ) <dd> <p> Bases: <code class="xref py py-class docutils literal notranslate"> <span class="pre"> Command <p> Create USD Attribute <strong> Command . <dl class="field-list simple"> <dt class="field-odd"> Parameters <dd class="field-odd"> <ul class="simple"> <li> <p> <strong> attr_path ( <em> Union <em> [ <em> Sdf.Path <em> , <em> str <em> ] ) – Path to the new attribute to be created. The prim of this path must already exist. <li> <p> <strong> attr_type ( <em> Sdf.ValueTypeName ) – New attribute’s type. <li> <p> <strong> custom ( <em> bool ) – If the attribute is custom. <li> <p> <strong> variability ( <em> Sdf.Variability ) – whether the attribute may vary over time and value coordinates, and if its value comes through authoring or from its owner. <li> <p> <strong> attr_value ( <em> Any <em> , <em> optional ) – New attribute’s value. Leave it as None to use default value. <li> <p> <strong> usd_context_name ( <em> str ) – Name of the usd context to execute the command on. <dl class="simple"> <dt> Example of usage: <dd> <dl class="simple"> <dt> omni.kit.commands.execute(“CreateUsdAttribute”, <dd> <p> prim=prim, attr_name=”custom”, attr_type=Sdf.ValueTypeNames.Double3) <p class="rubric"> Methods <table class="autosummary longtable docutils align-default"> <colgroup> <col style="width: 10%"/> <col style="width: 90%"/> <tbody> <tr class="row-odd"> <td> <p> <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> __init__ (attr_path, attr_type[, custom, ...]) <td> <p> <tr class="row-even"> <td> <p> <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> do () <td> <p> <tr class="row-odd"> <td> <p> <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> undo () <td> <p> <dl class="py method"> <dt class="sig sig-object py" id="omni.usd.commands.CreateUsdAttributeOnPathCommand.__init__"> <span class="sig-name descname"> <span class="pre"> __init__ <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> attr_path <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> Union <span class="p"> <span class="pre"> [ <span class="pre"> Path <span class="p"> <span class="pre"> , <span class="w"> <span class="pre"> str <span class="p"> <span class="pre"> ] , <em class="sig-param"> <span class="n"> <span class="pre"> attr_type <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> ValueTypeName , <em class="sig-param"> <span class="n"> <span class="pre"> custom <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> bool <span class="w"> <span class="o"> <span class="pre"> = <span class="w"> <span class="default_value"> <span class="pre"> True , <em class="sig-param"> <span class="n"> <span class="pre"> variability <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> Variability <span class="w"> <span class="o"> <span class="pre"> = <span class="w"> <span class="default_value"> Sdf.VariabilityVarying, attr_value: Optional[Any] = None, usd_context_name: str = ''
6,107
omni.usd.commands.DeletePrimsCommand.md
# DeletePrimsCommand ## DeletePrimsCommand ```pre Command ``` , ```pre UsdStageHelper ``` Delete primitives undoable **Command**. **Parameters** - **paths** (**List**[**str**]) – Paths to prims to delete. - **destructive** – - If it’s false, the delete will only happen in the current target, and follows: 1. If the prim spec is a def, it will remove the prim spec. 2. If the prim spec is a over, it will only deactivate this prim. 3. If the prim spec is not existed, it will create over prim and deactivate it. 4. If there is an overridden in a stronger layer, it will report errors. - If it’s true, it will remove all prim specs in all local layers. - By default, it’s True and means the delete operation is destructive for back-compatibility. - **stage** (**Usd.Stage**) – Stage to operate. Optional. - **context_name** (**str**) – The usd context to operate. Optional. **Methods** - ```pre __init__ ``` (paths[, destructive, stage, ...]) - ```pre do ``` () - ```pre undo ``` () **__init__** (paths: List[Union[str, Path]], destructive=True, stage: Optional[Stage]=None, context_name: Optional[str]=None)
1,134
omni.usd.commands.ensure_parents_are_active.md
# ensure_parents_are_active ## ensure_parents_are_active ```python omni.usd.commands.ensure_parents_are_active(stage, path) ``` OM-70901: It will ensure parents are active. If they are not, it will change the active flag into active, and instead all of their children will be marked to inactive. This is normally used when it’s to create materials under /World/Looks, as it’s possible /World/Looks is deactivated. While creating a prim under an inactive parent will throw exceptions by USD.
492
omni.usd.commands.FramePrimsCommand.md
# FramePrimsCommand ## FramePrimsCommand ### FramePrimsCommand ### Parameters - **prim_to_move** – Path to the primitive that is being moved. - **prims_to_frame** (Sequence[Union[str, Sdf.Path]]) – Sequence of primitives to use to calculate the bounds to frame. - **time_code** (Usd.TimeCode) – Timecode to set values at. - **usd_context_name** (str) – Name of the usd context to work on. - **aspect_ratio** (float) – Width / Height of the final image. - **use_horizontal_fov** (Optional[bool]) – Whether to use a camera’s horizontal or vertical field of view for framing. - **horizontal_fov** (float) – Default horizontal field-of-view to use for framing if one cannot be calculated. - **zoom** (float) – Final zoom in or out of the framed box. Values above 0.5 move further away and below 0.5 go closer. ### Methods - `__init__(prim_to_move[, prims_to_frame, ...])` - `do()` - `undo()` __init__( prim_to_move: Union[str, Path], prims_to_frame: Optional[Sequence[Union[str, Path]]] = None, time_code: Optional[TimeCode] = None, usd_context_name: str = '', aspect_ratio: float = 1, use_horizontal_fov: Optional[bool] = None, zoom: float = 0.45, horizontal_fov: float = 0.20656116130367255 )
1,212
omni.usd.commands.Functions.md
# omni.usd.commands Functions ## Functions Summary: | Function | Description | |----------|-------------| | [active_edit_context](#) | | | [ensure_parents_are_active](#) | OM-70901: It will ensure parents are active. If they are not, it will change the active | | [get_default_camera_rotation_order_str](#) | | | [get_default_rotation_order_str](#) | | | [get_default_rotation_order_type](#) | | | [post_notification](#) | | | [prim_can_be_removed_without_destruction](#) | A destructive remove is one that will not only edit current edit target, | | [remove_prim_spec](#) | Removes prim spec from layer. | | [write_refinement_override_enabled_hint](#) | |
664
omni.usd.commands.get_default_rotation_order_type.md
# get_default_rotation_order_type ## get_default_rotation_order_type ```python omni.usd.commands.get_default_rotation_order_type(is_camera: bool = False) ``` This function retrieves the default rotation order type. ```
220
omni.usd.commands.GroupPrimsCommand.md
# GroupPrimsCommand ## Class Definition ```python class omni.usd.commands.GroupPrimsCommand(prim_paths: List[Union[str, Path]], stage: Optional[Stage] = None, context_name: Optional[str] = None, destructive: bool = True) ``` ### Parameters - **prim_paths**: List of prim paths, which can be strings or Path objects. - **stage**: Optional Stage object. Default is None. - **context_name**: Optional string for context name. Default is None. - **destructive**: Boolean indicating whether the operation is destructive. Default is True. ``` ### Description Bases: ``` # Command UsdStageHelper ## Group primitive undoable Command ### Parameters - **prim_paths** (List[str]) – Prim paths that will be grouped. - **stage** (Usd.Stage) – Stage to operate. Optional. - **context_name** (str) – The usd context to operate. Optional. - **destructive** (bool) – If it’s true, it will group all prims and remove original prims, which may edit other layers that are not edit target currently. If it’s false, all changes will made only to the current edit target without touching other layers. By default, it’s true for back compatibility. ## Methods | Method | Description | | ------ | ----------- | | `__init__(prim_paths[, stage, context_name, ...])` | | | `do()` | | | `undo()` | | ### `__init__(prim_paths: List[Union[str, Path]], stage: Optional[Stage] = None, context_name: Optional[str] = None, destructive: bool = True)` - **prim_paths**: List of strings or Paths. - **stage**: Optional Stage. Default is None. - **context_name**: Optional string. Default is None. - **destructive**: Default is True.
1,605
omni.usd.commands.MovePrimCommand.md
# MovePrimCommand ## MovePrimCommand ```python class omni.usd.commands.MovePrimCommand(path_from: Union[str, Path], path_to: Union[str, Path], time_code: TimeCode = Usd.TimeCode.Default(), keep_world_transform: bool = True, on_move_fn: Optional[Callable] = None) Move primitive undoable **Command**. Bases: `Command` Parameters: - **path_from** (str) – Path to move prim from. - **path_to** (str) – Path to move prim to. - **time_code** (Usd.TimeCode) – Current timecode of the stage. - **keep_world_transform** (bool) – True to keep world transform after prim path is moved. False to keep local transfrom only. - **on_move_fn** (Callable) – Function to call when prim is renamed - **destructive** (bool) – If it’s false, it will not remove original prim but deactivate it. By default, it’s true for back compatibility. - **stage_or_context** – (Union[str, Usd.Stage, omni.usd.UsdContext]): Stage or UsdContext applies the changes to. It can be instance of Usd.Stage or omni.usd.UsdContext, or context name. By default, it will apply the changes to the stage in default UsdContext. Methods: - `__init__(path_from, path_to[, time_code, ...])` - `do()` - `modify_callback_info(cb_type, cmd_args)` – Returns a dictionary of information to be passed to callbacks of the given type. - `undo()` ( source_path: Union[str, Path], path_to: Union[str, Path], time_code: TimeCode = Usd.TimeCode.Default(), keep_world_transform: bool = True, on_move_fn: Optional[Callable] = None, destructive: bool = True, stage_or_context: Optional[Union[str, Stage, UsdContext]] = None, resolve_reference: bool = True ) modify_callback_info( cb_type: str ) Returns a dictionary of information to be passed to callbacks of the given type. By default callbacks are passed a copy of the arguments which were passed to **execute()** when the command was invoked. This method can be overridden to modify that information for specific callback types. ### Parameters - **cb_type** – Type of callback the information will be passed to. - **args** – A dictionary containing a copy of the arguments with which the command was invoked. This is a shallow copy so implementations may add, remove or replace dictionary elements but should not modify any of the objects contained within it. ### Returns A dictionary of information to be passed to callbacks of the specified type.
2,383
omni.usd.commands.MovePrimsCommand.md
# MovePrimsCommand ## MovePrimsCommand MovePrimsCommand( paths_to_move: Dict[str, str], time_code: TimeCode = Usd.TimeCode.Default(), keep_world_transform: bool = True, destructive: bool = True, stage_or_context: Union[str, Stage, UsdContext] = None ) Bases: Command Move primitives undoable Command. Parameters: - paths_to_move (Dict[str, str]) – dictionary containing entry of path_from : path_to. - time_code (Usd.TimeCode) – Current timecode of the stage. - keep_world_transform (bool) – True to keep world transform after prim path is moved. False to keep local transform only. - destructive (bool) – If it’s false, it will not remove original prim but deactivate it. By default, it’s true for back compatibility. - stage_or_context – (Union[str, Stage, UsdContext]): Stage or UsdContext applies the changes to. It can be instance of Stage or UsdContext, or context name. By default, it will apply the changes to the stage in default UsdContext. Methods: - __init__(paths_to_move[, time_code, ...]) - do() - undo() , **on_move_fn** : Optional[Callable] = None, **destructive** = True, **stage_or_context** : Optional[Union[str, Stage, UsdContext]] = None )
1,186
omni.usd.commands.ParentPrimsCommand.md
# ParentPrimsCommand ## Class Definition ```python class omni.usd.commands.ParentPrimsCommand(parent_path: str, child_paths: List[str], on_move_fn: Optional[callable] = None, keep_world_transform: bool = True, stage_or_context: Optional[Union[str, Stage]] = None) ``` ### Parameters - **parent_path** (`str`): The path of the parent prim. - **child_paths** (`List[str]`): A list of paths for the child prims to be parented. - **on_move_fn** (`Optional[callable]`): An optional callback function to be executed during the move operation. - **keep_world_transform** (`bool`): If `True`, the world transform of the child prims will be preserved. - **stage_or_context** (`Optional[Union[str, Stage]]`): An optional stage or context for the operation. ## Methods ### `__init__` Move prims into children of "parent" primitives undoable **Command**. ### `do` ### `undo` ### Parameters - **parent_path** – prim path to become parent of child_paths - **child_paths** – prim paths to become children of parent_prim - **keep_world_transform** – If it needs to keep the world transform after parenting. - **stage_or_context** (Union[str, Usd.Stage, omni.usd.UsdContext]) – Stage or UsdContext applies the changes to. It can be instance of Usd.Stage or omni.usd.UsdContext, or context name. By default, it will apply the changes to the stage in default UsdContext.
1,356
omni.usd.commands.PayloadCommandBase.md
# PayloadCommandBase ## PayloadCommandBase ``` ```markdown class omni.usd.commands.PayloadCommandBase(stage, prim_path: Path, payload: Payload) ``` ```markdown Bases: Command ### Methods | Method | Description | | --- | --- | | `__init__(stage, prim_path, payload)` | | | `undo()` | | ``` ```markdown def __init__(stage, prim_path: Path, payload: Payload) ``` ```
371
omni.usd.commands.prim_can_be_removed_without_destruction.md
# prim_can_be_removed_without_destruction ## omni.usd.commands.prim_can_be_removed_without_destruction ```python omni.usd.commands.prim_can_be_removed_without_destruction(usd_context_or_stage, prim_path) ``` A destructive remove is one that will not only edit current edit target, but also other non-anonymous layers. Why anonymous layers is not counted is because anonymous layers are writable in Kit, and it’s only existed when it’s a new stage or under session layer. Any deltas inside those anonymous layers can be safely removed. Otherwise, this function will return false, which means it will not remove prim specs in all layers, but deactivates them to avoid editing non-anonymous layers except current edit target.
724
omni.usd.commands.RelationshipTargetBase.md
# RelationshipTargetBase ## RelationshipTargetBase ```python class omni.usd.commands.RelationshipTargetBase(relationship: Relationship, target: Path) ``` Bases: `Command` ### Methods | Method | Description | |--------|-------------| | `__init__(relationship: Relationship, target: Path)` | | | `undo()` | | ### `__init__(relationship: Relationship, target: Path)` ```
374
omni.usd.commands.RemovePayloadCommand.md
# RemovePayloadCommand ## RemovePayloadCommand ```python class omni.usd.commands.RemovePayloadCommand(stage, prim_path: Path, payload: Payload) ``` Bases: `PayloadCommandBase` ### Methods | Method | Description | |--------|-------------| | `__init__(stage, prim_path, payload)` | | | `do()` | | ```python def __init__(stage, prim_path: Path, payload: Payload) : Payload )
379
omni.usd.commands.RemovePropertyCommand.md
# RemovePropertyCommand ## Class Definition ```python class omni.usd.commands.RemovePropertyCommand(prop_path: Union[Path, str], usd_context_name: str = '', remove_from_layers: Optional[Union[List[Union[str, Layer]], str, Layer]] = None) ``` ## Description The `RemovePropertyCommand` class is used to remove a property from a USD (Universal Scene Description) object. It takes the following parameters: - `prop_path`: The path of the property to be removed. It can be a `Path` object or a string. - `usd_context_name`: The name of the USD context. It is a string and has a default value of an empty string. - `remove_from_layers`: An optional parameter specifying the layers from which the property should be removed. It can be a list of strings or `Layer` objects, a single string, or a `Layer` object. The default value is `None`. ## RemovePropertyCommand ### Bases ```python Command ``` ### Description Remove Property **Command**. ### Parameters - **prop_path** (str) – Path of the property to be removed. - **usd_context_name** (str) – Usd context name to run the command on. - **remove_from_layers** (Optional[Union[List[Union[str, Layer]], str, Layer]]) – Specific layers to remove the property from. Default to None, which removes the property from all layers. ### Methods - **__init__(prop_path[, usd_context_name, ...])** - **do()** - **undo()** #### __init__ Method ```python __init__(prop_path: Union[Path, str], usd_context_name: str = '', remove_from_layers: Optional[Union[List[Union[str, Layer]], str, Layer]] = None) ``` 这是一个带有[链接]的段落。 ![描述图片的文本]
1,572
omni.usd.commands.RemoveReferenceCommand.md
# RemoveReferenceCommand ## Class Overview ```python class omni.usd.commands.RemoveReferenceCommand(stage, prim_path: Path, reference: Reference) ``` Bases: `ReferenceCommandBase` ### Methods | Method | Description | |--------|-------------| | `__init__(stage, prim_path, reference)` | | | `do()` | | ### Detailed Method Descriptions #### `__init__(stage, prim_path, reference)` ```python def __init__(stage, prim_path: Path, reference: Reference): # Method implementation ``` #### `do()` ```python def do(): # Method implementation ``` Reference
562
omni.usd.commands.RemoveRelationshipTargetCommand.md
# RemoveRelationshipTargetCommand ## RemoveRelationshipTargetCommand ```python class omni.usd.commands.RemoveRelationshipTargetCommand(relationship: Relationship, target: Path) ``` Bases: `RelationshipTargetBase` Remove target from a relationship ### Methods | Method | Description | | --- | --- | | `__init__(relationship, target)` | | | `do()` | | ```python def __init__(relationship: Relationship, target: Path) Path
428
omni.usd.commands.remove_prim_spec.md
# remove_prim_spec ## remove_prim_spec ```python omni.usd.commands.remove_prim_spec(layer: Layer, prim_spec_path: str) ``` Removes prim spec from layer. ```
158
omni.usd.commands.RenamePrimCommand.md
# RenamePrimCommand ## RenamePrimCommand ```python class omni.usd.commands.RenamePrimCommand(prim_path: str, new_name: str) ``` **Bases:** `Command` Rename a primitive undoable **Command**. **Parameters:** - **prim_path** (str) – path of prim to be renamed. - **new_name** (str) – new name. **Methods:** - `__init__(prim_path, new_name)` - `do()` - `undo()` ``` prim_path : str, new_name : str
399
omni.usd.commands.ReplacePayloadCommand.md
# ReplacePayloadCommand ## Class Definition ```python class omni.usd.commands.ReplacePayloadCommand(stage, prim_path: Path, old_payload: Payload, new_payload: Payload) ``` **Bases:** [PayloadCommandBase](omni.usd.commands.PayloadCommandBase.html#omni.usd.commands.PayloadCommandBase) ### Methods | Method | Description | |--------|-------------| | `__init__(stage, prim_path, old_payload, new_payload)` | Initialize the ReplacePayloadCommand. | | `do()` | Execute the command. | ``` Path: Payload, old_payload: Payload, new_payload: Payload)
545
omni.usd.commands.ReplaceReferenceCommand.md
# ReplaceReferenceCommand ## Class Definition ```python class omni.usd.commands.ReplaceReferenceCommand(stage, prim_path: Path, old_reference: Reference, new_reference: Reference) ``` **Bases:** [ReferenceCommandBase](omni.usd.commands.ReferenceCommandBase.html#omni.usd.commands.ReferenceCommandBase) ### Methods | Method | Description | |--------|-------------| | `__init__(stage, prim_path, old_reference, new_reference)` | | | `do()` | | ``` Path: Path old_reference: Reference new_reference: Reference
512
omni.usd.commands.ReplaceReferencesCommand.md
# ReplaceReferencesCommand ## Summary Clears/Add references undoable Command. NOTE: THIS COMMAND HAS A LOT OF ISSUES AND IS DEPRECATED. PLEASE USE ReplaceReferenceCommand instead! ### Parameters - **path** (str) – Prim path. - **old_url** (str) – Url to be replaced. - **new_url** (str) – Replacement url. ### Methods - **__init__**(path, old_url, new_url) - **do**()
371
omni.usd.commands.SelectPrimsCommand.md
# SelectPrimsCommand ## SelectPrimsCommand ```python class omni.usd.commands.SelectPrimsCommand(old_selected_paths: typing.List[str], new_selected_paths: typing.List[str], expand_in_stage: bool = True, source: omni.usd._usd.Selection.SourceType = <SourceType.USD: 1>) ``` Bases: `Command` Select primitives undoable **Command**. ### Parameters - **old_selected_paths** (List[str]) – Old selected prim paths. - **new_selected_paths** (List[str]) – Prim paths to be selected. - **expand_in_stage** (bool, DEPRECATED) – Whether to expand the path in Stage Window on selection. - **compatibility.** (This param is left for) – - **source** (omni.usd.Selection.SourceType) – USD/FABRIC/ALL, indicates which stage selection should be set to REMINDER: Both params old_selected_paths and new_selected_paths should be const out of the command. And it’s caller’s responsibility to maintain that. Otherwise, undo will not return to its original state. ``` ## Methods | Method | Description | | --- | --- | | `__init__(old_selected_paths, new_selected_paths)` | | | `do()` | | | `undo()` | | ### __init__(old_selected_paths: List[str], new_selected_paths: List[str], expand_in_stage: bool = True, source: SourceType = SourceType.USD)
1,231
omni.usd.commands.SetMaterialStrengthCommand.md
# SetMaterialStrengthCommand ## SetMaterialStrengthCommand ``` class omni.usd.commands.SetMaterialStrengthCommand(rel, strength) ``` **Bases:** `Command` Set material binding strength undoable **Command**. **Parameters** - **rel** – Material binding relationship. - **strength** (float) – Strength. **Methods** - `__init__(rel, strength)` - `do()` - `undo()` ``` def __init__(rel, strength) # 欢迎来到我们的文档 ## 目录 - [简介](#简介) - [安装指南](#安装指南) - [使用教程](#使用教程) ## 简介 欢迎阅读我们的文档。在这里,您将找到所有必要的信息来开始使用我们的产品。 ## 安装指南 请按照以下步骤安装我们的产品: 1. 下载最新版本 2. 解压文件 3. 运行安装程序 ## 使用教程 一旦安装完成,您可以开始使用我们的产品。以下是一些基本的使用步骤: 1. 打开应用程序 2. 创建新项目 3. 添加内容 --- 感谢您阅读我们的文档。如果您有任何问题,请随时联系我们。
669
omni.usd.commands.SetPayLoadLoadSelectedPrimsCommand.md
# SetPayLoadLoadSelectedPrimsCommand ## SetPayLoadLoadSelectedPrimsCommand ``` ```markdown class omni.usd.commands.SetPayLoadLoadSelectedPrimsCommand(selected_paths: List[str], value: bool, stage_or_context: Optional[Union[str, Stage, UsdContext]] = None) ``` ```markdown Bases: Command ``` ```markdown Methods ``` ```markdown Table of Methods ``` ```markdown | Method | Description | | --- | --- | | __init__ | Description of __init__ method | ```python __init__ ``` (selected_paths, value[, ...]) Set the load/unload payload of the selected primitives undoable **Command**. ```python do ``` () ```python undo ``` () ```python __init__ ``` (selected_paths: List[str], value: bool, stage_or_context: Optional[Union[str, Stage, UsdContext]] = None) Set the load/unload payload of the selected primitives undoable **Command**. **Parameters** - **selected_paths** – Old selected prim paths. - **value** – True = load, False = unload - **stage_or_context** (Union[str, Stage, UsdContext]) – Stage or UsdContext applies the changes to. It can be instance of Usd.Stage or omni.usd.UsdContext, or context name. By default, it will apply the changes to the stage in default UsdContext. ```
1,193
omni.usd.commands.SetRelationshipTargetsCommand.md
# SetRelationshipTargetsCommand ## Class: omni.usd.commands.SetRelationshipTargetsCommand **Bases:** [RelationshipTargetBase](omni.usd.commands.RelationshipTargetBase.html#omni.usd.commands.RelationshipTargetBase) Set target(s) to a relationship ### Methods | Method | Description | |--------|-------------| | `__init__(relationship: Relationship, targets: List[Path])` | Initialize the command with a relationship and targets. | | `do()` | Execute the command. | targets: List[Path]
488
omni.usd.commands.ToggleActivePrimsCommand.md
# ToggleActivePrimsCommand ## ToggleActivePrimsCommand ```code Command ``` Undoable command to toggle the active state of prims. ### Methods | Method | Description | |--------|-------------| | `__init__(prim_paths[, stage_or_context, active])` | Constructor. | | `do()` | | | `undo()` | | #### `__init__(prim_paths, stage_or_context=None, active=None)` Constructor. **Parameters:** - **prim_paths** (`List[Path]`) – A list of prim paths. - **stage_or_context** (`Union[str, Stage, UsdContext]`) – Stage or UsdContext applies the changes to. It can be instance of Usd.Stage or omni.usd.UsdContext, or context name. By default, it will apply the changes to the stage in default UsdContext. - **active** (`Union[bool, None]`) – If active flag is not None, it will set the active states to the value specified by it. Otherwise, it will revert the active states of prims. # 标题1 这是一个段落,包含一个链接:Example Link。 ![描述图片的文本](删除图片链接) ``` 这是一段代码。 print("Hello, World!") ``` - 列表项1 - 列表项2
984
omni.usd.commands.TogglePayLoadLoadSelectedPrimsCommand.md
# TogglePayLoadLoadSelectedPrimsCommand ## TogglePayLoadLoadSelectedPrimsCommand Toggles the load/unload payload of the selected primitives undoable **Command**. ``` do ``` () ``` undo ``` () ```python __init__(selected_paths: List[str], stage_or_context: Optional[Union[str, Stage, UsdContext]] = None) ``` Toggles the load/unload payload of the selected primitives undoable **Command**. **Parameters** - **selected_paths** – Old selected prim paths. - **stage_or_context** (Union[str, Stage, UsdContext]) – Stage or UsdContext applies the changes to. It can be instance of Usd.Stage or omni.usd.UsdContext, or context name. By default, it will apply the changes to the stage in default UsdContext. ```
709
omni.usd.commands.ToggleVisibilitySelectedPrimsCommand.md
# ToggleVisibilitySelectedPrimsCommand ## Class Definition ```python class omni.usd.commands.ToggleVisibilitySelectedPrimsCommand(selected_paths: List[str], stage: Optional[Stage] = None, visible: Optional[bool] = None) ``` **Bases:** `Command` **Description:** Toggles the visibility of the selected primitives undoable **Command**. **Parameters:** - **selected_paths** (List[str]): The paths of the selected primitives. - **stage** (Optional[Stage]): The stage to operate on. Default is None. - **visible** (Optional[bool]): The visibility state to set. Default is None. ### Parameters - **selected_paths** (List[str]) – A list of prim paths. - **stage** (Usd.Stage) – The optional stage handle. By default, it’s the stage inside the default UsdContext. - **visible** (Optional[bool]) – By default, it’s None that means to invert the visibility state for each prim. When it’s set as a bool value, it will set all visibilities to the specified value instead of inverting them. ### Methods - `__init__(selected_paths[, stage, visible])` - `do()` - `undo()` ### __init__ Method ```python def __init__(selected_paths: List[str], stage: Optional[Stage] = None, visible: Optional[bool] = None) ``` ```
1,203
omni.usd.commands.TransformPrimCommand.md
# TransformPrimCommand ## Class Overview The `TransformPrimCommand` class is part of the `omni.usd.commands` module. It is used to transform a prim using a new transform matrix, optionally comparing it with an old transform matrix, at a specified time code. ### Constructor ```python class omni.usd.commands.TransformPrimCommand( path: str, new_transform_matrix: Matrix4d, old_transform_matrix: Optional[Matrix4d] = None, time_code: TimeCode = Usd.TimeCode.Default(), had_transform_at_key: bool = False, usd_context_name: str = "" ) ``` #### Parameters - **path** (`str`): The path of the prim to transform. - **new_transform_matrix** (`Matrix4d`): The new transform matrix to apply to the prim. - **old_transform_matrix** (`Optional[Matrix4d]`): The old transform matrix of the prim. If not provided, it defaults to `None`. - **time_code** (`TimeCode`): The time code at which the transformation is to be applied. Defaults to `Usd.TimeCode.Default()`. - **had_transform_at_key** (`bool`): Indicates whether the prim had a transform at the specified key. Defaults to `False`. - **usd_context_name** (`str`): The USD context name. Defaults to an empty string. ``` ## TransformPrimCommand ### Description Transform primitive undoable **Command**. ### Bases - `Command` ### Parameters - **path** (str) – Prim path. - **new_transform_matrix** – New transform matrix. - **old_transform_matrix** – Optional old transform matrix to undo to. If `None`, use the current transform. ### Methods - `__init__(path, new_transform_matrix[, ...])` - `do()` - `undo()` #### `__init__` Method - **Parameters** - `path`: str - `new_transform_matrix`: Matrix4d - `old_transform_matrix`: Optional[Matrix4d] = None - `time_code`: TimeCode = Usd.TimeCode.Default() - `had_transform_at_key`: bool = False - `usd_context_name`: str = ''
1,855
omni.usd.commands.TransformPrimsCommand.md
# TransformPrimsCommand ## TransformPrimsCommand ```python class omni.usd.commands.TransformPrimsCommand(prims_to_transform: List[Tuple[str, Matrix4d, Matrix4d, TimeCode]]) ``` **Bases:** `Command` **Description:** Transform multiple primitives undoable **Command**. **Undo/Redo grouping handled automatically.** **Parameters:** - **prims_to_transform** – List of primitive to transform in a tuple of (path, new_transform, old_transform). **Methods:** - `__init__(prims_to_transform)` - `do()` ``` <span class="pre"> undo () <td> <p> <dl class="py method"> <dt class="sig sig-object py" id="omni.usd.commands.TransformPrimsCommand.__init__"> <span class="sig-name descname"> <span class="pre"> __init__ <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> prims_to_transform <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> List <span class="p"> <span class="pre"> [ <span class="pre"> Tuple <span class="p"> <span class="pre"> [ <span class="pre"> str <span class="p"> <span class="pre"> , <span class="w"> <span class="pre"> Matrix4d <span class="p"> <span class="pre"> , <span class="w"> <span class="pre"> Matrix4d <span class="p"> <span class="pre"> , <span class="w"> <span class="pre"> TimeCode <span class="p"> <span class="pre"> ] <span class="p"> <span class="pre"> ] <span class="sig-paren"> ) <a class="headerlink" href="#omni.usd.commands.TransformPrimsCommand.__init__" title="Permalink to this definition">  <dd> <footer> <hr/>
1,582
omni.usd.commands.TransformPrimSRTCommand.md
# TransformPrimSRTCommand ## TransformPrimSRTCommand ```python class omni.usd.commands.TransformPrimSRTCommand(path: str, new_translation: Optional[Vec3d] = None, new_rotation_euler: Optional[Vec3d] = None, new_scale: Optional[Vec3d] = None, new_rotation_order: Optional[str] = None) ``` ### Description This class represents a command to transform a prim using translation, rotation, and scale. ### Parameters - **path** (`str`): The path to the prim. - **new_translation** (`Optional[Vec3d]`): The new translation vector. - **new_rotation_euler** (`Optional[Vec3d]`): The new Euler rotation angles. - **new_scale** (`Optional[Vec3d]`): The new scale vector. - **new_rotation_order** (`Optional[str]`): The order of rotation. ``` [Vec3i] = None, old_translation: Optional[Vec3d] = None, old_rotation_euler: Optional[Vec3d] = None, old_rotation_order: Optional[Vec3i] = None, old_scale: Optional[Vec3d] = None, time_code: TimeCode = Usd.TimeCode.Default(), had_transform_at_key: bool = False, usd_context_name: str = '' ) Bases: Command Transform primitive undoable Command. Parameters: - **path** (str) – Prim path. - **new_translation** (Gf.Vec3d) – New local translation. - **new_rotation_euler** (Gf.Vec3d) – New local rotation euler angles (in degree). - **new_scale** (Gf.Vec3d) – New scale. - **new_rotation_order** (Gf.Vec3i) – New rotation order (e.g. (0, 1, 2) means XYZ). Set to None to stay the same. ### Parameters - **old_translation** (`Gf.Vec3d`) – Old local translation. Leave to None to use current value. - **old_rotation_euler** (`Gf.Vec3d`) – Old local rotation euler angles. Leave to None to use current value. - **old_rotation_order** (`Gf.Vec3i`) – Old local rotation order. Leave to None to use current value. - **old_scale** (`Gf.Vec3d`) – Old scale. Leave to None to use current value. - **time_code** (`Usd.TimeCode`) – TimeCode to set transform to. - **had_transform_at_key** (`bool`) – If there’s key for transform. - **usd_context_name** (`str`) – Usd context name to run the command on. ### Methods - `__init__(path[, new_translation, ...])` - `do()` - `undo()` ### Detailed Method Signature ```python __init__( path: str, new_translation: Optional[Vec3d] = None, new_rotation_euler: Optional[Vec3d] = None, new_scale: Optional[Vec3d] = None, new_rotation_order: Optional[Vec3i] = None ) ``` old_translation: Optional[Vec3d] = None old_rotation_euler: Optional[Vec3d] = None old_rotation_order: Optional[Vec3i] = None old_scale: Optional[Vec3d] = None time_code: TimeCode = Usd.TimeCode.Default() had_transform_at_key: bool = False usd_context_name: str = ''
2,618
omni.usd.commands.TransformPrimsSRTCommand.md
# TransformPrimsSRTCommand ## TransformPrimsSRTCommand ``` class omni.usd.commands.TransformPrimsSRTCommand ( prims_to_transform : List[Tuple[str, Vec3d, Vec3d, Vec3i, Vec3d, Vec3d, Vec3d, Vec3i, Vec3d, TimeCode, bool]] ) ``` Bases: `Command` Transform multiple primitives undoable **Command**. Undo/Redo grouping handled automatically. **Parameters** ### prims_to_transform - List of primitive to transform in a tuple of (path, new_translation, new_rotation_euler, new_rotation_order, new_scale, old_translation, old_rotation_euler, old_rotation_order, old_scale, time_code, had_transform_at_key). ### Methods | Method | Description | |--------|-------------| | `__init__(prims_to_transform)` | | | `do()` | | | `undo()` | | ### __init__(prims_to_transform) - Parameters: - `prims_to_transform`: List[Tuple[str, Vec3d, Vec3d, Vec3i, Vec3d, Vec3d, Vec3d, Vec3i, Vec3d, TimeCode, bool]]
898
omni.usd.commands.UngroupPrimsCommand.md
# UngroupPrimsCommand ## UngroupPrimsCommand ```python class omni.usd.commands.UngroupPrimsCommand(prim_paths: List[Union[str, Path]], stage: Optional[Stage] = None, context_name: Optional[str] = None, destructive: bool = True) ``` Bases: Command ``` , ``` UsdStageHelper ``` Ungroup primitive undoable **Command**. ### Parameters - **prim_paths** (List[str]) – Prim paths that will be grouped. - **stage** (Usd.Stage) – Stage to operate. Optional. - **context_name** (str) – The usd context to operate. Optional. - **destructive** (bool) – If it’s true, it will ungroup all prims and remove original prims, which may edit other layers that are not edit target currently. If it’s false, all changes will made only to the current edit target without touching other layers. By default, it’s true for back compatibility. ### Methods - **__init__**(prim_paths[, stage, context_name, ...]) - **do**() - **undo**() #### __init__(prim_paths: List[Union[str, Path]], stage: Optional[Stage] = None, context_name: Optional[str] = None, destructive: bool = True) - **prim_paths**: List[Union[str, Path]] - **stage**: Optional[Stage] = None - **context_name**: Optional[str] = None - **destructive**: bool = True ```
1,211
omni.usd.commands.UnhideAllPrimsCommand.md
# UnhideAllPrimsCommand ## UnhideAllPrimsCommand ```python class omni.usd.commands.UnhideAllPrimsCommand(Command) ``` ### Methods | Method | Description | |--------|-------------| | `do()` | | | `undo()` | | ### `__init__()` ``` ---
239
omni.usd.commands.UnparentPrimsCommand.md
# UnparentPrimsCommand ## Overview The `UnparentPrimsCommand` class is a part of the `omni.usd.commands` module. This class is used to unparent prims from their current parent. ### Class Definition ```python class omni.usd.commands.UnparentPrimsCommand(paths: List[str], on_move_fn: Optional[callable] = None, keep_world_transform: bool = True, stage_or_context: Optional[Union[str, Stage, UsdContext]] = None) ``` ### Parameters - **paths** (`List[str]`): A list of paths of the prims to be unparented. - **on_move_fn** (`Optional[callable]`): A callback function to be called when the prims are moved. Defaults to `None`. - **keep_world_transform** (`bool`): If `True`, the world transform of the prims will be preserved. Defaults to `True`. - **stage_or_context** (`Optional[Union[str, Stage, UsdContext]]`): The stage or context in which the operation is performed. Defaults to `None`. ``` ### UnparentPrimsCommand Bases: `Command` #### Methods - `__init__(paths[, on_move_fn, ...])` - Move prims into "/" primitives undoable `Command`. - `do()` - `undo()` #### `__init__` Move prims into “/” primitives undoable `Command`. **Parameters** - **paths** – prim path to become parent of child_paths - **keep_world_transform** – If it needs to keep the world transform after parenting. - **stage_or_context** – (Union [ str , Stage , UsdContext ]) <em> Usd.Stage <em> , <em> omni.usd.UsdContext <em> ] ) – Stage or UsdContext applies the changes to. It can be instance of Usd.Stage or omni.usd.UsdContext, or context name. By default, it will apply the changes to the stage in default UsdContext.
1,608
omni.usd.commands.UsdStageHelper.md
# UsdStageHelper ## UsdStageHelper ```python class omni.usd.commands.UsdStageHelper(stage: Optional[Stage] = None, context_name: Optional[str] = None) ``` Bases: `object` Keeps the stage ID or returns the stage from the current context ### Methods - `__init__(stage, context_name)` ``` Optional[Stage] = None, context_name: Optional[str] = None
349
omni.usd.create_material_input.md
# create_material_input ## create_material_input ``` - **Parameters**: - `prim` - `name` - `value` - `vtype` - `def_value` (optional, default: `None`) - `min_value` (optional, default: `None`) - `max_value` (optional, default: `None`) - `display_name` (optional, default: `None`) - `display_group` (optional, default: `None`) - `color_space` (optional, default: `None`) This function is used to create a material input.
442
omni.usd.duplicate_prim.md
# duplicate_prim ## duplicate_prim ```python omni.usd.duplicate_prim(stage: Stage, prim_path: Union[str, Path], path_to: Union[str, Path], duplicate_layers: bool = True) ``` Duplicate prim. **Parameters** - **stage** (`Usd.Stage`) – Stage handle. - **prim_path** (`Union[str, Path]`) – Prim path. - **path_to** (`Union[str, Path]`) – Path to. - **duplicate_layers** (`bool`) – Duplicate layers, default is `True`. - **path_to** (`Union[str, Sdf.Path]`) – Copy to path. - **duplicate_layers** (`bool`) – True if it’s to duplicate this prim in all local layers. False if it’s to duplicate this prim to the current edit target. And it depends on whether the prim is defined or not. If it’s not defined, it will only copy the opinions in the current edit target if it exists. Otherwise, it will copy the def to the current edit target, even it’s from other layers instead of the current edit target. If you want to collapse all overrides inside all local layers for the prim, see omni.usd.stitch_prim_specs for reference. **Returns** - True if successful, or false otherwise.
1,077
omni.usd.editor.get_display_name.md
# get_display_name ## get_display_name ```python omni.usd.editor.get_display_name(prim) -> str ``` Gets display name from the metadata of the prim. ```
154
omni.usd.editor.is_always_pick_model.md
# is_always_pick_model ## is_always_pick_model ```python omni.usd.editor.is_always_pick_model(prim: Prim) -> bool ``` Whether selecting this prim should always pick the enclosing prim with kind:model or not. ```
213
omni.usd.editor.is_hide_in_stage_window.md
# is_hide_in_stage_window ## is_hide_in_stage_window ```python def is_hide_in_stage_window(prim: Prim) -> bool: ``` Whether the prim should be hidden in the stage window or not. ```
183
omni.usd.editor.set_always_pick_model.md
# set_always_pick_model ## set_always_pick_model ```python omni.usd.editor.set_always_pick_model(prim: Prim, pick_model: bool) ``` Sets metadata for prim to instruct selection whether it should always pick the enclosing prim with kind:model or not. ```
254
omni.usd.editor.set_display_name.md
# set_display_name ## set_display_name ```python omni.usd.editor.set_display_name(prim: Prim, name: str) ``` Sets an user readable name for the prim to instruct UI to display it. ```
184
omni.usd.editor.set_hide_in_stage_window.md
# set_hide_in_stage_window ## set_hide_in_stage_window ```python omni.usd.editor.set_hide_in_stage_window(prim: Prim, hide: bool) ``` Sets metadata for prim to instruct stage window to display/hide the prim. ```
213