file_path
stringlengths
5
148
content
stringlengths
150
498k
size
int64
150
498k
omni.kit.widget.filebrowser.zoom_bar.ZoomBar.md
# ZoomBar ## ZoomBar ```python class omni.kit.widget.filebrowser.zoom_bar.ZoomBar(**kwargs) ``` Bases: `object` Widget to control the scale of items inside `FileBrowserGridView`. ### Methods | Method | Description | |--------|-------------| | `__init__(**kwargs)` | | | `destroy()` | Destructor | ```python def __init__(**kwargs): pass ``` ```python def destroy(): """ Destructor """ ``` --- title: 文章标题 --- # 章节标题 ## 子章节标题 ### 子子章节标题 > 引用内容 **加粗文本** *斜体文本* `代码块` - 列表项1 - 列表项2 1. 有序列表项1 2. 有序列表项2 --- ## 页脚 ---
548
omni.kit.widget.graph.AbstractBatchPositionGetter.md
# AbstractBatchPositionGetter ## AbstractBatchPositionGetter ```python class omni.kit.widget.graph.AbstractBatchPositionGetter(model: GraphModel) ``` Helper to get the nodes to move at the same time ### Methods ```python __init__(model: GraphModel) ``` ### Attributes ```python model ```javascript SphinxRtdTheme.Navigation.enable(true); }); ```
349
omni.kit.widget.graph.AbstractGraphNodeDelegate.md
# AbstractGraphNodeDelegate The delegate generates widgets that together form the node using the model. The following figure shows the LIST layout of the node. For every zone, there is a method that is called to build this zone. ```c++ +---------------------+ | node_background | | +---+-------------+ | | | [A] | node_header | | | +---+-------------+ | | | [C] | port | | | +---+-------------+ | | | [D] | port | | | +---+-------------+ | | | [E] | node_footer | | | +---+-------------+ | +---------------------+ ``` COLUMN layout allows to put input and output ports at the same line: ```c++ +---------------------+ | node_background | | +---+-------------+ | | | [A] | node_header | | | +---+-------------+ | | | [C] | port | | | +---+-------------+ | | | [D] | port | | | +---+-------------+ | | | [E] | node_footer | | | +---+-------------+ | +---------------------+ ``` | +---+------+------+---+ | | [C] | port | port | [D] | | | | |------+---| | | |---+------| port | [D] | | | [D] | port | | | | | +---+------+------+---+ | | [E] | node_footer | [F] | | | +---+-------------+---+ | +-------------------------+ [A] node_header_input [B] node_header_output [C] port_input [D] port_output [E] node_footer_input (TODO) [F] node_footer_output (TODO) ## Methods | Method | Description | |--------|-------------| | `connection(model, source_desc, target_desc)` | Called to create the connection between ports. | | `destroy()` | | | `get_node_layout(model, node_desc)` | Called to determine the node layout | | `node_background(model, node_desc)` | Called to create widgets of the node background | | `node_footer(model, node_desc)` | Called to create widgets of the bottom of the node | | `node_header(model, node_desc)` | Called to create widgets of the top of the node | | `node_header_input(model, node_desc)` | Called to create the left part of the header that will be used as input when the node is collapsed | | `node_header_output(model, node_desc)` | Called to create the right part of the header that will be used as output when the node is collapsed | | `port(model, node_desc)` | | | Method | Description | |--------|-------------| | `port(model, node_desc, port_desc)` | Called to create the middle part of the port | | `port_input(model, node_desc, port_desc)` | Called to create the left part of the port that will be used as input | | `port_output(model, node_desc, port_desc)` | Called to create the right part of the port that will be used as output | ### `__init__()` ### `connection(model, source_desc: GraphConnectionDescription, target_desc: GraphConnectionDescription, foreground: bool = False)` Called to create the connection between ports. This method can be called twice - once as a background pass, once as a foreground pass, which is what the `foreground` parameter denotes. The foreground pass is off by default, but is useful for curve anchor floating value displays that need to be in front of all nodes. ### `get_node_layout(model, node_desc: GraphNodeDescription)` Called to determine the node layout ### `node_background(model, node_desc: GraphNodeDescription)` ### node_background Called to create widgets of the node background ### node_footer Called to create widgets of the bottom of the node ### node_header Called to create widgets of the top of the node ### node_header_input Called to create the left part of the header that will be used as input when the node is collapsed ### node_header_output Called to create the right part of the header that will be used as output when the node is collapsed ### port Called to create widgets for a port ### GraphPortDescription #### port Called to create the middle part of the port #### port_input (model, node_desc: GraphNodeDescription, port_desc: GraphPortDescription) Called to create the left part of the port that will be used as input #### port_output (model, node_desc: GraphNodeDescription, port_desc: GraphPortDescription) Called to create the right part of the port that will be used as output
4,041
omni.kit.widget.graph.abstract_batch_position_getter.AbstractBatchPositionGetter.md
# AbstractBatchPositionGetter ## AbstractBatchPositionGetter Helper to get the nodes to move at the same time ### Methods - `__init__(model)` ### Attributes - `model` ### `__init__(model)` ``` GraphModel
207
omni.kit.widget.graph.abstract_batch_position_getter.Classes.md
# omni.kit.widget.graph.abstract_batch_position_getter Classes ## Classes Summary: | Class | Description | |-------|-------------| | [AbstractBatchPositionGetter](omni.kit.widget.graph.abstract_batch_position_getter/omni.kit.widget.graph.abstract_batch_position_getter.AbstractBatchPositionGetter.html) | Helper to get the nodes to move at the same time |
357
omni.kit.widget.graph.abstract_graph_node_delegate.AbstractGraphNodeDelegate.md
# AbstractGraphNodeDelegate ## AbstractGraphNodeDelegate ``` The delegate generates widgets that together form the node using the model. The following figure shows the LIST layout of the node. For every zone, there is a method that is called to build this zone. ``` +---------------------+ | node_background | | +---+-------------+ | | | [A] | node_header | | | +---+-------------+ | | | [C] | port | | | +---+-------------+ | | | [D] | port | | | +---+-------------+ | | | [E] | node_footer | | | +---+-------------+ | +---------------------+ ``` COLUMN layout allows to put input and output ports at the same line: ``` +---------------------+ | node_background | | | | | | | | | | | +---------------------+ ``` | +---+-------------+---+ | [A] | node_header | [B] | +---+------+------+---+ | [C] | port | port | [D] | | | |------+---| | --- |------| port | [D] | | [D] | port | | | +---+------+------+---+ | [E] | node_footer | [F] | +---+-------------+---+ +-------------------------+ ## Methods | Method | Description | |--------|-------------| | `connection(model, source_desc, target_desc)` | Called to create the connection between ports. | | `destroy()` | | | `get_node_layout(model, node_desc)` | Called to determine the node layout | | `node_background(model, node_desc)` | Called to create widgets of the node background | | `node_footer(model, node_desc)` | Called to create widgets of the bottom of the node | | `node_header(model, node_desc)` | Called to create widgets of the top of the node | | `node_header_input(model, node_desc)` | Called to create the left part of the header that will be used as input when the node is collapsed | ### Methods #### `node_header_output` - **Parameters**: `model`, `node_desc` - **Description**: Called to create the right part of the header that will be used as output when the node is collapsed. #### `port` - **Parameters**: `model`, `node_desc`, `port_desc` - **Description**: Called to create the middle part of the port. #### `port_input` - **Parameters**: `model`, `node_desc`, `port_desc` - **Description**: Called to create the left part of the port that will be used as input. #### `port_output` - **Parameters**: `model`, `node_desc`, `port_desc` - **Description**: Called to create the right part of the port that will be used as output. #### `__init__` - **Description**: Initializes the object. #### `connection` - **Parameters**: `model`, `source_desc: GraphConnectionDescription`, `target_desc: GraphConnectionDescription`, `foreground: bool = False` - **Description**: Called to create the connection between ports. This method can be called twice - once as a background pass, once as a foreground pass, which is what the `foreground` parameter denotes. The foreground pass is off by default, but is useful for curve anchor floating value displays that need to be in front of all nodes. #### `get_node_layout` - **Parameters**: `model`, `node_desc: GraphNodeDescription` - **Description**: Called to determine the node layout. #### `node_background` - **Description**: (Description not provided in the HTML snippet) (model, node_desc: GraphNodeDescription) Called to create widgets of the node background (model, node_desc: GraphNodeDescription) Called to create widgets of the bottom of the node (model, node_desc: GraphNodeDescription) Called to create widgets of the top of the node (model, node_desc: GraphNodeDescription) Called to create the left part of the header that will be used as input when the node is collapsed (model, node_desc: GraphNodeDescription) Called to create the right part of the header that will be used as output when the node is collapsed (model, node_desc: GraphNodeDescription) Called to create widgets of the node background ### AbstractGraphNodeDelegate Methods #### port ```python def port(model, node_desc: GraphNodeDescription, port_desc: GraphPortDescription): """ Called to create the middle part of the port """ ``` #### port_input ```python def port_input(model, node_desc: GraphNodeDescription, port_desc: GraphPortDescription): """ Called to create the left part of the port that will be used as input """ ``` #### port_output ```python def port_output(model, node_desc: GraphNodeDescription, port_desc: GraphPortDescription): """ Called to create the right part of the port that will be used as output """ ```
4,523
omni.kit.widget.graph.abstract_graph_node_delegate.Classes.md
# omni.kit.widget.graph.abstract_graph_node_delegate Classes ## Classes Summary - **AbstractGraphNodeDelegate** - The delegate generates widgets that together form the node using the - **GraphConnectionDescription** - The object that holds the main attributes of the connection - **GraphNodeDescription** - The object that holds the main attributes of the node - **GraphNodeLayout** - An enumeration. - **GraphPortDescription** - The object that holds the main attributes of the port
499
omni.kit.widget.graph.abstract_graph_node_delegate.GraphConnectionDescription.md
# GraphConnectionDescription ## GraphConnectionDescription ```python class omni.kit.widget.graph.abstract_graph_node_delegate.GraphConnectionDescription(node, port, widget, level, is_tangent_reversed=False) ``` Bases: `object` The object that holds the main attributes of the connection ### Methods ```python __init__(node, port, widget, level[, ...]) <section> <div> <div> <div> <div> <dl> <dt> <em> <span> <span> is_tangent_reversed <span> <span> = <span> <span> False <span> ) <dd> <footer> <hr/>
985
omni.kit.widget.graph.abstract_graph_node_delegate.GraphNodeDescription.md
# GraphNodeDescription ## GraphNodeDescription ```python class omni.kit.widget.graph.abstract_graph_node_delegate.GraphNodeDescription(node, connected_source=None, connected_target=None) ``` Bases: `object` The object that holds the main attributes of the node ### Methods | Method | Description | |--------|-------------| | `__init__(node[, connected_source, connected_target])` | | ```python def __init__(node, connected_source=None, connected_target=None): # method implementation ``` ```
502
omni.kit.widget.graph.abstract_graph_node_delegate.GraphNodeLayout.md
# GraphNodeLayout ## GraphNodeLayout ```python class omni.kit.widget.graph.abstract_graph_node_delegate.GraphNodeLayout(value) ``` An enumeration. ### Attributes | Attribute | Description | |-----------|-------------| | LIST | | | COLUMNS | | | HEAP | | ### `__init__` ```python __init__() ``` ```
349
omni.kit.widget.graph.abstract_graph_node_delegate.GraphPortDescription.md
# GraphPortDescription ## GraphPortDescription ```python class omni.kit.widget.graph.abstract_graph_node_delegate.GraphPortDescription(port, level, relative_position, parent_child_count, connected_source=None, connected_target=None) ``` Bases: `object` The object that holds the main attributes of the port ### Methods - `__init__(port, level, relative_position, parent_child_count, connected_source=None, connected_target=None)` ``` parent_child_count, connected_source=None, connected_target=None)
505
omni.kit.widget.graph.BackdropDelegate.md
# BackdropDelegate ## BackdropDelegate ```python class omni.kit.widget.graph.BackdropDelegate(scale_factor=1.0) ``` Bases: `GraphNodeDelegateFull` The delegate with the Omniverse design for the nodes of the closed state. ### Methods | Method | Description | |--------|-------------| | `node_background(model, node_desc)` | Called to create widgets of the node background | | `node_footer(model, node_desc)` | Called to create widgets of the bottom of the node | | `node_header(model, node_desc)` | Called to create widgets of the top of the node | ```python def __init__(scale_factor=1.0): ``` <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.graph.BackdropDelegate.node_background"> <span class="sig-name descname"> <span class="pre"> node_background <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> model , <em class="sig-param"> <span class="n"> <span class="pre"> node_desc <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> GraphNodeDescription <span class="sig-paren"> ) <dd> <p> Called to create widgets of the node background <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.graph.BackdropDelegate.node_footer"> <span class="sig-name descname"> <span class="pre"> node_footer <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> model , <em class="sig-param"> <span class="n"> <span class="pre"> node_desc <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> GraphNodeDescription <span class="sig-paren"> ) <dd> <p> Called to create widgets of the bottom of the node <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.graph.BackdropDelegate.node_header"> <span class="sig-name descname"> <span class="pre"> node_header <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> model , <em class="sig-param"> <span class="n"> <span class="pre"> node_desc <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> GraphNodeDescription <span class="sig-paren"> ) <dd> <p> Called to create widgets of the top of the node
2,571
omni.kit.widget.graph.BackdropGetter.md
# BackdropGetter ## BackdropGetter ``` class omni.kit.widget.graph.BackdropGetter(model: GraphModel, is_backdrop_fn: Callable[[Any], bool], graph_widget=None) ``` **Bases:** ``` AbstractBatchPositionGetter ``` **Description:** Helper to get the nodes that placed in the given backdrop **Methods:** ``` __init__(model, is_backdrop_fn[, graph_widget]) ``` **Attributes:** ``` None ``` ## __init__ ( **model** : GraphModel, **is_backdrop_fn** : Callable[[Any], bool], **graph_widget** = None )
496
omni.kit.widget.graph.backdrop_delegate.BackdropDelegate.md
# BackdropDelegate ## BackdropDelegate ```python class omni.kit.widget.graph.backdrop_delegate.BackdropDelegate(scale_factor=1.0) ``` Bases: `GraphNodeDelegateFull` The delegate with the Omniverse design for the nodes of the closed state. ### Methods | Method | Description | |--------|-------------| | `node_background(model, node_desc)` | Called to create widgets of the node background | | `node_footer(model, node_desc)` | Called to create widgets of the bottom of the node | | `node_header(model, node_desc)` | Called to create widgets of the top of the node | ### `__init__(scale_factor=1.0)` ``` ## BackdropDelegate Methods ### __init__ ```python scale_factor = 1.0 ``` ### node_background ```python node_background(model, node_desc: GraphNodeDescription) ``` Called to create widgets of the node background ### node_footer ```python node_footer(model, node_desc: GraphNodeDescription) ``` Called to create widgets of the bottom of the node ### node_header ```python node_header(model, node_desc: GraphNodeDescription) ``` Called to create widgets of the top of the node
1,086
omni.kit.widget.graph.backdrop_delegate.Classes.md
# omni.kit.widget.graph.backdrop_delegate Classes ## Classes Summary | Class | Description | |-------|-------------| | [BackdropDelegate](omni.kit.widget.graph.backdrop_delegate/omni.kit.widget.graph.backdrop_delegate.BackdropDelegate.html) | The delegate with the Omniverse design for the nodes of the closed state. |
320
omni.kit.widget.graph.backdrop_getter.Classes.md
# omni.kit.widget.graph.backdrop_getter Classes ## Classes Summary - **BackdropGetter** - Helper to get the nodes that placed in the given backdrop
151
omni.kit.widget.graph.Classes.md
# omni.kit.widget.graph Classes ## Classes Summary | Class Name | Description | |------------|-------------| | AbstractBatchPositionGetter | Helper to get the nodes to move at the same time | | AbstractGraphNodeDelegate | The delegate generates widgets that together form the node using the | | BackdropDelegate | The delegate with the Omniverse design for the nodes of the closed state. | | BackdropGetter | Helper to get the nodes that placed in the given backdrop | | CompoundInputOutputNodeDelegate | The delegate for the input/output nodes of the compound. | | CompoundNodeDelegate | The delegate for the compound nodes. | | GraphConnectionDescription | The object that holds the main attributes of the connection | | GraphModel | The base class for the Graph model. | | GraphModelBatchPositionHelper | The model that manages batch position of the items. It can be used to manage | | GraphNodeDelegate | The delegate with the Omniverse design that has both full and collapsed states. | | GraphNodeDelegateRouter | | ### GraphNodeDelegateRouter The delegate that keeps multiple delegates and pick them depending on the ### GraphNodeDescription The object that holds the main attributes of the node ### GraphNodeLayout An enumeration. ### GraphPortDescription The object that holds the main attributes of the port ### GraphView The visualisation layer of omni.kit.widget.graph. It behaves like a ### IsolationGraphModel ### SelectionGetter Helper to get the selection of the given model. It’s supposed to be
1,519
omni.kit.widget.graph.CompoundInputOutputNodeDelegate.md
# CompoundInputOutputNodeDelegate ## CompoundInputOutputNodeDelegate ```python class omni.kit.widget.graph.CompoundInputOutputNodeDelegate(GraphNodeDelegateFull) ``` The delegate for the input/output nodes of the compound. ### Methods ```python __init__() ``` ```python destroy() ``` ```python port(model, node_desc, port_desc) ``` Called to create the middle part of the port ```python port_input(model, node_desc, port_desc) ``` Called to create the left part of the port that will be used as input ```python port_output(model, node_desc, port_desc) ``` Called to create the right part of the port that will be used as output ``` ### `__init__` ### `port(model, node_desc: GraphNodeDescription, port_desc: GraphPortDescription)` Called to create the middle part of the port ### `port_input(model, node_desc: GraphNodeDescription, port_desc: GraphPortDescription)` Called to create the left part of the port that will be used as input ### `port_output(model, node_desc: GraphNodeDescription, port_desc: GraphPortDescription)` Called to create the right part of the port that will be used as output
1,108
omni.kit.widget.graph.CompoundNodeDelegate.md
# CompoundNodeDelegate ## CompoundNodeDelegate ``` class omni.kit.widget.graph.CompoundNodeDelegate(scale_factor=1.0) ``` Bases: ``` GraphNodeDelegateFull ``` The delegate for the compound nodes. ### Methods ``` __init__(scale_factor=1.0) ``` ```
252
omni.kit.widget.graph.compound_node_delegate.Classes.md
# omni.kit.widget.graph.compound_node_delegate Classes ## Classes Summary - **CompoundInputOutputNodeDelegate** - The delegate for the input/output nodes of the compound. - **CompoundNodeDelegate** - The delegate for the compound nodes.
243
omni.kit.widget.graph.compound_node_delegate.CompoundNodeDelegate.md
# CompoundNodeDelegate ## CompoundNodeDelegate ```python class omni.kit.widget.graph.compound_node_delegate.CompoundNodeDelegate(scale_factor=1.0) ``` Bases: `GraphNodeDelegateFull` The delegate for the compound nodes. ### Methods ```python def __init__(scale_factor=1.0) ``` ```
285
omni.kit.widget.graph.GraphConnectionDescription.md
# GraphConnectionDescription ## GraphConnectionDescription ```python class omni.kit.widget.graph.GraphConnectionDescription(node, port, widget, level, is_tangent_reversed=False) ``` Bases: `object` The object that holds the main attributes of the connection ### Methods | Method | Description | |--------|-------------| | `__init__(node, port, widget, level, is_tangent_reversed=False)` | | ```
399
omni.kit.widget.graph.GraphModel.md
# GraphModel ## GraphModel The base class for the Graph model. The model is the central component of the graph widget. It is the application’s dynamic data structure, independent of the user interface, and it directly manages the data. It follows closely model–view pattern. It defines the standard interface to be able to interoperate with the components of the model-view architecture. It is not supposed to be instantiated directly. Instead, the user should subclass it to create a new model. The model manages two kinds of data elements. Node and port are the atomic data elements of the model. Both node and port can have any number of sub-ports and any number of input and output connections. There is no specific Python type for the elements of the model. Since Python has dynamic types, the model can return any object as a node or a port. When the widget needs to get a property of the node, it provides the given node back to the model. Example: ```python class UsdShadeModel(GraphModel): @property def nodes(self, prim=None): # Return Usd.Prim in a list return [stage.GetPrimAtPath(selection)] @property def name(self, item=None): # item here is Usd.Prim because UsdShadeModel.nodes returns # Usd.Prim return item.GetPath().name # Accessing nodes and properties example model = UsdShadeModel() # UsdShadeModel decides the type of nodes. It's a list with Usd.Prim nodes = model.nodes for node in nodes: # The node is accessed through evaluation of self[key]. It will # return the proxy object that redirects its properties back to # model. So the following line will call UsdShadeModel.name(node). name = model[node].name print(f"The model has node {name}") ``` ### Methods - **__init__** ``` ### Methods - `__init__()` - `can_connect(source, target)` - Return if it's possible to connect source to target - `destroy()` - `has_nodes(obj)` - Returns true if the model can currently build the graph network using the provided object - `position_begin_edit(item)` - Called when the user started dragging the node - `position_end_edit(item)` - Called when the user finished dragging the node and released the mouse - `size_begin_edit(item)` - Called when the user started resizing the node - `size_end_edit(item)` - Called when the user finished resizing the node and released the mouse - `special_select_widget(node, node_widget)` - `subscribe_item_changed(fn)` - Return the object that will automatically unsubscribe when destroyed. - `subscribe_node_changed(fn)` - Return the object that will automatically unsubscribe when destroyed. - `subscribe_selection_changed(fn)` - Return the object that will automatically unsubscribe when destroyed. ### Attributes - `DISPLAY_NAME` - `description` - The text label that is displayed on the backdrop in the node graph. - `display_color` - The node color. - `expansion_state` - `icon`: Return icon of the image - `inputs`: - `name`: The name of the item how it should be displayed in the view - `nodes`: - `outputs`: - `ports`: - `position`: Returns the position of the node - `preview`: Return the preview of the image - `preview_state`: Return the state of the preview of the node - `selection`: - `size`: The node size. - `stacking_order`: This value is a hint when an application cares about the visibility of a node and whether each node overlaps another. - `type`: __init__() class ExpansionState(value) - Bases: Enum - An enumeration. class PreviewState(value) - Bases: IntFlag - An enumeration. ## Methods ### can_connect ```python can_connect(source, target) ``` Return if it’s possible to connect source to target ### has_nodes ```python static has_nodes(obj) ``` Returns true if the model can currently build the graph network using the provided object ### position_begin_edit ```python position_begin_edit(item) ``` Called when the user started dragging the node ### position_end_edit ```python position_end_edit(item) ``` Called when the user finished dragging the node and released the mouse ### size_begin_edit ```python size_begin_edit(item) ``` Called when the user started resizing the node ### size_end_edit ```python size_end_edit(item) ``` Called when the user finished resizing the node and released the mouse ### subscribe_item_changed ```python subscribe_item_changed(fn) ``` Return the object that will automatically unsubscribe when destroyed. ### subscribe_node_changed ```python subscribe_node_changed(fn) ``` Return the object that will automatically unsubscribe when destroyed. ### subscribe_selection_changed ```python subscribe_selection_changed(fn) ``` Return the object that will automatically unsubscribe when destroyed. ## Property ### description ```python property description ``` The text label that is displayed on the backdrop in the node graph. ## Properties ### display_color The node color. ### icon Return icon of the image ### name The name of the item how it should be displayed in the view ### position Returns the position of the node ### preview Return the preview of the image ### preview_state Return the state of the preview of the node ### size The node size. Is used for nodes like Backdrop. ### stacking_order This value is a hint when an application cares about the visibility of a node and whether each node overlaps another.
5,382
omni.kit.widget.graph.GraphModelBatchPositionHelper.md
# GraphModelBatchPositionHelper ## GraphModelBatchPositionHelper The model that manages batch position of the items. It can be used to manage the position of multi selection, backdrops and upstreams. ### Methods - **`__init__()`** - **`add_get_moving_items_fn(fn)`** - Add the function that is called in batch_position_begin_edit to determine which items to move - **`batch_position_begin_edit(item)`** - Should be called from position_begin_edit to make sure position_begin_edit is called for all the selected nodes - **`batch_position_end_edit(item)`** - Should be called from position_begin_edit to make sure position_begin_edit is called for all the selected nodes - **`batch_set_position(position[, item])`** - Should be called in the position setter to make sure the position setter is called for all the selected nodes ### Attributes | Attribute | Description | |-----------|-------------| | `batch_proxy` | Proxy is the isolation model. | ### Methods #### `__init__()` #### `add_get_moving_items_fn(fn: Callable[[Any], List[Any]])` Add the function that is called in batch_position_begin_edit to determine which items to move. #### `batch_position_begin_edit(item: Any)` Should be called from position_begin_edit to make sure position_begin_edit is called for all the selected nodes. #### `batch_position_end_edit(item: Any)` Should be called from position_begin_edit to make sure position_begin_edit is called for all the selected nodes. #### `batch_set_position(position: List[float], item: Optional[Any] = None)` Should be called in the position setter to make sure the position setter is called for all the selected nodes. ## GraphModelBatchPositionHelper.batch_proxy **Property**: batch_proxy Proxy is the isolation model. We need it because it converts calls to input/output nodes.
1,820
omni.kit.widget.graph.GraphNodeDelegate.md
# GraphNodeDelegate ## GraphNodeDelegate ```python class omni.kit.widget.graph.GraphNodeDelegate(GraphNodeDelegateRouter) ``` The delegate with the Omniverse design that has both full and collapsed states. ### Methods ```python __init__() ``` ```python get_style() ``` Return style that can be used with this delegate ```python specialized_color_style(name, color, icon[, ...]) ``` Return part of the style that has everything to color special node type. ```python specialized_port_style(name, color) ``` Return part of the style that has everything to color the customizable part of the port. ### get_style() Return style that can be used with this delegate ### specialized_color_style(name, color, icon, icon_tint_color=None) Return part of the style that has everything to color special node type. #### Parameters - **name** – Node type - **color** – Node color - **icon** – Filename to the icon the node type should display - **icon_tint_color** – Icon tint color ### specialized_port_style(name, color) Return part of the style that has everything to color the customizable part of the port. #### Parameters - **name** – Port type type - **color** – Port color
1,175
omni.kit.widget.graph.GraphNodeDelegateRouter.md
# GraphNodeDelegateRouter ## GraphNodeDelegateRouter ```python class omni.kit.widget.graph.GraphNodeDelegateRouter ``` **Bases:** ```python AbstractGraphNodeDelegate ``` **Description:** The delegate that keeps multiple delegates and pick them depending on the routing conditions. It’s possible to add the routing conditions with `add_route`, and conditions could be a type or a lambda expression. The latest added routing is stronger than previously added. Routing added without conditions is the default. We use type routing to make the specific kind of nodes unique, and also we can use the lambda function to make the particular state of nodes unique (ex. full/collapsed). It’s possible to use type and lambda routing at the same time. **Usage examples:** ```python delegate.add_route(TextureDelegate(), type="Texture2d") delegate.add_route(CollapsedDelegate(), expression=is_collapsed) ``` ### Methods | Method | Description | |--------|-------------| | `__init__()` | | | `add_route(delegate[, type, expression])` | Add delegate to the routing table | | `connection(model, source, target[, foreground])` | Called to create the connection between ports | | `destroy()` | | | `get_node_layout()` | | ``` | Method Name | Description | |-------------|-------------| | `get_node_layout(model, node_desc)` | Called to determine the node layout | | `node_background(model, node_desc)` | Called to create widgets of the node background | | `node_background_v2(model, node_desc, draw_icon)` | Called to create widgets of the node background | | `node_footer(model, node_desc)` | Called to create widgets of the bottom of the node | | `node_header(model, node_desc)` | Called to create widgets of the top of the node | | `node_header_input(model, node_desc)` | Called to create the left part of the header that will be used as input when the node is collapsed | | `node_header_output(model, node_desc)` | Called to create the right part of the header that will be used as output when the node is collapsed | | `port(model, node_desc, port_desc)` | Called to create the middle part of the port | | `port_input(model, node_desc, port_desc)` | Called to create the left part of the port that will be used as input | | `port_output(model, node_desc, port_desc)` | Called to create the right part of the port that will be used as output | ### `__init__()` ### `add_route(delegate: AbstractGraphNodeDelegate, type=None, expression=None)` ### Add delegate to the routing table ### connection(model, source: GraphConnectionDescription, target: GraphConnectionDescription, foreground: bool = False) Called to create the connection between ports ### get_node_layout(model, node_desc: GraphNodeDescription) Called to determine the node layout ### node_background(model, node_desc: GraphNodeDescription) Called to create widgets of the node background ### node_background_v2(model, node_desc: GraphNodeDescription, draw_icon: bool) <p> Called to create widgets of the node background <dt class="sig sig-object py" id="omni.kit.widget.graph.GraphNodeDelegateRouter.node_footer"> <span class="sig-name descname"> <span class="pre"> node_footer <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> model , <em class="sig-param"> <span class="n"> <span class="pre"> node_desc <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> GraphNodeDescription <span class="sig-paren"> ) <dd> <p> Called to create widgets of the bottom of the node <dt class="sig sig-object py" id="omni.kit.widget.graph.GraphNodeDelegateRouter.node_header"> <span class="sig-name descname"> <span class="pre"> node_header <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> model , <em class="sig-param"> <span class="n"> <span class="pre"> node_desc <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> GraphNodeDescription <span class="sig-paren"> ) <dd> <p> Called to create widgets of the top of the node <dt class="sig sig-object py" id="omni.kit.widget.graph.GraphNodeDelegateRouter.node_header_input"> <span class="sig-name descname"> <span class="pre"> node_header_input <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> model , <em class="sig-param"> <span class="n"> <span class="pre"> node_desc <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> GraphNodeDescription <span class="sig-paren"> ) <dd> <p> Called to create the left part of the header that will be used as input when the node is collapsed <dt class="sig sig-object py" id="omni.kit.widget.graph.GraphNodeDelegateRouter.node_header_output"> <span class="sig-name descname"> <span class="pre"> node_header_output <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> model , <em class="sig-param"> <span class="n"> <span class="pre"> node_desc <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> GraphNodeDescription <span class="sig-paren"> ) <dd> <p> Called to create the right part of the header that will be used as output when the node is collapsed <dt class="sig sig-object py" id="omni.kit.widget.graph.GraphNodeDelegateRouter.port"> <span class="sig-name descname"> <span class="pre"> port <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> model , <em class="sig-param"> <span class="n"> <span class="pre"> node_desc <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> GraphNodeDescription , <em class="sig-param"> <span class="n"> <span class="pre"> port_desc <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> GraphPortDescription <span class="sig-paren"> ) <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.graph.GraphNodeDelegateRouter.port"> <span class="sig-name descname"> <span class="pre"> port <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> model , <em class="sig-param"> <span class="n"> <span class="pre"> node_desc <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> GraphNodeDescription , <em class="sig-param"> <span class="n"> <span class="pre"> port_desc <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> GraphPortDescription <span class="sig-paren"> ) <dd> <p> Called to create the middle part of the port <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.graph.GraphNodeDelegateRouter.port_input"> <span class="sig-name descname"> <span class="pre"> port_input <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> model , <em class="sig-param"> <span class="n"> <span class="pre"> node_desc <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> GraphNodeDescription , <em class="sig-param"> <span class="n"> <span class="pre"> port_desc <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> GraphPortDescription <span class="sig-paren"> ) <dd> <p> Called to create the left part of the port that will be used as input <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.graph.GraphNodeDelegateRouter.port_output"> <span class="sig-name descname"> <span class="pre"> port_output <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> model , <em class="sig-param"> <span class="n"> <span class="pre"> node_desc <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> GraphNodeDescription , <em class="sig-param"> <span class="n"> <span class="pre"> port_desc <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> GraphPortDescription <span class="sig-paren"> ) <dd> <p> Called to create the right part of the port that will be used as output
8,794
omni.kit.widget.graph.GraphNodeDescription.md
# GraphNodeDescription ## GraphNodeDescription ```python class omni.kit.widget.graph.GraphNodeDescription(node, connected_source=None, connected_target=None) ``` Bases: `object` The object that holds the main attributes of the node ### Methods ```python __init__(node, connected_source=None, connected_target=None) ``` # 欢迎来到我的网站 这是一个段落。 ## 第二部分 这里是一些文本。 ### 子标题 这里是更多的文本。
383
omni.kit.widget.graph.GraphNodeLayout.md
# GraphNodeLayout ## GraphNodeLayout ``` Bases: `Enum` An enumeration. ### Attributes | Attribute | Description | |-----------|-------------| | `LIST` | | | `COLUMNS` | | | `HEAP` | | ```markdown ## __init__ ``` ---
264
omni.kit.widget.graph.GraphPortDescription.md
# GraphPortDescription ## GraphPortDescription ```python class omni.kit.widget.graph.GraphPortDescription(port, level, relative_position, parent_child_count, connected_source=None, connected_target=None) ``` Bases: `object` The object that holds the main attributes of the port ### Methods | Method | Description | |--------|-------------| | `__init__(port, level, relative_position, parent_child_count, connected_source=None, connected_target=None)` | | ``` None, connected_target = None)
495
omni.kit.widget.graph.GraphView.md
# GraphView ## GraphView ``` class omni.kit.widget.graph.GraphView(**kwargs) ``` ### Keyword Arguments: - **kwargs** ### Description The visualisation layer of omni.kit.widget.graph. It behaves like a regular widget and displays nodes and their connections. ### Methods - `__init__(**kwargs)` - ### Keyword Arguments: - **kwargs** - `destroy()` - Called by extension before destroying this object. - `filter_upstream(nodes)` - Remove nodes that are not upstream of the given nodes - `focus_on_nodes([nodes])` - Focus the view on nodes - `get_bbox_of_nodes(nodes)` - Get the bounding box of nodes - `layout_all()` - Layout all nodes in the graph. ``` | Method | Description | | --- | --- | | layout_all() | Reset positions of all the nodes in the model | | set_delegate(delegate) | Replace the delegate of the widget | | set_expansion(state) | Open, close or minimize all the nodes in the model. | | set_model(model) | Replace the model of the widget. | | subscribe_empty_connection_drop(fn) | Return the object that will automatically unsubscribe when destroyed. | | subscribe_post_delayed_build_layout(fn) | Return the object that will automatically unsubscribe when destroyed. | | subscribe_pre_delayed_build_layout(fn) | Return the object that will automatically unsubscribe when destroyed. | ### Attributes | Attribute | Description | | --- | --- | | DEFAULT_DISTANCE_BETWEEN_NODES | | | model | | | pan_x | The horizontal offset of the scene | | pan_y | The vertical offset of the scene | | raster_nodes | | | selection | Return selected nodes | | virtual_ports | Typically source connections go from the left side of the node to the right side of the node. | | zoom | The zoom level of the scene | | zoom_max | The maximum zoom level of the scene | | zoom_min | The minimum zoom level of the scene | ## zoom_min The minimum zoom level of the scene ### Keyword Arguments: - `model GraphModel` - Model to display the node graph - `delegate AbstractGraphNodeDelegate` - Delegate to draw the node - `virtual_ports bool` - True when the model should use reversed output for better look of the graph. - `port_grouping bool` - True when the widget should use sub-ports for port grouping. - `draw_curve_top_layer bool` - When True, connections are drawn in 2 passes. The “under” layer is for the opaque curve, and the “top” or “over” layer is meant for floating curve anchor decorations that need to be on top of all nodes, like a value display. Its curve should be drawn transparent. False by default, so both layers are not drawn. - `allow_same_side_connections bool` - When True, connections can happen between two input ports or two output ports. This is only used within one node. We don’t support same side connection between different nodes yet. All other kwargs are passed to CanvasFrame which is the root widget. ## destroy Called by extension before destroying this object. It doesn’t happen automatically. Without this hot reloading doesn’t work. ## filter_upstream Remove nodes that are not upstream of the given nodes ## focus_on_nodes Focus the view on nodes ## get_bbox_of_nodes Get the bounding box of nodes ## layout_all ### omni.kit.widget.graph.GraphView.layout_all Reset positions of all the nodes in the model ### omni.kit.widget.graph.GraphView.set_delegate Replace the delegate of the widget ### omni.kit.widget.graph.GraphView.set_expansion Open, close or minimize all the nodes in the model. ### omni.kit.widget.graph.GraphView.set_model Replace the model of the widget. It will refresh all the content. ### omni.kit.widget.graph.GraphView.subscribe_empty_connection_drop Return the object that will automatically unsubscribe when destroyed. ### omni.kit.widget.graph.GraphView.subscribe_post_delayed_build_layout Return the object that will automatically unsubscribe when destroyed. ### omni.kit.widget.graph.GraphView.subscribe_pre_delayed_build_layout Return the object that will automatically unsubscribe when destroyed. ### omni.kit.widget.graph.GraphView.pan_x The horizontal offset of the scene ### omni.kit.widget.graph.GraphView.pan_y The vertical offset of the scene ## GraphView Properties ### selection Return selected nodes ### virtual_ports Typically source connections go from the left side of the node to the right side of the node. But sometimes it looks messy when circular connections. When `virtual_ports` is true, and the connection is circular, the view draws it from the right side to the left side. Example: A.out ————-&gt; B.surface A.color [REVERSED] &lt;- B.color ### zoom The zoom level of the scene ### zoom_max The maximum zoom level of the scene ### zoom_min The minimum zoom level of the scene
4,715
omni.kit.widget.graph.graph_layout.Classes.md
# omni.kit.widget.graph.graph_layout Classes ## Classes Summary | Class Name | Description | |------------|-------------| | SugiyamaLayout | Compute the coordinates for drawing directed graphs following the method |
217
omni.kit.widget.graph.graph_layout.md
# omni.kit.widget.graph.graph_layout ## Classes Summary - **SugiyamaLayout** - Compute the coordinates for drawing directed graphs following the method
155
omni.kit.widget.graph.graph_layout.SugiyamaLayout.md
# SugiyamaLayout ## Overview The `SugiyamaLayout` class is designed to compute the coordinates for drawing directed graphs following the method developed by Sugiyama. This method involves four main phases: 1. Cycle Removal 2. Layer Assignment 3. Crossing Reduction 4. Coordinate Assignment The input for this class is a list of edges in the format: `[(vertex1, vertex2), (vertex3, vertex4), ...]`. Once the `SugiyamaLayout` object is created, it's possible to get the node layer number immediately. To get the node positions, it's necessary to set each node's size and call `update_positions`. The implementation follows closely to the following papers: - [1] "An Efficient Implementation of Sugiyama’s Algorithm for Layered Graph Drawing" by Eiglsperger, Siebenhaller, and Kaufmann - [2] "Sugiyama Algorithm" by Nikolov - [3] "Graph Drawing Algorithms in Information Visualization" by Frishman ## Methods - `__init__(edges=[], vertical_distance=10.0, horizontal_distance=10.0)` - `get_layer(vertex)` The layer id of the node get_position (vertex) The position of the node set_size (vertex, width, height) Set the size of the node update_positions () 1. Coordinate Assignment __init__ (edges = [], vertical_distance = 10.0, horizontal_distance = 10.0) class Node (id) Bases: object Temporary node that caches all the intermediate compute data add_upstream (node) Add the upstream node. It will add current node to downstream as well. get_layer (vertex) The layer id of the node get_position (vertex) The position of the node set_size (vertex, width, height) Set the size of the node ## Node Size Setting Set the size of the node ## Update Positions Coordinate Assignment
1,688
omni.kit.widget.graph.graph_model.Classes.md
# omni.kit.widget.graph.graph_model Classes ## Classes Summary: | Class | Description | |-------|-------------| | [GraphModel](omni.kit.widget.graph.graph_model/omni.kit.widget.graph.graph_model.GraphModel.html) | The base class for the Graph model. |
253
omni.kit.widget.graph.graph_model.GraphModel.md
# GraphModel ## GraphModel ``` class omni.kit.widget.graph.graph_model.GraphModel ``` The base class for the Graph model. The model is the central component of the graph widget. It is the application’s dynamic data structure, independent of the user interface, and it directly manages the data. It follows closely model–view pattern. It defines the standard interface to be able to interoperate with the components of the model-view architecture. It is not supposed to be instantiated directly. Instead, the user should subclass it to create a new model. The model manages two kinds of data elements. Node and port are the atomic data elements of the model. Both node and port can have any number of sub-ports and any number of input and output connections. There is no specific Python type for the elements of the model. Since Python has dynamic types, the model can return any object as a node or a port. When the widget needs to get a property of the node, it provides the given node back to the model. Example: ```python class UsdShadeModel(GraphModel): @property def nodes(self, prim=None): # Return Usd.Prim in a list return [stage.GetPrimAtPath(selection)] @property def name(self, item=None): # item here is Usd.Prim because UsdShadeModel.nodes returns # Usd.Prim return item.GetPath().name # Accessing nodes and properties example model = UsdShadeModel() # UsdShadeModel decides the type of nodes. It's a list with Usd.Prim nodes = model.nodes for node in nodes: # The node is accessed through evaluation of self[key]. It will # return the proxy object that redirects its properties back to # model. So the following line will call UsdShadeModel.name(node). name = model[node].name print(f"The model has node {name}") | Method | Description | | --- | --- | | `__init__()` | | | `can_connect(source, target)` | Return if it's possible to connect source to target | | `destroy()` | | | `has_nodes(obj)` | Returns true if the model can currently build the graph network using the provided object | | `position_begin_edit(item)` | Called when the user started dragging the node | | `position_end_edit(item)` | Called when the user finished dragging the node and released the mouse | | `size_begin_edit(item)` | Called when the user started resizing the node | | `size_end_edit(item)` | Called when the user finished resizing the node and released the mouse | | `special_select_widget(node, node_widget)` | | | `subscribe_item_changed(fn)` | Return the object that will automatically unsubscribe when destroyed. | | `subscribe_node_changed(fn)` | Return the object that will automatically unsubscribe when destroyed. | | `subscribe_selection_changed(fn)` | Return the object that will automatically unsubscribe when destroyed. | ### Attributes | Attribute | Description | | --- | --- | | `DISPLAY_NAME` | | | `description` | The text label that is displayed on the backdrop in the node graph. | | `display_color` | | | Property | Description | |----------|-------------| | display_color | The node color. | | expansion_state | | | icon | Return icon of the image | | inputs | | | name | The name of the item how it should be displayed in the view | | nodes | | | outputs | | | ports | | | position | Returns the position of the node | | preview | Return the preview of the image | | preview_state | Return the state of the preview of the node | | selection | | | size | The node size. | | stacking_order | This value is a hint when an application cares about the visibility of a node and whether each node overlaps another. | | type | | ### __init__() ### ExpansionState(value) Bases: Enum An enumeration. ### PreviewState(value) <em> <span class="sig-name descname"> <span class="pre"> PreviewState <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> value <span class="sig-paren"> ) <dd> <p> Bases: <code class="xref py py-class docutils literal notranslate"> <span class="pre"> IntFlag <p> An enumeration. <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.graph.graph_model.GraphModel.can_connect"> <span class="sig-name descname"> <span class="pre"> can_connect <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> source , <em class="sig-param"> <span class="n"> <span class="pre"> target <span class="sig-paren"> ) <dd> <p> Return if it’s possible to connect source to target <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.graph.graph_model.GraphModel.has_nodes"> <em class="property"> <span class="pre"> static <span class="w"> <span class="sig-name descname"> <span class="pre"> has_nodes <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> obj <span class="sig-paren"> ) <dd> <p> Returns true if the model can currently build the graph network using the provided object <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.graph.graph_model.GraphModel.position_begin_edit"> <span class="sig-name descname"> <span class="pre"> position_begin_edit <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> item <span class="sig-paren"> ) <dd> <p> Called when the user started dragging the node <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.graph.graph_model.GraphModel.position_end_edit"> <span class="sig-name descname"> <span class="pre"> position_end_edit <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> item <span class="sig-paren"> ) <dd> <p> Called when the user finished dragging the node and released the mouse <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.graph.graph_model.GraphModel.size_begin_edit"> <span class="sig-name descname"> <span class="pre"> size_begin_edit <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> item <span class="sig-paren"> ) <dd> <p> Called when the user started resizing the node <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.graph.graph_model.GraphModel.size_end_edit"> <span class="sig-name descname"> <span class="pre"> size_end_edit <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> item <span class="sig-paren"> ) <dd> <p> Called when the user finished resizing the node and released the mouse <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.graph.graph_model.GraphModel.subscribe_item_changed"> <span class="sig-name descname"> <span class="pre"> subscribe_item_changed <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> fn <span class="sig-paren"> ) <dd> <p> Return the object that will automatically unsubscribe when destroyed. <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.graph.graph_model.GraphModel.subscribe_node_changed"> <span class="sig-name descname"> <span class="pre"> subscribe_node_changed <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> fn <span class="sig-paren"> ) <dd> <p> Return the object that will automatically unsubscribe when destroyed. <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.graph.graph_model.GraphModel.subscribe_selection_changed"> <span class="sig-name descname"> <span class="pre"> subscribe_selection_changed <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> fn <span class="sig-paren"> ### omni.kit.widget.graph.graph_model.GraphModel.subscribe_selection_changed - **Description**: Return the object that will automatically unsubscribe when destroyed. ### omni.kit.widget.graph.graph_model.GraphModel.description - **Description**: The text label that is displayed on the backdrop in the node graph. ### omni.kit.widget.graph.graph_model.GraphModel.display_color - **Description**: The node color. ### omni.kit.widget.graph.graph_model.GraphModel.icon - **Description**: Return icon of the image ### omni.kit.widget.graph.graph_model.GraphModel.name - **Description**: The name of the item how it should be displayed in the view ### omni.kit.widget.graph.graph_model.GraphModel.position - **Description**: Returns the position of the node ### omni.kit.widget.graph.graph_model.GraphModel.preview - **Description**: Return the preview of the image ### omni.kit.widget.graph.graph_model.GraphModel.preview_state - **Description**: Return the state of the preview of the node ### omni.kit.widget.graph.graph_model.GraphModel.size - **Description**: The node size. Is used for nodes like Backdrop. ## Property: stacking_order This value is a hint when an application cares about the visibility of a node and whether each node overlaps another.
8,938
omni.kit.widget.graph.graph_model_batch_position_helper.Classes.md
# omni.kit.widget.graph.graph_model_batch_position_helper Classes ## Classes Summary | Class Name | Description | |------------|-------------| | [GraphModelBatchPositionHelper](omni.kit.widget.graph.graph_model_batch_position_helper/omni.kit.widget.graph.graph_model_batch_position_helper.GraphModelBatchPositionHelper.html) | The model that manages batch position of the items. It can be used to manage |
407
omni.kit.widget.graph.graph_model_batch_position_helper.GraphModelBatchPositionHelper.md
# GraphModelBatchPositionHelper ## GraphModelBatchPositionHelper ```python class omni.kit.widget.graph.graph_model_batch_position_helper.GraphModelBatchPositionHelper ``` Bases: `object` The model that manages batch position of the items. It can be used to manage the position of multi selection, backdrops and upstreams. ### Methods - `__init__()` - `add_get_moving_items_fn(fn)` - Add the function that is called in batch_position_begin_edit to determine which items to move - `batch_position_begin_edit(item)` - Should be called from position_begin_edit to make sure position_begin_edit is called for all the selected nodes - `batch_position_end_edit(item)` - Should be called from position_begin_edit to make sure position_begin_edit is called for all the selected nodes ### batch_set_position (position[, item]) Should be called in the position setter to make sure the position setter is called for all the selected nodes ### Attributes #### batch_proxy Proxy is the isolation model. ### Methods #### __init__() #### add_get_moving_items_fn(fn: Callable[[Any], List[Any]]) Add the function that is called in batch_position_begin_edit to determine which items to move #### batch_position_begin_edit(item: Any) Should be called from position_begin_edit to make sure position_begin_edit is called for all the selected nodes #### batch_position_end_edit(item: Any) Should be called from position_begin_edit to make sure position_begin_edit is called for all the selected nodes #### batch_set_position(position: List[float], item: Any) <span class="pre"> Optional <span class="p"> <span class="pre"> [ <span class="pre"> Any <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 <span class="sig-paren"> ) <dd> <p> Should be called in the position setter to make sure the position setter is called for all the selected nodes <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.widget.graph.graph_model_batch_position_helper.GraphModelBatchPositionHelper.batch_proxy"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> batch_proxy <dd> <p> Proxy is the isolation model. We need it because it converts calls to input/output nodes. <footer> <hr/>
2,393
omni.kit.widget.graph.graph_model_batch_position_helper.md
# omni.kit.widget.graph.graph_model_batch_position_helper ## Classes Summary - **GraphModelBatchPositionHelper** - The model that manages batch position of the items. It can be used to manage
195
omni.kit.widget.graph.graph_node.Classes.md
# omni.kit.widget.graph.graph_node Classes ## Classes Summary | Class Name | Description | |------------|-------------| | GraphNode | Represents the Widget for the single node. Uses the model and the |
204
omni.kit.widget.graph.graph_node.GraphNode.md
# GraphNode ## GraphNode ```python class omni.kit.widget.graph.graph_node.GraphNode(model: GraphModel, item, has_input_connection, has_output_connection, ports: list, delegate) ``` Represents the Widget for the single node. Uses the model and the delegate to fill up its layout. ### Methods | Method | Description | |--------|-------------| | `__init__(model, item, has_input_connection, has_output_connection, ports: list, delegate)` | Save the model, item and delegate to reuse when drawing the widget | | `destroy()` | Called by extension before destroying this object. | ``` ```python rebuild_layout ``` () ## Attributes | Attribute | Description | |-----------|-------------| | `header_frame` | Return the Frame that holds the entire header bar. | | `header_input_frame` | Return the Frame that holds the inputs on the left side of the header bar. | | `header_output_frame` | Return the Frame that holds the outputs on the right side of the header bar. | | `port_center_widgets` | Return the dict for port center widgets (which contains the port name label and edit fields). | | `ports` | | | `selected` | Return the widget selected style state | | `skip_draw_clipped` | Get skip_draw_when_clipped property of the root frame | | `snapping_widgets` | | | `user_drag` | Return the dict with the port as the key and widget that follows the mouse cursor when the user creates a connection. | | `user_drag_placer` | Return the dict with the port as the key and placer that follows the mouse cursor when the user creates a connection. | | `visible` | | ## Methods ### `__init__(model: GraphModel, item, has_input_connection, has_output_connection, ports: list, delegate)` <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.graph.graph_node.GraphNode.__init__"> <span class="sig-name descname"> <span class="pre"> __init__ <span class="sig-paren"> ( <span class="sig-paren"> ) <a class="headerlink" href="#omni.kit.widget.graph.graph_node.GraphNode.__init__" title="Permalink to this definition">  <dd> <p> Save the model, item and delegate to reuse when drawing the widget <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.graph.graph_node.GraphNode.destroy"> <span class="sig-name descname"> <span class="pre"> destroy <span class="sig-paren"> ( <span class="sig-paren"> ) <a class="headerlink" href="#omni.kit.widget.graph.graph_node.GraphNode.destroy" title="Permalink to this definition">  <dd> <p> Called by extension before destroying this object. It doesn’t happen automatically. Without this hot reloading doesn’t work. <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.widget.graph.graph_node.GraphNode.header_frame"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> header_frame <a class="headerlink" href="#omni.kit.widget.graph.graph_node.GraphNode.header_frame" title="Permalink to this definition">  <dd> <p> Return the Frame that holds the entire header bar. <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.widget.graph.graph_node.GraphNode.header_input_frame"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> header_input_frame <a class="headerlink" href="#omni.kit.widget.graph.graph_node.GraphNode.header_input_frame" title="Permalink to this definition">  <dd> <p> Return the Frame that holds the inputs on the left side of the header bar. <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.widget.graph.graph_node.GraphNode.header_output_frame"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> header_output_frame <a class="headerlink" href="#omni.kit.widget.graph.graph_node.GraphNode.header_output_frame" title="Permalink to this definition">  <dd> <p> Return the Frame that holds the outputs on the right side of the header bar. <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.widget.graph.graph_node.GraphNode.port_center_widgets"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> port_center_widgets <a class="headerlink" href="#omni.kit.widget.graph.graph_node.GraphNode.port_center_widgets" title="Permalink to this definition">  <dd> <p> Return the dict for port center widgets (which contains the port name label and edit fields). Dictionary key is the port, value is ui.Widget or None if the delegate does not return a widget <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.widget.graph.graph_node.GraphNode.selected"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> selected <a class="headerlink" href="#omni.kit.widget.graph.graph_node.GraphNode.selected" title="Permalink to this definition">  <dd> <p> Return the widget selected style state <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.widget.graph.graph_node.GraphNode.skip_draw_clipped"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> skip_draw_clipped <a class="headerlink" href="#omni.kit.widget.graph.graph_node.GraphNode.skip_draw_clipped" title="Permalink to this definition">  <dd> <p> Get skip_draw_when_clipped property of the root frame <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.widget.graph.graph_node.GraphNode.user_drag"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> user_drag <a class="headerlink" href="#omni.kit.widget.graph.graph_node.GraphNode.user_drag" title="Permalink to this definition">  <dd> <p> Return the dict with the port as the key and widget that follows the mouse cursor when the user creates a connection. <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.widget.graph.graph_node.GraphNode.user_drag_placer"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> user_drag_placer <a class="headerlink" href="#omni.kit.widget.graph.graph_node.GraphNode.user_drag_placer" title="Permalink to this definition">  <dd> <p> Return the dict with the port as the key and placer that follows the mouse cursor when the user creates a connection.
7,048
omni.kit.widget.graph.graph_node_delegate.Classes.md
# omni.kit.widget.graph.graph_node_delegate Classes ## Classes Summary - **GraphNodeDelegate** - The delegate with the Omniverse design that has both full and collapsed states.
180
omni.kit.widget.graph.graph_node_delegate_closed.Classes.md
# omni.kit.widget.graph.graph_node_delegate_closed Classes ## Classes Summary - **GraphNodeDelegateClosed** - The delegate with the Omniverse design for the nodes of the closed state.
187
omni.kit.widget.graph.graph_node_delegate_closed.GraphNodeDelegateClosed.md
# GraphNodeDelegateClosed ## GraphNodeDelegateClosed ``` class omni.kit.widget.graph.graph_node_delegate_closed.GraphNodeDelegateClosed(scale_factor=1.0) ``` Bases: ``` omni.kit.widget.graph.graph_node_delegate_full.GraphNodeDelegateFull ``` The delegate with the Omniverse design for the nodes of the closed state. ### Methods | Method | Description | |--------|-------------| | __init__(scale_factor) | | | node_footer(model, node_desc) | Called to create widgets of the bottom of the node | | node_header(model, node_desc) | Called to create widgets of the top of the node | | node_header_input(model, node_desc) | | | Method | Description | |--------|-------------| | `node_header_input(model, node_desc)` | Called to create the left part of the header that will be used as input when the node is collapsed | | `node_header_output(model, node_desc)` | Called to create the right part of the header that will be used as output when the node is collapsed | | `__init__(scale_factor=1.0)` | | | `node_footer(model, node_desc: GraphNodeDescription)` | Called to create widgets of the bottom of the node | | `node_header(model, node_desc: GraphNodeDescription)` | Called to create widgets of the top of the node | | `node_header_input(model, node_desc: GraphNodeDescription)` | Called to create the left part of the header that will be used as input when the node is collapsed | | `node_header_output(model, node_desc: GraphNodeDescription)` | | # API Reference ## Header ### `create_right_part_of_header` Called to create the right part of the header that will be used as output when the node is collapsed
1,615
omni.kit.widget.graph.graph_node_delegate_closed.md
# omni.kit.widget.graph.graph_node_delegate_closed ## Classes Summary: | Class | Description | | --- | --- | | [GraphNodeDelegateClosed](omni.kit.widget.graph.graph_node_delegate_closed/omni.kit.widget.graph.graph_node_delegate_closed.GraphNodeDelegateClosed.html) | The delegate with the Omniverse design for the nodes of the closed state. |
344
omni.kit.widget.graph.graph_node_delegate_full.color_to_hex.md
# color_to_hex ## color_to_hex Convert float rgb to int ### Function Definition ```python omni.kit.widget.graph.graph_node_delegate_full.color_to_hex(color: tuple) -> int ``` ```
180
omni.kit.widget.graph.graph_node_delegate_full.GraphNodeDelegateFull.md
# GraphNodeDelegateFull ## GraphNodeDelegateFull ```python class omni.kit.widget.graph.graph_node_delegate_full.GraphNodeDelegateFull(scale_factor=1.0) ``` Bases: `AbstractGraphNodeDelegate` The delegate with the Omniverse design. ### Methods ```python __init__(scale_factor=1.0) ``` ```python connection(model, source, target, foreground) ``` Called to create the connection between ports ```python node_background(model, node_desc) ``` Called to create widgets of the node background ```python node_footer(model, node_desc) | Method | Description | |--------|-------------| | `node_footer(model, node_desc)` | Called to create widgets of the bottom of the node | | `node_header(model, node_desc)` | Called to create widgets of the top of the node | | `node_header_input(model, node_desc)` | Called to create the left part of the header that will be used as input when the node is collapsed | | `node_header_output(model, node_desc)` | Called to create the right part of the header that will be used as output when the node is collapsed | | `port(model, node_desc, port_desc)` | Called to create the middle part of the port | | `port_input(model, node_desc, port_desc)` | Called to create the left part of the port that will be used as input | | `port_output(model, node_desc, port_desc)` | Called to create the right part of the port that will be used as output | ### `__init__(scale_factor=1.0)` ### `connection(model, source: GraphConnectionDescription, target: GraphConnectionDescription, foreground: bool = False)` Called to create the connection between ports ### node_background Called to create widgets of the node background ### node_footer Called to create widgets of the bottom of the node ### node_header Called to create widgets of the top of the node ### node_header_input Called to create the left part of the header that will be used as input when the node is collapsed ### node_header_output Called to create the right part of the header that will be used as output when the node is collapsed ### port ### GraphNodeDelegateFull Methods #### port ```python def port(model, node_desc: GraphNodeDescription, port_desc: GraphPortDescription): pass ``` Called to create the middle part of the port #### port_input ```python def port_input(model, node_desc: GraphNodeDescription, port_desc: GraphPortDescription): pass ``` Called to create the left part of the port that will be used as input #### port_output ```python def port_output(model, node_desc: GraphNodeDescription, port_desc: GraphPortDescription): pass ``` Called to create the right part of the port that will be used as output
2,631
omni.kit.widget.graph.graph_node_delegate_full.md
# omni.kit.widget.graph.graph_node_delegate_full ## Classes Summary - **GraphNodeDelegateFull** - The delegate with the Omniverse design. ## Functions Summary - **color_to_hex** - Convert float rgb to int
212
omni.kit.widget.graph.graph_node_delegate_router.Classes.md
# omni.kit.widget.graph.graph_node_delegate_router Classes ## Classes Summary | Class Name | Description | |------------|-------------| | GraphNodeDelegateRouter | The delegate that keeps multiple delegates and pick them depending on the | | GraphNodeDelegateRoutingError | This exception is used when it’s not possible to do routing. Can only | | RoutingCondition | RoutingCondition(type, expression, delegate) |
415
omni.kit.widget.graph.graph_node_delegate_router.GraphNodeDelegateRouter.md
# GraphNodeDelegateRouter ## GraphNodeDelegateRouter Bases: `AbstractGraphNodeDelegate` The delegate that keeps multiple delegates and pick them depending on the routing conditions. It’s possible to add the routing conditions with `add_route`, and conditions could be a type or a lambda expression. The latest added routing is stronger than previously added. Routing added without conditions is the default. We use type routing to make the specific kind of nodes unique, and also we can use the lambda function to make the particular state of nodes unique (ex. full/collapsed). It’s possible to use type and lambda routing at the same time. Usage examples: ``` delegate.add_route(TextureDelegate(), type="Texture2d") delegate.add_route(CollapsedDelegate(), expression=is_collapsed) ``` ### Methods - `__init__()` - `add_route(delegate[, type, expression])` - Add delegate to the routing table - `connection(model, source, target[, foreground])` | Method | Description | |--------|-------------| | `create` | Called to create the connection between ports | | `destroy()` | | | `get_node_layout(model, node_desc)` | Called to determine the node layout | | `node_background(model, node_desc)` | Called to create widgets of the node background | | `node_background_v2(model, node_desc, draw_icon)` | Called to create widgets of the node background | | `node_footer(model, node_desc)` | Called to create widgets of the bottom of the node | | `node_header(model, node_desc)` | Called to create widgets of the top of the node | | `node_header_input(model, node_desc)` | Called to create the left part of the header that will be used as input when the node is collapsed | | `node_header_output(model, node_desc)` | Called to create the right part of the header that will be used as output when the node is collapsed | | `port(model, node_desc, port_desc)` | Called to create the middle part of the port | | `port_input(model, node_desc, port_desc)` | Called to create the left part of the port that will be used as input | | `port_output(model, node_desc, port_desc)` | Called to create the right part of the port that will be used as output | ### `__init__()` ### `add_route(delegate:)` ### AbstractGraphNodeDelegate ### type = None ### expression = None Add delegate to the routing table ### connection(model, source: GraphConnectionDescription, target: GraphConnectionDescription, foreground: bool = False) Called to create the connection between ports ### get_node_layout(model, node_desc: GraphNodeDescription) Called to determine the node layout ### node_background(model, node_desc: GraphNodeDescription) Called to create widgets of the node background ### node_background_v2(model, node_desc: GraphNodeDescription) ### node_background_v2(model, node_desc: GraphNodeDescription, draw_icon: bool) Called to create widgets of the node background ### node_footer(model, node_desc: GraphNodeDescription) Called to create widgets of the bottom of the node ### node_header(model, node_desc: GraphNodeDescription) Called to create widgets of the top of the node ### node_header_input(model, node_desc: GraphNodeDescription) Called to create the left part of the header that will be used as input when the node is collapsed ### node_header_output(model, node_desc: GraphNodeDescription) Called to create the right part of the header that will be used as output when the node is collapsed ### port(model, node_desc: GraphNodeDescription) ### GraphNodeDelegateRouter Methods #### port ```python def port(node_desc: GraphNodeDescription, port_desc: GraphPortDescription): ... ``` Called to create the middle part of the port. #### port_input ```python def port_input(model, node_desc: GraphNodeDescription, port_desc: GraphPortDescription): ... ``` Called to create the left part of the port that will be used as input. #### port_output ```python def port_output(model, node_desc: GraphNodeDescription, port_desc: GraphPortDescription): ... ``` Called to create the right part of the port that will be used as output.
4,051
omni.kit.widget.graph.graph_node_delegate_router.GraphNodeDelegateRoutingError.md
# GraphNodeDelegateRoutingError ## GraphNodeDelegateRoutingError This exception is used when it’s not possible to do routing. Can only happen if there is no default route in the table. ### __init__(*args, **kwargs)
217
omni.kit.widget.graph.graph_node_delegate_router.RoutingCondition.md
# RoutingCondition ## RoutingCondition ``` class omni.kit.widget.graph.graph_node_delegate_router.RoutingCondition(type, expression, delegate) ``` Bases: `tuple` ### Methods ### Attributes | Name | Description | | --- | --- | | delegate | Alias for field number 2 | | expression | Alias for field number 1 | | type | Alias for field number 0 | ``` def __init__(self) <dl class="py attribute"> <dt class="sig sig-object py" id="omni.kit.widget.graph.graph_node_delegate_router.RoutingCondition.delegate"> <span class="sig-name descname"> <span class="pre"> delegate <dd> <p> Alias for field number 2 <dl class="py attribute"> <dt class="sig sig-object py" id="omni.kit.widget.graph.graph_node_delegate_router.RoutingCondition.expression"> <span class="sig-name descname"> <span class="pre"> expression <dd> <p> Alias for field number 1 <dl class="py attribute"> <dt class="sig sig-object py" id="omni.kit.widget.graph.graph_node_delegate_router.RoutingCondition.type"> <span class="sig-name descname"> <span class="pre"> type <dd> <p> Alias for field number 0
1,233
omni.kit.widget.graph.graph_node_index.Classes.md
# omni.kit.widget.graph.graph_node_index Classes ## Classes Summary: | Class | Description | |-------|-------------| | [GraphNodeIndex](omni.kit.widget.graph.graph_node_index/omni.kit.widget.graph.graph_node_index.GraphNodeIndex.html) | Hirarchy index of the model. Provides fast access to the nodes and connections. |
320
omni.kit.widget.graph.graph_node_index.GraphNodeIndex.md
# GraphNodeIndex ## GraphNodeIndex ```python class omni.kit.widget.graph.graph_node_index.GraphNodeIndex(model: Optional[GraphModel], port_grouping: bool) ``` Bases: `object` Hirarchy index of the model. Provides fast access to the nodes and connections. ### Methods - `__init__(model, port_grouping)` - `get_diff(other)` - Generate the difference object: the list of nodes and connections to add and delete. - `mutate(diff)` ``` | Apply the difference to the cache index. | ``` ```markdown __init__(model: Optional[GraphModel], port_grouping: bool) ``` ```markdown get_diff(other: GraphNodeIndex) Generate the difference object: the list of nodes and connections to add and delete. ``` ```markdown mutate(diff: Union[GraphNodeIndex, GraphNodeDiff]) -> Tuple[Set] Apply the difference to the cache index. ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown --- ``` ```markdown ---
11,273
omni.kit.widget.graph.graph_view.Classes.md
# omni.kit.widget.graph.graph_view Classes ## Classes Summary | Class Name | Description | |------------|-------------| | [GraphView](omni.kit.widget.graph.graph_view/omni.kit.widget.graph.graph_view.GraphView.html) | The visualisation layer of omni.kit.widget.graph. It behaves like a |
289
omni.kit.widget.graph.graph_view.GraphView.md
# GraphView ## GraphView ```python class omni.kit.widget.graph.graph_view.GraphView(**kwargs) ``` ### Keyword Arguments: ```python def __init__(**kwargs) ``` ```python def destroy() ``` Called by extension before destroying this object. ```python def filter_upstream(nodes) ``` Remove nodes that are not upstream of the given nodes ```python def focus_on_nodes([nodes]) ``` Focus the view on nodes ```python def get_bbox_of_nodes([nodes]) ``` | Method | Description | | --- | --- | | `layout_all()` | Reset positions of all the nodes in the model | | `set_delegate(delegate)` | Replace the delegate of the widget | | `set_expansion(state)` | Open, close or minimize all the nodes in the model | | `set_model(model)` | Replace the model of the widget | | `subscribe_empty_connection_drop(fn)` | Return the object that will automatically unsubscribe when destroyed | | `subscribe_post_delayed_build_layout(fn)` | Return the object that will automatically unsubscribe when destroyed | | `subscribe_pre_delayed_build_layout(fn)` | Return the object that will automatically unsubscribe when destroyed | ### Attributes | Attribute | Description | | --- | --- | | `DEFAULT_DISTANCE_BETWEEN_NODES` | | | `model` | | | `pan_x` | The horizontal offset of the scene | | `pan_y` | The vertical offset of the scene | | `raster_nodes` | | | `selection` | Return selected nodes | | `virtual_ports` | Typically source connections go from the left side of the node to the right side of the node | | `zoom` | The zoom level of the scene | | zoom_max | The maximum zoom level of the scene | |----------|-------------------------------------| | zoom_min | The minimum zoom level of the scene | ### Keyword Arguments: - `model <span class="classifier">GraphModel` - Model to display the node graph - `delegate <span class="classifier">AbstractGraphNodeDelegate` - Delegate to draw the node - `virtual_ports <span class="classifier">bool` - True when the model should use reversed output for better look of the graph. - `port_grouping <span class="classifier">bool` - True when the widget should use sub-ports for port grouping. - `draw_curve_top_layer <span class="classifier">bool` - When True, connections are drawn in 2 passes. The “under” layer is for the opaque curve, and the “top” or “over” layer is meant for floating curve anchor decorations that need to be on top of all nodes, like a value display. Its curve should be drawn transparent. False by default, so both layers are not drawn. - `allow_same_side_connections <span class="classifier">bool` - When True, connections can happen between two input ports or two output ports. This is only used within one node. We don’t support same side connection between different nodes yet. All other kwargs are passed to CanvasFrame which is the root widget. ### __init__ - **kwargs - kwargs ### destroy - Called by extension before destroying this object. It doesn’t happen automatically. Without this hot reloading doesn’t work. ### filter_upstream - nodes : list - Remove nodes that are not upstream of the given nodes ### focus_on_nodes - nodes : Optional[List[Any]] = None - Focus the view on nodes ### get_bbox_of_nodes - nodes - (Unfinished content) ### GraphView Methods #### get_bbox_of_nodes() Get the bounding box of nodes #### layout_all() Reset positions of all the nodes in the model #### set_delegate(delegate: AbstractGraphNodeDelegate) Replace the delegate of the widget #### set_expansion(state: ExpansionState) Open, close or minimize all the nodes in the model. #### set_model(model: GraphModel) Replace the model of the widget. It will refresh all the content. #### subscribe_empty_connection_drop(fn) Return the object that will automatically unsubscribe when destroyed. #### subscribe_post_delayed_build_layout(fn) Return the object that will automatically unsubscribe when destroyed. #### subscribe_pre_delayed_build_layout(fn) Return the object that will automatically unsubscribe when destroyed. ### GraphView Properties #### pan_x <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.widget.graph.graph_view.GraphView.pan_x"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> pan_x <dd> <p> The horizontal offset of the scene <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.widget.graph.graph_view.GraphView.pan_y"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> pan_y <dd> <p> The vertical offset of the scene <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.widget.graph.graph_view.GraphView.selection"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> selection <dd> <p> Return selected nodes <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.widget.graph.graph_view.GraphView.virtual_ports"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> virtual_ports <dd> <p> Typically source connections go from the left side of the node to the right side of the node. But sometimes it looks messy when circular connections. When `virtual_ports` is true, and the connection is circular, the view draws it from the right side to the left side. <p> Example: A.out ————-&gt; B.surface A.color [REVERSED] &lt;- B.color <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.widget.graph.graph_view.GraphView.zoom"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> zoom <dd> <p> The zoom level of the scene <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.widget.graph.graph_view.GraphView.zoom_max"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> zoom_max <dd> <p> The maximum zoom level of the scene <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.widget.graph.graph_view.GraphView.zoom_min"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> zoom_min <dd> <p> The minminum zoom level of the scene
6,738
omni.kit.widget.graph.IsolationGraphModel.md
# IsolationGraphModel ## IsolationGraphModel ```python class omni.kit.widget.graph.IsolationGraphModel(model: GraphModel, root) ``` ### Methods - `__init__(model, root)` - `add_input_or_output(position[, is_input])` - `can_connect(source, target)` - Return if it's possible to connect source to target - `clear_caches()` - `destroy()` - `position_begin_edit(item)` ``` | Code Block | Description | |------------|-------------| | `position_end_edit` (item) | | | `subscribe_item_changed` (fn) | Return the object that will automatically unsubscribe when destroyed. | | `subscribe_node_changed` (fn) | Return the object that will automatically unsubscribe when destroyed. | | `subscribe_selection_changed` (fn) | Return the object that will automatically unsubscribe when destroyed. | | `nodes` | It's only called to get the nodes from the top level | | `selection` | | ### Attributes #### `__init__` ```python __init__(model: GraphModel, root) ``` #### `EmptyPort` ```python class EmptyPort(parent: Union[InputNode, OutputNode]) ``` Bases: `object` Is used by the model for an empty port ##### `get_type_name` ```python static get_type_name() -> str ``` The string type that goes the source model and view ### InputNode ```python class InputNode(model: GraphModel, source) ``` Bases: `object` Is used by the model for the input node. This node represents input ports of the compound node and it’s placed to the subnetwork of the compound. #### get_type_name ```python static get_type_name() -> str ``` The string type that goes the source model and view #### ports ```python property ports : Optional[List[Any]] ``` The list of ports of this node. It only has input ports from the compound node. ### MagicWrapperMeta ```python class MagicWrapperMeta(name, bases, dct) ``` Bases: `type` Python always looks in the class (and parent classes) __dict__ for magic methods and __getattr__ doesn’t work, but since we want to override them, we need to use this trick with proxy property. It makes the class looking like the source object. See [https://stackoverflow.com/questions/9057669](https://stackoverflow.com/questions/9057669) for details. ### OutputNode ```python class OutputNode(model: GraphModel, source) ``` Bases: `object` Is used by the model for the output node. This node represents output ports of the compound node and it’s placed to the subnetwork of the compound. compound. <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.graph.IsolationGraphModel.OutputNode.get_type_name"> <em class="property"> <span class="pre"> static <span class="w"> <span class="sig-name descname"> <span class="pre"> get_type_name <span class="sig-paren"> ( <span class="sig-paren"> ) <span class="sig-return"> <span class="sig-return-icon"> → <span class="sig-return-typehint"> <span class="pre"> str <dd> <p> The string type that goes the source model and view <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.widget.graph.IsolationGraphModel.OutputNode.ports"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> ports <em class="property"> <span class="p"> <span class="pre"> : <span class="w"> <span class="pre"> Optional <span class="p"> <span class="pre"> [ <span class="pre"> List <span class="p"> <span class="pre"> [ <span class="pre"> Any <span class="p"> <span class="pre"> ] <span class="p"> <span class="pre"> ] <dd> <p> The list of ports of this node. It only has output ports from the compound node. <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.graph.IsolationGraphModel.can_connect"> <span class="sig-name descname"> <span class="pre"> can_connect <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> source <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"> target <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> Any <span class="sig-paren"> ) <dd> <p> Return if it’s possible to connect source to target <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.graph.IsolationGraphModel.subscribe_item_changed"> <span class="sig-name descname"> <span class="pre"> subscribe_item_changed <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> fn <span class="sig-paren"> ) <dd> <p> Return the object that will automatically unsubscribe when destroyed. <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.graph.IsolationGraphModel.subscribe_node_changed"> <span class="sig-name descname"> <span class="pre"> subscribe_node_changed <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> fn <span class="sig-paren"> ) <dd> <p> Return the object that will automatically unsubscribe when destroyed. <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.graph.IsolationGraphModel.subscribe_selection_changed"> <span class="sig-name descname"> <span class="pre"> subscribe_selection_changed <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> fn <span class="sig-paren"> ) <dd> <p> Return the object that will automatically unsubscribe when destroyed. <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.widget.graph.IsolationGraphModel.nodes"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> nodes <dd> <p> It’s only called to get the nodes from the top level
7,103
omni.kit.widget.graph.isolation_graph_model.Classes.md
# omni.kit.widget.graph.isolation_graph_model Classes ## Classes Summary - [IsolationGraphModel](omni.kit.widget.graph.isolation_graph_model/omni.kit.widget.graph.isolation_graph_model.IsolationGraphModel.html)
212
omni.kit.widget.graph.isolation_graph_model.IsolationGraphModel.md
# IsolationGraphModel ## IsolationGraphModel ```python class omni.kit.widget.graph.isolation_graph_model.IsolationGraphModel(model: GraphModel, root) ``` Bases: `object` ### Methods - `__init__(model, root)` - `add_input_or_output(position[, is_input])` - `can_connect(source, target)` - Return if it's possible to connect source to target - `clear_caches()` - `destroy()` ``` | Method | Description | | ------ | ----------- | | `position_begin_edit(item)` | | | `position_end_edit(item)` | | | `subscribe_item_changed(fn)` | Return the object that will automatically unsubscribe when destroyed. | | `subscribe_node_changed(fn)` | Return the object that will automatically unsubscribe when destroyed. | | `subscribe_selection_changed(fn)` | Return the object that will automatically unsubscribe when destroyed. | ### Attributes | Attribute | Description | | --------- | ----------- | | `nodes` | It's only called to get the nodes from the top level | | `selection` | | ### Method ```python __init__(model: GraphModel, root) ``` ### Class ```python class EmptyPort(parent: Union[InputNode, OutputNode]) ``` - **Bases:** `object` - **Description:** Is used by the model for an empty port ### Method in Class EmptyPort ```python static get_type_name() ``` ### IsolationGraphModel.EmptyPort.get_type_name The string type that goes the source model abd view ### IsolationGraphModel.InputNode Bases: `object` Is used by the model for the input node. This node represents input ports of the compound node and it’s placed to the subnetwork of the compound. #### InputNode.get_type_name The string type that goes the source model and view #### InputNode.ports The list of ports of this node. It only has input ports from the compound node. ### IsolationGraphModel.MagicWrapperMeta Bases: `type` Python always looks in the class (and parent classes) __dict__ for magic methods and __getattr__ doesn’t work, but since we want to override them, we need to use this trick with proxy property. It makes the class looking like the source object. See [https://stackoverflow.com/questions/9057669](https://stackoverflow.com/questions/9057669) for details. ### IsolationGraphModel.OutputNode Bases: ```python object ``` Is used by the model for the ouput node. This node represents output ports of the compound node and it’s placed to the subnetwork of the compound. ```python static get_type_name() -> str ``` The string type that goes the source model and view ```python property ports: Optional[List[Any]] ``` The list of ports of this node. It only has output ports from the compound node. ```python can_connect(source: Any, target: Any) ``` Return if it’s possible to connect source to target ```python subscribe_item_changed(fn) ``` Return the object that will automatically unsubscribe when destroyed. ```python subscribe_node_changed(fn) ``` Return the object that will automatically unsubscribe when destroyed. ```python subscribe_selection_changed(fn) ``` Return the object that will automatically unsubscribe when destroyed. ```python property nodes ``` # Getting Started ## Overview This is a guide to help you get started with our project. ## Installation To install the project, follow these steps: 1. Download the project files. 2. Install the necessary dependencies. ## Usage Once installed, you can use the project by following these instructions: 1. Start the application. 2. Navigate through the features. ## FAQ ### What is the purpose of the get\_nodes function? It’s only called to get the nodes from the top level.
3,563
omni.kit.widget.graph.md
# omni.kit.widget.graph ## Submodules Summary: | Submodule | Description | |-----------|-------------| | omni.kit.widget.graph.abstract_batch_position_getter | No submodule docstring provided | | omni.kit.widget.graph.abstract_graph_node_delegate | No submodule docstring provided | | omni.kit.widget.graph.backdrop_delegate | No submodule docstring provided | | omni.kit.widget.graph.backdrop_getter | No submodule docstring provided | | omni.kit.widget.graph.compound_node_delegate | No submodule docstring provided | | omni.kit.widget.graph.graph_layout | No submodule docstring provided | | omni.kit.widget.graph.graph_model | No submodule docstring provided | | omni.kit.widget.graph.graph_model_batch_position_helper | No submodule docstring provided | | omni.kit.widget.graph.graph_node | No submodule docstring provided | | omni.kit.widget.graph.graph_node_delegate | No submodule docstring provided | | omni.kit.widget.graph.graph_node_delegate_closed | No submodule docstring provided | | omni.kit.widget.graph.graph_node_delegate_full | No submodule docstring provided | omni.kit.widget.graph.graph_node_delegate_full No submodule docstring provided omni.kit.widget.graph.graph_node_delegate_router No submodule docstring provided omni.kit.widget.graph.graph_node_index No submodule docstring provided omni.kit.widget.graph.graph_view No submodule docstring provided omni.kit.widget.graph.isolation_graph_model No submodule docstring provided omni.kit.widget.graph.selection_getter No submodule docstring provided Classes Summary: AbstractBatchPositionGetter Helper to get the nodes to move at the same time AbstractGraphNodeDelegate The delegate generates widgets that together form the node using the BackdropDelegate The delegate with the Omniverse design for the nodes of the closed state. BackdropGetter Helper to get the nodes that placed in the given backdrop CompoundInputOutputNodeDelegate The delegate for the input/output nodes of the compound. CompoundNodeDelegate The delegate for the compound nodes. GraphConnectionDescription The object that holds the main attributes of the connection GraphModel The base class for the Graph model. GraphModelBatchPositionHelper The model that manages batch position of the items. It can be used to manage GraphNodeDelegate The delegate with the Omniverse design that has both full and collapsed states. GraphNodeDelegateRouter The delegate that keeps multiple delegates and pick them depending on the GraphNodeDescription The object that holds the main attributes of the node GraphNodeLayout An enumeration. GraphPortDescription The object that holds the main attributes of the port GraphView ## GraphView The visualisation layer of omni.kit.widget.graph. It behaves like a ## IsolationGraphModel ## SelectionGetter Helper to get the selection of the given model. It’s supposed to be
2,875
omni.kit.widget.graph.SelectionGetter.md
# SelectionGetter ## SelectionGetter ``` class omni.kit.widget.graph.SelectionGetter(model: GraphModel) ``` Bases: `AbstractBatchPositionGetter` Helper to get the selection of the given model. It’s supposed to be used with GraphModelBatchPosition. ### Methods - `__init__(model)` ### Attributes ## __init__ ``` __init__(model: GraphModel) ``` ```
355
omni.kit.widget.graph.selection_getter.Classes.md
# omni.kit.widget.graph.selection_getter Classes ## Classes Summary | Class | Description | |-------|-------------| | [SelectionGetter](omni.kit.widget.graph.selection_getter/omni.kit.widget.graph.selection_getter.SelectionGetter.html) | Helper to get the selection of the given model. It’s supposed to be |
309
omni.kit.widget.graph.selection_getter.SelectionGetter.md
# SelectionGetter ## Methods - `__init__(model)` ## Attributes - None ### `__init__(model)` Initialize the SelectionGetter with a GraphModel. # 标题 这是一个段落,包含一些文本信息。 ## 子标题 这里是另一个段落。
189
omni.kit.widget.graph.Submodules.md
# omni.kit.widget.graph Submodules ## Submodules Summary - **omni.kit.widget.graph.abstract_batch_position_getter** - No submodule docstring provided - **omni.kit.widget.graph.abstract_graph_node_delegate** - No submodule docstring provided - **omni.kit.widget.graph.backdrop_delegate** - No submodule docstring provided - **omni.kit.widget.graph.backdrop_getter** - No submodule docstring provided - **omni.kit.widget.graph.compound_node_delegate** - No submodule docstring provided - **omni.kit.widget.graph.graph_layout** - No submodule docstring provided - **omni.kit.widget.graph.graph_model** - No submodule docstring provided - **omni.kit.widget.graph.graph_model_batch_position_helper** - No submodule docstring provided - **omni.kit.widget.graph.graph_node** - No submodule docstring provided - **omni.kit.widget.graph.graph_node_delegate** - No submodule docstring provided - **omni.kit.widget.graph.graph_node_delegate_closed** - No submodule docstring provided | omni.kit.widget.graph.graph_node_delegate_full | No submodule docstring provided | | --- | --- | | omni.kit.widget.graph.graph_node_delegate_router | No submodule docstring provided | | omni.kit.widget.graph.graph_node_index | No submodule docstring provided | | omni.kit.widget.graph.graph_view | No submodule docstring provided | | omni.kit.widget.graph.isolation_graph_model | No submodule docstring provided | | omni.kit.widget.graph.selection_getter | No submodule docstring provided |
1,499
omni.kit.widget.layers.Classes.md
# omni.kit.widget.layers Classes  ## Classes Summary: | Class Name | Description | |------------------|--------------------------------------------------------------| | ContextMenu | Context menu for the layers widget | | LayerExtension | The entry point for Layer 2 | | LayerItem | A single AbstractItemModel item that represents a single sublayer | | LayerModel | Class representing the Layer Model. | | LayerUtils | LayerUtils provides utilities for operating layers. | | PrimSpecItem | A single AbstractItemModel item that represents a single prim |
730
omni.kit.widget.layers.ContextMenu.md
# ContextMenu ## ContextMenu ```python class omni.kit.widget.layers.ContextMenu(usd_context) ``` Bases: `object` Context menu for the layers widget ### Methods - **__init__(usd_context)** - Initializes the ContextMenu with a specific USD context. - **add_menu(menu_list)** - Add the menu to the end of the context menu. - **can_be_set_as_authoring_target()** - Check if the selected item can be set as authoring target. - **can_delete_prim()** - Check if the selected item can be deleted. - **can_edit_root_layer()** - Check if selected tree view can edit root layer. - **can_edit_sublayer()** - Check if selected tree view can edit sublayer. can_edit_sublayer Check if selected layer item can edit sublayer. can_edit_sublayer_parent Check if selected layer item's parent can edit sublayer. can_flatten_sublayers Check if selected layer item can flatten sublayer. can_merge_layer_down Check if the selected layer item can be merged down. can_not_edit_sublayer Check if selected layer item can edit sublayer. can_set_as_edit_target Check if selected layer can set as edit target. clear_all_linked_prims (objects) Clear all the linked prims from a specific layer item. copy_layer_url Deprecated. copy_url Copy the selected item's url to clipboard. create_anonymous_sublayer Create anonymous sublayer for selected layer item. create_sublayer ([anonymous]) Create sublayer for selected layer item. find_in_browser Navigate to selected layer's file if found it in content browser. flatten_sublayers Faltten selected layer item. has_any_items_selected Check any items selected. has_no_layers_locked Check if the selected item has not layers locked. - `has_payload_or_reference()` - checks if prim has references - `has_selections(objects)` - If the usd context has selections. - `has_sublayers()` - Check if the selected stage has sublayers. - `insert_sublayer()` - Insert sublayer into selected layer item. - `is_anonymous_layer()` - Check if the selected layer item is anonymous layer. - `is_authoring_layer()` - Check if the selected item is authoring layer. - `is_auto_authoring_mode()` - Check if the selected item is in auto authoring mode. - `is_auto_authoring_or_spec_linking_mode()` - Check if the selected item is in spec linking mode or auto authoring mode. - `is_edit_layer()` - Check if the selected item is edit layer item. - `is_from_session_layer_tree()` - Check if the selected item is from session layer tree. - `is_item_expaned()` - Unused. - `is_layer_and_parent_unmuted()` - Check if the selected layer item is muted and parent muted. - `is_layer_dirty()` - Check if the selected layer item is dirty. - `is_layer_item()` - Check if the selected item is layer item. - `is_layer_locked()` - Check if the selected layer item is locked. | Function Name | Description | |---------------|-------------| | is_layer_locked | Check if the selected layer item is locked. | | is_layer_locked_by_other | Deprecated. | | is_layer_not_locked | Check if the selected layer item is not locked. | | is_layer_not_locked_by_other | Check if the selected layer item is not locked by other. | | is_layer_or_parent_muted | Check if the selected layer item is muted or parent muted. | | is_layer_read_only | Check if the selected layer item is not locked. | | is_layer_writable | Check if the selected layer item is writable. | | is_live_session_layer | Check if selected layer item is live session layer. | | is_live_syncing_layer | Check if selected layer item is live syncing layer. | | is_material | Check if the selected item's type is material. | | is_missing_layer | Check if the selected item is missing layer. | | is_not_anonymous_layer | Check if the selected layer item is not anonymous layer. | | is_not_authoring_layer | Check if the selected item is not authoring layer. | | is_not_auto_authoring_and_spec_linking_mode | Check if the selected item is not in spec linking mode and auto authoring mode. | | is_not_edit_layer | Check if the selected item is not edit layer item. | <p> is_not_from_session_layer_tree() <p> Check if the selected item is not from session layer tree. <p> is_not_live_layer() <p> Check if selected layer item is not live syncing layer. <p> is_not_live_session_layer() <p> Check if selected layer item is not live session layer. <p> is_not_missing_layer() <p> Check if the selected item is not missing layer. <p> is_not_omni_layer() <p> Check if the selected item is not omniverse layer. <p> is_not_reserved_layer() <p> Check if the selected item is not reserved layer. <p> is_omni_layer() <p> Check if the selected item is omniverse layer. <p> is_over_specifier(objects) <p> Check if the selected prim item's specifier is 'OVER_ONLY'. <p> is_prim_spec_item() <p> Check if the selected item is prim spec item. <p> is_reserved_layer() <p> Check if the selected item is reserved layer. <p> is_spec_linking_mode() <p> Check if the selected item is in spec linking mode. <p> link_selected_prims(objects) <p> Link the selected prims to a specific layer item. <p> link_selected_prims_with_hierarchy(objects) <p> Link the selected prims to a specific layer item with hierarchy. <p> merge_down_one() <p> Merge selected layer items down to one. <p> move_prims() <p> Move selected prims to a specific layer item. - `move_prims` (objects) - Move selected prim spec item. - `no_items_selected` () - Check any items selected. - `on_mouse_event` (event) - Handles mouse events and show context menu based on the event type. - `prim_delete` () - Delete selected prim spec item. - `refresh_reference_payload_name` () - Checks if prims have references/payload and returns name. - `reload_layer` () - Reload selected layer item. - `remove_layer` () - Remove selected layer item. - `save_layer` () - Save selected layer. - `save_layer_as` () - Save selected layer, it will open a file picker dialog to select save path. - `save_layer_as_and_replace` () - Save selected layer, it will open a file picker dialog to select save path, and overwrite the exist layer file. - `select_linked_prims` (objects) - Select the linked prims from a specific layer item. - `set_authoring_layer` () - Set the selected layer as authoring layer. - `set_edit_layer` () - Set the selected layer as default edit layer. - `show_open_close_tree` () - Toggle tree from a specific layer/prim item. - `unlink_selected_prims` (objects) - Unlink the selected prims to a specific layer item. unlink_selected_prims_with_hierarchy (objects) Unlink the selected prims to a specific layer item with hierarchy. __init__ (usd_context) Initializes the ContextMenu with a specific USD context. Parameters ---------- usd_context (omni.usd.UsdContext) – The USD context to be associated with this context menu. add_menu (menu_list) Add the menu to the end of the context menu. Return the object that should be alive all the time. Once the returned object is destroyed, the added menu is destroyed as well. can_be_set_as_authoring_target () Check if the selected item can be set as authoring target. Parameters ---------- objects (dict) – A dictionary containing selected item information. Returns ------- bool can_delete_prim () Check if the selected item can be deleted. Parameters ---------- objects (dict) – A dictionary containing selected item information. Returns ------- bool can_edit_root_layer () Check if selected tree view can edit root layer. Parameters ---------- objects (dict) – A dictionary containing selected item information. Returns ------- bool can_edit_sublayer () Check if selected layer item can edit sublayer. Parameters ---------- objects (dict) – A dictionary containing selected item information. Returns ------- bool can_edit_sublayer_parent () Check if selected layer item can edit sublayer parent. Parameters ---------- objects (dict) – A dictionary containing selected item information. Returns ------- bool <p> Check if selected layer item’s parent can edit sublayer. <dl class="field-list simple"> <dt class="field-odd"> Parameters <dd class="field-odd"> <p> <strong> objects ( <em> dict ) – A dictionary containing selected item information. <dt class="field-even"> Returns <dd class="field-even"> <p> bool <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.layers.ContextMenu.can_flatten_sublayers"> <span class="sig-name descname"> <span class="pre"> can_flatten_sublayers <span class="sig-paren"> ( <span class="sig-paren"> ) <a class="headerlink" href="#omni.kit.widget.layers.ContextMenu.can_flatten_sublayers" title="Permalink to this definition">  <dd> <p> Check if selected layer item can flatten sublayer. <dl class="field-list simple"> <dt class="field-odd"> Parameters <dd class="field-odd"> <p> <strong> objects ( <em> dict ) – A dictionary containing selected item information. <dt class="field-even"> Returns <dd class="field-even"> <p> bool <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.layers.ContextMenu.can_merge_layer_down"> <span class="sig-name descname"> <span class="pre"> can_merge_layer_down <span class="sig-paren"> ( <span class="sig-paren"> ) <a class="headerlink" href="#omni.kit.widget.layers.ContextMenu.can_merge_layer_down" title="Permalink to this definition">  <dd> <p> Check if the selected layer item can be merged down. <dl class="field-list simple"> <dt class="field-odd"> Parameters <dd class="field-odd"> <p> <strong> objects ( <em> dict ) – A dictionary containing selected item information. <dt class="field-even"> Returns <dd class="field-even"> <p> bool <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.layers.ContextMenu.can_not_edit_sublayer"> <span class="sig-name descname"> <span class="pre"> can_not_edit_sublayer <span class="sig-paren"> ( <span class="sig-paren"> ) <a class="headerlink" href="#omni.kit.widget.layers.ContextMenu.can_not_edit_sublayer" title="Permalink to this definition">  <dd> <p> Check if selected layer item can edit sublayer. <dl class="field-list simple"> <dt class="field-odd"> Parameters <dd class="field-odd"> <p> <strong> objects ( <em> dict ) – A dictionary containing selected item information. <dt class="field-even"> Returns <dd class="field-even"> <p> bool <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.layers.ContextMenu.can_set_as_edit_target"> <span class="sig-name descname"> <span class="pre"> can_set_as_edit_target <span class="sig-paren"> ( <span class="sig-paren"> ) <a class="headerlink" href="#omni.kit.widget.layers.ContextMenu.can_set_as_edit_target" title="Permalink to this definition">  <dd> <p> Check if selected layer can set as edit target. <dl class="field-list simple"> <dt class="field-odd"> Parameters <dd class="field-odd"> <p> <strong> objects ( <em> dict ) – A dictionary containing selected item information. <dt class="field-even"> Returns <dd class="field-even"> <p> bool <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.layers.ContextMenu.clear_all_linked_prims"> <span class="sig-name descname"> <span class="pre"> clear_all_linked_prims <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> objects <span class="sig-paren"> ) <a class="headerlink" href="#omni.kit.widget.layers.ContextMenu.clear_all_linked_prims" title="Permalink to this definition">  <dd> <p> Clear all the linked prims from a specific layer item. <dl class="field-list simple"> <dt class="field-odd"> Parameters <dd class="field-odd"> <p> <strong> objects ( <em> dict ) – A dictionary containing selected item information. <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.layers.ContextMenu.copy_layer_url"> <span class="sig-name descname"> <span class="pre"> copy_layer_url <span class="sig-paren"> ( <span class="sig-paren"> ) <a class="headerlink" href="#omni.kit.widget.layers.ContextMenu.copy_layer_url" title="Permalink to this definition">  <dd> <p> Deprecated. <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.layers.ContextMenu.copy_url"> <span class="sig-name descname"> <span class="pre"> copy_url <span class="sig-paren"> ( <span class="sig-paren"> ) <a class="headerlink" href="#omni.kit.widget.layers.ContextMenu.copy_url" title="Permalink to this definition">  <dd> <p> Copy the selected item’s url to clipboard. <dl class="field-list simple"> <dt class="field-odd"> Parameters <dd class="field-odd"> <p> <strong> objects ( <em> dict ) – A dictionary containing selected item information. ### Returns - bool ### create_anonymous_sublayer() Create anonymous sublayer for selected layer item. #### Parameters - **objects** (dict) – A dictionary containing selected item information. ### create_sublayer(anonymous=False) Create sublayer for selected layer item. #### Parameters - **objects** (dict) – A dictionary containing selected item information. #### Returns - bool ### find_in_browser() Navigate to selected layer’s file if found it in content browser. #### Parameters - **objects** (dict) – A dictionary containing selected item information. #### Returns - bool ### flatten_sublayers() Faltten selected layer item. #### Parameters - **objects** (dict) – A dictionary containing selected item information. ### has_any_items_selected() Check any items selected. #### Parameters - **objects** (dict) – A dictionary containing selected item information. #### Returns - True if any item selected, otherwise False. #### Return type - bool ### has_no_layers_locked() Check if the selected item has not layers locked. #### Parameters - **objects** (dict) – A dictionary containing selected item information. #### Returns - bool ### has_payload_or_reference() checks if prim has references #### Parameters - **objects** (dict) – A dictionary containing selected item information. ### Parameters **objects** (`dict`) – A dictionary containing selected item information. ### Returns bool ### has_selections If the usd context has selections. #### Parameters **objects** (`dict`) – A dictionary containing selected item information. #### Returns True if anything selected in usd context, otherwise False. #### Return type bool ### has_sublayers Check if the selected stage has sublayers. #### Parameters **objects** (`dict`) – A dictionary containing selected item information. #### Returns bool ### insert_sublayer Insert sublayer into selected layer item. #### Parameters **objects** (`dict`) – A dictionary containing selected item information. ### is_anonymous_layer Check if the selected layer item is anonymous layer. #### Parameters **objects** (`dict`) – A dictionary containing selected item information. #### Returns bool ### is_authoring_layer Check if the selected item is authoring layer. #### Parameters **objects** (`dict`) – A dictionary containing selected item information. #### Returns bool ### is_auto_authoring_mode Check if the selected item is in auto authoring mode. #### Parameters **objects** (`dict`) – A dictionary containing selected item information. #### Returns bool ### is_auto_authoring_or_spec_linking_mode Check if the selected item is in auto authoring or spec linking mode. #### Parameters **objects** (`dict`) – A dictionary containing selected item information. #### Returns bool ### is_auto_authoring_or_spec_linking_mode Check if the selected item is in spec linking mode or auto authoring mode. **Parameters** - **objects** (dict) – A dictionary containing selected item information. **Returns** - bool ### is_edit_layer Check if the selected item is edit layer item. **Parameters** - **objects** (dict) – A dictionary containing selected item information. **Returns** - bool ### is_from_session_layer_tree Check if the selected item is from session layer tree. **Parameters** - **objects** (dict) – A dictionary containing selected item information. **Returns** - bool ### is_item_expaned Unused. ### is_layer_and_parent_unmuted Check if the selected layer item is muted and parent muted. **Parameters** - **objects** (dict) – A dictionary containing selected item information. **Returns** - bool ### is_layer_dirty Check if the selected layer item is dirty. **Parameters** - **objects** (dict) – A dictionary containing selected item information. **Returns** - bool ### is_layer_item Check if the selected item is layer item. **Parameters** - **objects** (dict) – A dictionary containing selected item information. **Returns** - True if selected item is layer item, otherwise True. **Return type** - bool ### is_layer_locked Check if the selected layer item is locked. Parameters ========== - **objects** (dict) – A dictionary containing selected item information. Returns ======= - bool is_layer_locked_by_other ======================== Deprecated. is_layer_not_locked =================== Check if the selected layer item is not locked. Parameters ---------- - **objects** (dict) – A dictionary containing selected item information. Returns ------- - bool is_layer_not_locked_by_other ============================ Check if the selected layer item is not locked by other. Parameters ---------- - **objects** (dict) – A dictionary containing selected item information. Returns ------- - bool is_layer_or_parent_muted ======================== Check if the selected layer item is muted or parent muted. Parameters ---------- - **objects** (dict) – A dictionary containing selected item information. Returns ------- - bool is_layer_read_only ================== Check if the selected layer item is not locked. Parameters ---------- - **objects** (dict) – A dictionary containing selected item information. Returns ------- - bool is_layer_writable ================= Check if the selected layer item is writable. Parameters ---------- - **objects** (dict) – A dictionary containing selected item information. Returns ------- - bool is_live_session_layer ====================== Check if selected layer item is live session layer. Parameters ---------- - **objects** (dict) – A dictionary containing selected item information. ### Returns - bool ### is_live_syncing_layer() Check if selected layer item is live syncing layer. #### Parameters - **objects** (dict) – A dictionary containing selected item information. #### Returns - bool ### is_material() Check if the selected item’s type is material. #### Parameters - **objects** (dict) – A dictionary containing selected item information. #### Returns - bool ### is_missing_layer() Check if the selected item is missing layer. #### Parameters - **objects** (dict) – A dictionary containing selected item information. #### Returns - bool ### is_not_anonymous_layer() Check if the selected layer item is not anonymous layer. #### Parameters - **objects** (dict) – A dictionary containing selected item information. #### Returns - bool ### is_not_authoring_layer() Check if the selected item is not authoring layer. #### Parameters - **objects** (dict) – A dictionary containing selected item information. #### Returns - bool ### is_not_auto_authoring_and_spec_linking_mode() Check if the selected item is not in spec linking mode and auto authoring mode. #### Parameters - **objects** (dict) – A dictionary containing selected item information. #### Returns - bool ### is_not_edit_layer() Check if the selected item is not edit layer item. #### Parameters - **objects** (dict) – A dictionary containing selected item information. #### Returns - bool ### is_not_from_session_layer_tree Check if the selected item is not from session layer tree. **Parameters** - **objects** (dict) – A dictionary containing selected item information. **Returns** - bool ### is_not_live_layer Check if selected layer item is not live syncing layer. **Parameters** - **objects** (dict) – A dictionary containing selected item information. **Returns** - bool ### is_not_live_session_layer Check if selected layer item is not live session layer. **Parameters** - **objects** (dict) – A dictionary containing selected item information. **Returns** - bool ### is_not_missing_layer Check if the selected item is not missing layer. **Parameters** - **objects** (dict) – A dictionary containing selected item information. **Returns** - bool ### is_not_omni_layer Check if the selected item is not omniverse layer. **Parameters** - **objects** (dict) – A dictionary containing selected item information. **Returns** - bool ### is_not_reserved_layer Check if the selected item is not reserved layer. **Parameters** - **objects** (dict) – A dictionary containing selected item information. **Returns** - bool ### is_omni_layer Check if the selected item is omniverse layer. **Parameters** - **objects** (dict) – A dictionary containing selected item information. **Returns** - bool ### Parameters **objects** (`dict`) – A dictionary containing selected item information. ### Returns bool ### is_over_specifier Check if the selected prim item’s specifier is ‘OVER_ONLY’. #### Parameters **objects** (`dict`) – A dictionary containing selected item information. #### Returns bool ### is_prim_spec_item Check if the selected item is prim spec item. #### Parameters **objects** (`dict`) – A dictionary containing selected item information. #### Returns True if selected item is prim spec item, otherwise True. #### Return type bool ### is_reserved_layer Check if the selected item is reserved layer. #### Parameters **objects** (`dict`) – A dictionary containing selected item information. #### Returns bool ### is_spec_linking_mode Check if the selected item is in spec linking mode. #### Parameters **objects** (`dict`) – A dictionary containing selected item information. #### Returns bool ### link_selected_prims Link the selected prims to a specific layer item. #### Parameters **objects** (`dict`) – A dictionary containing selected item information. ### link_selected_prims_with_hierarchy Link the selected prims to a specific layer item with hierarchy. #### Parameters **objects** (`dict`) – A dictionary containing selected item information. ### merge_down_one ### merge_down_one() Merge selected layer items down to one. #### Parameters - **objects** (dict) – A dictionary containing selected item information. ### move_prims(objects) Move selected prim spec item. #### Parameters - **objects** (dict) – A dictionary containing selected item information. ### no_items_selected() Check any items selected. #### Parameters - **objects** (dict) – A dictionary containing selected item information. #### Returns - False if any item selected, otherwise True. #### Return type - bool ### on_mouse_event(event) Handles mouse events and show context menu based on the event type. #### Parameters - **event** – An event object containing details about the mouse event. #### Returns - None if the module is not found or if the event type is not ACTIVATE. ### prim_delete() Delete selected prim spec item. #### Parameters - **objects** (dict) – A dictionary containing selected item information. ### refresh_reference_payload_name() Checks if prims have references/payload and returns name. #### Parameters - **objects** (dict) – A dictionary containing selected item information. #### Returns - bool ### reload_layer() Reload selected layer item. #### Parameters - **objects** (dict) – A dictionary containing selected item information. ### remove_layer() ### remove_layer Remove selected layer item. #### Parameters - **objects** (dict) – A dictionary containing selected item information. ### save_layer Save selected layer. #### Parameters - **objects** (dict) – A dictionary containing selected item information. ### save_layer_as Save selected layer, it will open a file picker dialog to select save path. #### Parameters - **objects** (dict) – A dictionary containing selected item information. ### save_layer_as_and_replace Save selected layer, it will open a file picker dialog to select save path, and overwrite the exist layer file. #### Parameters - **objects** (dict) – A dictionary containing selected item information. ### select_linked_prims Select the linked prims from a specific layer item. #### Parameters - **objects** (dict) – A dictionary containing selected item information. ### set_authoring_layer Set the selected layer as authoring layer. #### Parameters - **objects** (dict) – A dictionary containing selected item information. #### Returns - bool ### set_edit_layer Set the selected layer as default edit layer. #### Parameters - **objects** (dict) – A dictionary containing selected item information. #### Returns - bool ### show_open_close_tree Toggle tree from a specific layer/prim item. #### Parameters - **objects** (dict) – A dictionary containing selected item information. ## unlink_selected_prims ``` ( <em> dict ) – A dictionary containing selected item information. ```markdown Unlink the selected prims to a specific layer item. ### Parameters - **objects** ( <em> dict ) – A dictionary containing selected item information. ``` ## unlink_selected_prims_with_hierarchy ``` ( <em> dict ) – A dictionary containing selected item information. ``` Unlink the selected prims to a specific layer item with hierarchy. ### Parameters - **objects** ( <em> dict ) – A dictionary containing selected item information. ```
25,493
omni.kit.widget.layers.Functions.md
# omni.kit.widget.layers Functions ## Functions Summary: | Function | Description | |----------|-------------| | [get_instance](omni.kit.widget.layers/omni.kit.widget.layers.get_instance.html) | Returns the instance of the LayerExtension. |
242
omni.kit.widget.layers.LayerExtension.md
# LayerExtension ## Methods - **add_layer_selection_changed_fn(fn)** - Add a layer selection changed function to the selection listeners. - **get_current_focused_layer_item()** - Get the current focused layer item in the Layer Window. - **get_instance()** - Returns the instance of the extension. - **get_layer_model()** - Get the layer model from the window. - **get_selected_items()** - Get the selected items from the layer view in the window. | Method | Description | |--------|-------------| | on_shutdown | Called on extension shutdown. | | on_startup (ext_id) | Called on extension startup. | | remove_layer_selection_changed_fn (fn) | Remove a selection listener. | | set_current_focused_layer_item (layer_identifier) | Set the focused layer item in the Layer Window. | | show_window (value) | Show or hide the Layer Window. | ### Attributes | Attribute | Description | |-----------|-------------| | CONTEXT_MENU_ITEM_INSERT_SUBLAYER | context menu item to insert sublayer | | MENU_GROUP | Menu shows in 'Window' group | | WINDOW_NAME | Layer extension window's name | ### Methods #### __init__(self: omni.ext._extensions.IExt) -> None Initialize the LayerExtension. #### add_layer_selection_changed_fn(fn: Callable[[LayerItem], None]) Add a layer selection changed function to the selection listeners. Parameters: - **fn** (Callable[[LayerItem], None]): The function to add as a listener for layer selection changes. ### LayerExtension Methods #### add_layer_selection_changed_fn - **Description**: Adds a function to be called when the selection of layers changes. - **Parameters**: - `fn` - The function to add. - **Returns**: The result of the window’s `add_layer_selection_changed_fn` method. - **Return type**: Any #### get_current_focused_layer_item - **Description**: Get the current focused layer item in the Layer Window. - **Returns**: The current focused layer item, or None if the window is not available. - **Return type**: LayerItem or None #### get_instance - **Description**: Returns the instance of the extension. - **Returns**: The instance of the extension. #### get_layer_model - **Description**: Get the layer model from the window. - **Returns**: The layer model from the window, or None if the window is not available. - **Return type**: LayerModel or None #### get_selected_items - **Description**: Get the selected items from the layer view in the window. - **Returns**: The selected items, or an empty list if the window is not available. - **Return type**: List[ui.AbstractItem] #### on_shutdown - **Description**: Called on extension shutdown. #### on_startup - **Description**: Called on extension startup. - **Parameters**: - `ext_id` ### remove_layer_selection_changed_fn ```python remove_layer_selection_changed_fn(fn: Callable[[LayerItem], None]) ``` - **Description**: Remove a selection listener. - **Parameters**: - **fn** (Callable[[LayerItem], None]) – The selection listener function to remove. ### set_current_focused_layer_item ```python set_current_focused_layer_item(layer_identifier: str) ``` - **Description**: Set the focused layer item in the Layer Window. - **Parameters**: - **layer_identifier** (str) – The identifier of the layer item to set as focused. ### show_window ```python show_window(value: bool) ``` - **Description**: Show or hide the Layer Window. - **Parameters**: - **value** (bool) – True to show the window, False to hide it. ### CONTEXT_MENU_ITEM_INSERT_SUBLAYER ```python CONTEXT_MENU_ITEM_INSERT_SUBLAYER = 'Insert As Sublayer' ``` - **Description**: context menu item to insert sublayer ### MENU_GROUP ```python MENU_GROUP = 'Window' ``` - **Description**: Menu shows in ‘Window’ group ### WINDOW_NAME ```python WINDOW_NAME = 'Layer' ``` - **Description**: Layer extension window’s name 这是一个段落,点击这里访问网站。 - 列表项1 - 列表项2 # 这是一个标题 ``` 这是一段代码 ``` 描述图片的文本 ---
3,880
omni.kit.widget.layers.LayerItem.md
# LayerItem ## LayerItem ```python class omni.kit.widget.layers.LayerItem(usd_context, identifier: str, layer: Layer, model, parent_item) ``` Bases: `AbstractItem` A single AbstractItemModel item that represents a single sublayer ### Methods | Method | Description | |--------|-------------| | `__init__(usd_context, identifier, layer, ...)` | Initializes a new instance of the LayerItem class. | | `destroy()` | Clean up used model and subscription. | | `find_all_specs(paths)` | Find the child node with given name and return the list of all the parent nodes and the found node. | | `get_item_value_model()` | | ``` | Method | Description | | ------ | ----------- | | `get_item_value_model(column_id)` | Returns the value model associated with the specified column ID. | | `on_content_changed(changed_prim_spec_paths)` | Handles updates to content based on changes in prim spec paths. | | `on_layer_edit_mode_changed()` | Notifies all items in the prim specs cache about the change in layer edit mode. | | `on_layer_lock_changed()` | Handles the change of layer lock status. | | `on_layer_outdate_state_changed()` | Updates the layer's auto-reload and outdated status based on the current state. | | `on_live_session_state_changed()` | Handles the change of live session state. | | `on_muteness_changed()` | Handles the change of muteness state. | | `on_muteness_scope_changed()` | Handles the change of muteness scope. | | `prefilter(text)` | Applies prefiltering with the given text. | | `reload()` | Reload the layer of this layer item. | | `save([on_save_done])` | Save the layer of this layer item. | | `update_flags()` | Updates the flag attributes of the layer item. | | `update_spec_links_status(spec_paths)` | Updates the status of spec links for the provided spec paths. | | `update_spec_locks_status(spec_paths)` | Updates the status of spec locks for the provided spec paths. | ``` ### Attributes | Attribute | Description | | --------- | ----------- | | `absolute_root_spec` | | - **absolute_root_spec** - The prim spec that represents the root of prim tree. - **add_sublayer** - Adds a sublayer item to the layer item. - **anonymous** - If this layer is anonymous layer. - **auto_reload** - Reload changes automatically. - **base_layer** - If this layer is a live session layer, this property can be used to access its base layer item. - **can_live_update** - Indicates whether the layer supports live updates. - **current_live_session** - If this layer is in a live session or it's a live session layer, it's to return the live session. - **dirty** - If this layer has unsaved changes. - **edit_layer_in_auto_authoring_mode** - Indicates whether the layer is being edited in auto-authoring mode. - **editable** - Indicates whether the layer is writable. - **filtered** - If this layer item is filtered in the search list. - **from_session_layer** - If this layer is under the session layer. - **globally_muted** - Globally mute is the mute value saved in custom data. - **has_child_edit_layer** - Returns whether the layer item has a child with an edit layer. - **has_child_edit_target** - Returns whether the layer item has a child with an edit target. - **has_children** - If this layer item has children. ```python has_content ``` Returns whether the layer item has content. ```python identifier ``` Identifier of this layer item. ```python is_edit_target ``` Returns whether layer item is the edit target. ```python is_in_live_session ``` A layer is in live session means it joins a live session. ```python is_live_session_layer ``` A layer is a live session layer if it's from a live session and it's the root layer of that session with extension .live. ```python is_omni_layer ``` If the item represents an omni layer. ```python is_omni_live_path ``` If the item represents an omni live layer. ```python latest ``` If this layer is latest. ```python layer ``` Getter method for the 'layer' property. ```python live ``` If this live is in live sync. ```python live_session_layer ``` If this layer is in live session, this property can be used to access its corresponding live session layer item. ```python locally_muted ``` Local mute is the muteness when it's in local scope. ```python locked ``` Returns the locked status of the layer item. ```python missing ``` Indicates whether the layer is missing. ```python model ``` Getter method for the 'model' property. ```python muted ``` | Property | Description | | --- | --- | | muted | If this layer is muted. | | muted_or_parent_muted | If this layer is muted or its parent is muted. | | name | Name of this layer item. | | outdated | If this layer item is outdated. | | parent | Parent layer item. | | prim_specs | Prim specs under this layer. | | read_only_on_disk | Indicates whether the layer is read-only on disk. | | reserved | If this is the root or session layer. | | selected | If this layer is selected in layer window. | | sublayers | Sublayer items under this layer. | | usd_context | Getter method for the 'usd_context' property. | | version | The version of this layer. | ### __init__ ```python __init__(usd_context, identifier: str, layer: Layer, model, parent_item) ``` Initializes a new instance of the LayerItem class. **Parameters:** - **usd_context** - **identifier** (str) - **layer** (Layer) - **model** - **parent_item** <em>omni.usd.UsdContext <strong>identifier <strong>layer <strong>model <strong>parent_item <span class="pre">destroy <span class="pre">find_all_specs Parameters: - <strong>paths Returns: - List[PrimSpecItem] <span class="pre">get_item_value_model Parameters: - <strong>column_id Returns: - The value model associated with the column. Return type: - model(omni.ui.AbstractValueModel) <span class="pre">on_content_changed Parameters: - <strong>changed_prim_spec_paths Returns: - Two sets containing updated prim spec items. The first set contains items where flags have been updated, and the second set contains items where children have been updated. Return type: - Tuple[Set[PrimSpecItem]] PrimSpecItem ], Set[ PrimSpecItem ]] <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.layers.LayerItem.on_layer_edit_mode_changed"> <span class="sig-name descname"> <span class="pre"> on_layer_edit_mode_changed <span class="sig-paren"> ( <span class="sig-paren"> ) <dd> <p> Notifies all items in the prim specs cache about the change in layer edit mode. <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.layers.LayerItem.on_layer_lock_changed"> <span class="sig-name descname"> <span class="pre"> on_layer_lock_changed <span class="sig-paren"> ( <span class="sig-paren"> ) <dd> <p> Handles the change of layer lock status. <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.layers.LayerItem.on_layer_outdate_state_changed"> <span class="sig-name descname"> <span class="pre"> on_layer_outdate_state_changed <span class="sig-paren"> ( <span class="sig-paren"> ) <dd> <p> Updates the layer’s auto-reload and outdated status based on the current state. <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.layers.LayerItem.on_live_session_state_changed"> <span class="sig-name descname"> <span class="pre"> on_live_session_state_changed <span class="sig-paren"> ( <span class="sig-paren"> ) <dd> <p> Handles the change of live session state. <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.layers.LayerItem.on_muteness_changed"> <span class="sig-name descname"> <span class="pre"> on_muteness_changed <span class="sig-paren"> ( <span class="sig-paren"> ) <dd> <p> Handles the change of muteness state. <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.layers.LayerItem.on_muteness_scope_changed"> <span class="sig-name descname"> <span class="pre"> on_muteness_scope_changed <span class="sig-paren"> ( <span class="sig-paren"> ) <dd> <p> Handles the change of muteness scope. <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.layers.LayerItem.prefilter"> <span class="sig-name descname"> <span class="pre"> prefilter <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> text <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> str <span class="sig-paren"> ) <dd> <p> Applies prefiltering with the given text. <dl class="field-list simple"> <dt class="field-odd"> Parameters <dd class="field-odd"> <p> <strong> text ( <em> str ) – The text to be prefiltered. <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.layers.LayerItem.reload"> <span class="sig-name descname"> <span class="pre"> reload <span class="sig-paren"> ( <span class="sig-paren"> ) <dd> <p> Reload the layer of this layer item. <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.layers.LayerItem.save"> <span class="sig-name descname"> <span class="pre"> save <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> on_save_done <span class="o"> <span class="pre"> = <span class="default_value"> <span class="pre"> None <span class="sig-paren"> ) <dd> <p> Save the layer of this layer item. <dl class="field-list simple"> <dt class="field-odd"> Parameters <dd class="field-odd"> <p> <strong> on_save_done ( <em> Callable <em> , <em> optional ) – Callback function to be called when save is done. Signature is fn(bool, str, List[str])-&gt;None. Defaults to None. <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.layers.LayerItem.update_flags"> <span class="sig-name descname"> <span class="pre"> update_flags <span class="sig-paren"> ( <span class="sig-paren"> ) <dd> <p> Update flags. <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.layers.LayerItem.update_spec_links_status"> <span class="sig-name descname"> <span class="pre"> update_spec_links_status <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> spec_paths <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"> Union <span class="p"> <span class="pre"> [ <span class="pre"> str <span class="p"> <span class="pre"> , <span class="w"> <span class="pre"> Path <span class="p"> <span class="pre"> ] <span class="p"> <span class="pre"> ] <span class="sig-paren"> ) <dd> <p> Updates the status of spec links for the provided spec paths. <dl class="field-list simple"> <dt class="field-odd"> Parameters <dd class="field-odd"> <p> <strong> spec_paths ( <em> List <em> [ <em> Union <em> [ <em> str <em> , <em> Sdf.Path <em> ] <em> ] ) – The list of spec paths to update. <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.layers.LayerItem.update_spec_locks_status"> <span class="sig-name descname"> <span class="pre"> update_spec_locks_status <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> spec_paths <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"> Union <span class="p"> <span class="pre"> [ <span class="pre"> str <span class="p"> <span class="pre"> , <span class="w"> <span class="pre"> Path <span class="p"> <span class="pre"> ] <span class="p"> <span class="pre"> ] <span class="sig-paren"> ) <dd> <p> Updates the status of spec locks for the provided spec paths. <dl class="field-list simple"> <dt class="field-odd"> Parameters <dd class="field-odd"> <p> <strong> spec_paths ( <em> List <em> [ <em> Union <em> [ <em> str <em> , <em> Sdf.Path <em> ] <em> ] ) – The list of spec paths to update. <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.widget.layers.LayerItem.absolute_root_spec"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> absolute_root_spec <dd> <p> The prim spec that represents the root of prim tree. <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.widget.layers.LayerItem.add_sublayer"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> add_sublayer <dd> <p> Adds a sublayer item to the layer item. <dl class="field-list simple"> <dt class="field-odd"> Parameters <dd class="field-odd"> <p> <strong> sublayer_item <strong> ( – obj:’LayerItem’): The sublayer item to be added. <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.widget.layers.LayerItem.anonymous"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> anonymous <dd> <p> If this layer is anonymous layer. <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.widget.layers.LayerItem.auto_reload"> <em class="property"> <span class="pre"> property <span class="w"> <span class="sig-name descname"> <span class="pre"> auto_reload <dd> <p> The prim spec that represents the root of prim tree. - **Reload changes automatically.** - **base_layer** - If this layer is a live session layer, this property can be used to access its base layer item. - Returns: obj:'LayerItem' - **can_live_update** - Indicates whether the layer supports live updates. - **current_live_session** - If this layer is in a live session or it’s a live session layer, it’s to return the live session. - Returns: obj:'LiveSession' - **dirty** - If this layer has unsaved changes. - **edit_layer_in_auto_authoring_mode** - Indicates whether the layer is being edited in auto-authoring mode. - **editable** - Indicates whether the layer is writable. - **filtered** - If this layer item is filtered in the search list. - **from_session_layer** - If this layer is under the session layer. - Returns: bool - **globally_muted** - Globally mute is the mute value saved in custom data. The muteness of USD layer is dependent on the muteness scope (local or global). When it’s in global mode, the muteness of USD layer is the same as this value. - Returns: bool - **has_child_edit_layer** - Returns whether the layer item has a child with an edit layer. - Returns: True if the layer item has a child with an edit layer, False otherwise. - Return type: bool ### has_child_edit_target Returns whether the layer item has a child with an edit target. - **Returns**: True if the layer item has a child with an edit target, False otherwise. - **Return type**: bool ### has_children If this layer item has children. ### has_content Returns whether the layer item has content. - **Returns**: True if the layer item has content, False otherwise. - **Return type**: bool ### identifier Identifier of this layer item. ### is_edit_target Returns whether layer item is the edit target. - **Returns**: bool ### is_in_live_session A layer is in live session means it joins a live session. This is only true when it’s the base layer of the live session. For live session layer, it’s false. - **Returns**: bool ### is_live_session_layer A layer is a live session layer if it’s from a live session and it’s the root layer of that session with extension .live. - **Returns**: bool ### is_omni_layer If the item represents an omni layer. - **Returns**: True if the item represents an omni layer, False otherwise. - **Return type**: bool ### is_omni_live_path If the item represents an omni live layer. - **Returns**: True if the item represents an omni live layer, False otherwise. ### Return type - bool ### Property: latest - If this layer is latest. It only applies to omniverse layer. - Returns: bool ### Property: layer - Getter method for the ‘layer’ property. - Returns: The layer associated with the item. - Return type: Sdf.Layer ### Property: live - If this live is in live sync. It only applies to omniverse layer. - Returns: bool ### Property: live_session_layer - If this layer is in live session, this property can be used to access its corresponding live session layer item. - Returns: obj:'LayerItem' ### Property: locally_muted - Local mute is the muteness when it’s in local scope. - Returns: bool ### Property: locked - Returns the locked status of the layer item. - Returns: True if the layer item is locked, False otherwise. - Return type: bool ### Property: missing - Indicates whether the layer is missing. ### Property: model - Getter method for the ‘model’ property. - Returns: obj:'LayerModel': The model associated with the item. ### Property: muted - If this layer is muted. - Returns: bool - **muted_or_parent_muted**: If this layer is muted or its parent is muted. - Returns: bool - **name**: Name of this layer item. - **outdated**: If this layer item is outdated. - **parent**: Parent layer item. - **prim_specs**: Prim specs under this layer. - **read_only_on_disk**: Indicates whether the layer is read-only on disk. - **reserved**: If this is the root or session layer. - **selected**: If this layer is selected in layer window. - **sublayers**: Sublayer items under this layer. - Returns: List[LayerItem] - **usd_context**: Getter method for the ‘usd_context’ property. - Returns: The USD context associated with the item. - Return type: Usd.Context - **version**: The version of this layer. It only applies to omniverse layer. - Returns: str
23,859
omni.kit.widget.layers.LayerModel.md
# LayerModel ## Class Definition ```python class omni.kit.widget.layers.LayerModel(usd_context, layer_settings=None) ``` Bases: `AbstractItemModel` Class representing the Layer Model. ### Methods - **`__init__(usd_context[, layer_settings])`** - Initialize. - **`add_dirtiness_listener(fn)`** - Add a dirtiness listener. - **`add_layer_muteness_scope_listener(fn)`** - Add a muteness scope listener. - **`add_stage_attach_listener(fn)`** - Add a stage attachment listener. - **`can_item_have_children(item)`** - Check if an item can have children. - `destroy()` - Destroys the LayerModel instance. - `drop(target_item, source[, drop_location])` - Reimplemented from AbstractItemModel. - `drop_accepted(target_item, source[, ...])` - Reimplemented from AbstractItemModel. - `filter_by_text(filter_name_text)` - Specify the filter string that is used to reduce the model. - `find_all_specs(paths)` - Return the list of all the parent nodes and the node representing the given path. - `flatten_all_layers()` - Flatten all layers if there is not layer locked. - `get_all_dirty_layer_identifiers([...])` - Returns a list of all dirty layer identifiers. - `get_drag_mime_data(item)` - Returns Multipurpose Internet Mail Extensions (MIME) data for be able to drop this item somewhere. - `get_item_children(item)` - Get the children of an item, reimplemented from AbstractItemModel. - `get_item_value_model(item, column_id)` - Reimplemented from AbstractItemModel. - `get_item_value_model_count(item)` - Reimplemented from AbstractItemModel, returns the number of value models for the given item. - `get_layer_item_by_identifier(layer_identifier)` - Find the first layer item that has the identifier - `has_any_layers_locked()` - Checks if any layers are locked. - `has_dirty_layers([include_omni_layers, ...])` - Checks if there are any dirty layers in the current stage. ### Methods - `has_outdated_layers()` - Checks if there are any outdated layers in the sublayers cache. - `refresh()` - Force full re-update. - `save_layers(layer_identifiers[, on_save_done])` - Saves multiple layers asynchronously and executes a callback on completion. - `set_edit_target(layer_item[, saved])` - Sets the edit target with the given layer item's identifier. ### Attributes - `auto_authoring_mode` - If the edit mode is 'AUTO_AUTHORING'. - `default_edit_layer` - The default edit layer. - `global_muteness_scope` - If the layers' muteness scope is global. - `is_in_live_session` - If the layer is in live session. - `normal_mode` - If the edit mode is 'NORMAL'. - `root_layer_item` - Root layer item. - `session_layer_item` - The session layer item. - `spec_linking_mode` - If the edit mode is 'SPECS_LINKING'. - `usd_context` - UsdContext corresponding to this model. ### Initialization - `__init__(usd_context, layer_settings=None)` - Initialize. Parameters ------------ - **usd_context** (`omni.usd.UsdContext`) – The USD context for the layers. - **layer_settings** (`LayerSettings`) – The layer settings. add_dirtiness_listener ---------------------- Add a dirtiness listener. Parameters ------------ - **fn** (`Callable[[], None]`) – The function to be added as a dirtiness listener. add_layer_muteness_scope_listener -------------------------------- Add a muteness scope listener. Parameters ------------ - **fn** (`Callable[[], None]`) – The function to be added as a muteness scope listener. add_stage_attach_listener ------------------------- Add a stage attachment listener. Parameters ------------ - **fn** (`Callable[[bool], None]`) – The function to be added as a stage attachment listener. ### can_item_have_children(item) Check if an item can have children. **Parameters** - **item** (omni.ui.AbstractItem) – The item to check. ### destroy() Destroys the LayerModel instance. ### drop(target_item, source, drop_location=-1) Reimplemented from AbstractItemModel. Called when dropping something to the item. **Parameters** - **target_item** (LayerItem): The target item to drop onto. - **source** (LayerItem): The source item being dragged. - **drop_location** (int) – The location to drop the item (default: -1). ### drop_accepted(target_item, source, drop_location=-1) Reimplemented from AbstractItemModel. Called to highlight target when drag and drop. Returns whether the drop is accepted. **Parameters** - **target_item** (LayerItem): The target item to drop onto. - **source** (LayerItem): The source item being dragged. - **drop_location** (int) – The location to drop the item (default: -1). **Returns** - True if the drop is accepted, False otherwise. **Return type** - bool ### filter_by_text(filter_name_text) Specify the filter string that is used to reduce the model. **Parameters** - **filter_name_text** (str) – String used to filter layer’s name text. ### find_all_specs Return the list of all the parent nodes and the node representing the given path. **Parameters** - **paths** (List[Sdf.Path]) – Paths to find specs. **Returns** - Tuble(LayerItem, List[PrimSpecItem]) ### flatten_all_layers Flatten all layers if there is not layer locked. ### get_all_dirty_layer_identifiers Returns a list of all dirty layer identifiers. **Parameters** - **include_omni_layers** (bool) – Whether to include Omni layers (default: True). - **include_local_layers** (bool) – Whether to include local layers (default: True). **Returns** - List[str] ### get_drag_mime_data Returns Multipurpose Internet Mail Extensions (MIME) data for be able to drop this item somewhere. **Parameters** - **item** (omni.ui.AbstractItem) – The target item to drop. **Returns** - str ### get_item_children Get the children of an item, reimplemented from AbstractItemModel. **Parameters** - **item** (omni.ui.AbstractItem) – The item whose children are to be retrieved. **Returns** - A list containing the children of the item. **Return type** - List ### get_item_value_model ### get_item_value_model Reimplemented from AbstractItemModel. Returns the value model for the given item and column ID. #### Parameters - **item** (– obj:'LayerItem'): The item to get the value model for. - **column_id** (int) – The column ID to get the value model for. #### Returns omni.ui.AbstractValueModel ### get_item_value_model_count Reimplemented from AbstractItemModel, returns the number of value models for the given item. #### Parameters - **item** – The item to get the value model count for. #### Returns The number of value models (7). #### Return type int ### get_layer_item_by_identifier Find the first layer item that has the identifier #### Parameters - **layer_identifier** (str) – The identifier of the layer item to find. #### Returns obj:'LayerItem': The first layer item with the given identifier, or None if not found. ### has_any_layers_locked Checks if any layers are locked. #### Returns True if any layers are locked, False otherwise. #### Return type bool ### has_dirty_layers Checks if there are any dirty layers in the current stage. #### Parameters - **include_omni_layers** (bool, optional) – Whether to include omni layers. Defaults to True. - **include_local_layers** (bool, optional) – Whether to include local layers. Defaults to True. #### Returns True if there are any dirty layers, False otherwise. #### Return type bool ### has_outdated_layers() Checks if there are any outdated layers in the sublayers cache. **Returns:** - True if there are any outdated layers, False otherwise. - **Return type:** bool ### refresh() Force full re-update. ### save_layers(layer_identifiers, on_save_done=None) Saves multiple layers asynchronously and executes a callback on completion. **Parameters:** - **layer_identifiers** (List[str]) – A list of identifiers for the layers to be saved. - **on_save_done** (Callable[[bool, str, List[str]], None], optional) – A callback function to be called upon completion of the save operation. The function signature is: on_save_done(bool, str, List[str]). ### set_edit_target(layer_item: LayerItem, saved=False) ### set_edit_target Sets the edit target with the given layer item’s identifier. #### Parameters - **(layer_item) – obj:'LayerItem'**: The LayerItem to set as the edit target. - **saved (bool)**: Whether the edit target has been saved (default: False). ### auto_authoring_mode If the edit mode is ‘AUTO_AUTHORING’. #### Returns - True if the edit mode is ‘AUTO_AUTHORING’, False otherwise. - Return type: bool ### default_edit_layer The default edit layer. (Only useful when edit mode is AUTO_AUTHORING or SPECS_LINKING). #### Returns - The default edit layer. - Return type: str ### global_muteness_scope If the layers’ muteness scope is global. #### Returns - True if the layers’ muteness scope is global, False otherwise. - Return type: bool ### is_in_live_session If the layer is in live session. #### Returns - True if the stage is in live session, False otherwise. - Return type: bool ### normal_mode If the edit mode is ‘NORMAL’. #### Returns - True if the edit mode is ‘NORMAL’, False otherwise. - Return type: bool ### root_layer_item Root layer item. #### Returns - obj:'LayerItem'. ### session_layer_item The session layer item #### Returns - obj:'LayerItem'. - **spec_linking_mode** *(property)* - If the edit mode is ‘SPECS_LINKING’. - **Returns**: True if the edit mode is ‘SPECS_LINKING’, False otherwise. - **Return type**: bool - **usd_context** *(property)* - UsdContext corresponding to this model. - **Returns**: obj:'omni.usd.UsdContext'.
9,562
omni.kit.widget.layers.LayerUtils.md
# LayerUtils LayerUtils provides utilities for operating layers. ## Methods - `create_checkpoint(layer_identifier, comment)` - `create_checkpoint_async(layer_identifier, ...)` - `create_checkpoint_for_stage_async(stage, comment)` - `create_sublayer(layer, sublayer_position, ...)` - Creates new sublayer at specific position. - `get_all_sublayers(stage[, ...])` - `get_custom_layer_name(layer)` - Gets the custom name of layer. - `get_dirty_layers(stage[, ...])` - `get_edit_target(stage)` - `get_layer_global_muteness(root_layer, ...)` - `get_layer_lock_status(root_layer, ...)` - `get_sublayer_identifier(layer_identifier, ...)` - `get_sublayer_position_in_parent(...)` - `has_prim_spec(layer_identifier, prim_spec_path)` - `insert_sublayer(layer, sublayer_position, ...)` - `is_layer_writable(layer_identifier)` - `move_layer(from_parent_layer_identifier, ...)` - `reload_all_layers(layer_identifiers)` - `remove_layer_global_muteness(root_layer, ...)` - `remove_layer_lock_status(root_layer, ...)` - `remove_prim_spec(layer, prim_spec_path)` - `remove_sublayer(layer, position)` - `replace_sublayer(layer, sublayer_position, ...)` - `resolve_paths(base_layer, target_layer[, ...])` - `restore_authoring_layer_from_custom_data(stage)` - `restore_muteness_from_custom_data(stage)` <p> <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> save_authoring_layer_to_custom_data (stage) <p> <a class="reference internal" href="#omni.kit.widget.layers.LayerUtils.set_custom_layer_name" title="omni.kit.widget.layers.LayerUtils.set_custom_layer_name"> <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> set_custom_layer_name (layer, name) <p> Sets the custom name of layer, or clear it if name is empty or None. <p> <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> set_edit_target (stage, layer_identifier) <p> <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> set_layer_global_muteness (root_layer, ...) <p> <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> set_layer_lock_status (root_layer, ...) <p> <a class="reference internal" href="#omni.kit.widget.layers.LayerUtils.transfer_layer_content" title="omni.kit.widget.layers.LayerUtils.transfer_layer_content"> <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> transfer_layer_content (source_layer, ...[, ...]) <p> Transfer layer content from source layer to target layer with re-pathing all external dependencies. <p class="rubric"> Attributes <p> <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> LAYER_AUTHORING_LAYER_CUSTOM_KEY <p> <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> LAYER_LOCK_STATUS_CUSTOM_KEY <p> <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> LAYER_MUTENESS_CUSTOM_KEY <p> <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> LAYER_NAME_CUSTOM_KEY <p> <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> LAYER_OMNI_CUSTOM_KEY <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.layers.LayerUtils.__init__"> <span class="sig-name descname"> <span class="pre"> __init__ <span class="sig-paren"> ( <span class="sig-paren"> ) <a class="headerlink" href="#omni.kit.widget.layers.LayerUtils.__init__" title="Permalink to this definition">  <dd> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.layers.LayerUtils.create_sublayer"> <em class="property"> <span class="pre"> static <span class="w"> <span class="sig-name descname"> <span class="pre"> create_sublayer <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> layer <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> Layer , <em class="sig-param"> <span class="n"> <span class="pre"> sublayer_position <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"> layer_identifier <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> str <span class="sig-paren"> ) <a class="headerlink" href="#omni.kit.widget.layers.LayerUtils.create_sublayer" title="Permalink to this definition">  <dd> <p> Creates new sublayer at specific position. <dl class="field-list simple"> <dt class="field-odd"> Parameters <dd class="field-odd"> <ul class="simple"> <li> <p> <strong> layer (<em>Sdf.Layer <li> <p> <strong> sublayer_position – Position to create the new layer. Position should be -1 (the last position) or above 0. If position == -1 or position &gt; len(layer.subLayerPaths), it will create the sublayer at the end. Any other position will be treated as invalid index. <li> <p> <strong> layer_identifier – New layer path. If it’s empty or None, it will create anonymous layer. ### Returns - New sublayer handle or None if sublayer_position is not valid. ### get_custom_layer_name - **Description**: Gets the custom name of layer. This name is saved inside the custom data of layer. ### get_sublayer_identifier - **Description**: Gets the sublayer identifier at specific postion with validality. - **Parameters**: - **layer_identifier** (str) – Parent layer identifier. - **sublayer_position** (int) – Position of sublayer. It must be -1, which means to - **0** (return the last item. Or it should be equal or above) – - **Returns**: None if sublayer_position is invalid or overflow. Or sublayer identifier otherwise. ### get_sublayer_position_in_parent - **Description**: Gets the sublayer position in the parent layer. - **Parameters**: - **parent_layer_identifier** (str) – Parent layer identifier. - **layer_identifier** (str) – layer identifier to query. - **Returns**: Position of layer in the subLayerPaths of the parent, or -1 if it cannot be found. ### insert_sublayer - **Description**: Inserts a sublayer. - **Parameters**: - **layer** (Layer) – The layer to insert. - **sublayer_position** – The position to insert the sublayer. - **Returns**: New sublayer handle or None if sublayer_position is not valid. ### LayerUtils.insert_sublayer Inserts new sublayer at specific position. #### Parameters - **layer** (`Sdf.Layer`) – Layer handle. - **sublayer_position** – Position to insert the new layer. Position should be -1 (the last position) or above 0. If position == -1 or position > len(layer.subLayerPaths), it will insert the sublayer at the end. Any other position will be treated as invalid index. - **layer_identifier** – New layer path. #### Returns Sublayer handle or None if sublayer_position is not valid or layer_identifier is empty or inserted layer is not existed. ### LayerUtils.is_layer_writable Checks if layer is a writable format or writable on the file system. ### LayerUtils.move_layer Move sublayer from source parent to position of target parent. #### Parameters - **from_parent_layer_identifier** – The parent of source sublayer. - **from_sublayer_position** – The sublayer position to be moved. - **to_parent_layer_identifier** – The parent of target sublayer. - **to_sublayer_position** – The sublayer position in target parent that source moves to. - **remove_source** – Removes the source sublayer or not from source parent after move. If from_parent_layer_identifier == to_parent_layer_layer_identifier, it will always be True. #### Returns True if it’s successful, False otherwise. ### LayerUtils.reload_all_layers ### reload_all_layers Reloads all layers in batch. ### remove_prim_spec Utility to remove prim spec from layer. #### Parameters - **layer** (`Sdf.Layer`) – Layer handle. - **prim_spec_path** (`Union[str, Sdf.Path]`) – Path of prim spec. #### Returns - True if success, or False otherwise. ### replace_sublayer Replaces new sublayer at specific position. #### Parameters - **layer** (`Sdf.Layer`) – Layer handle. - **sublayer_position** – Position to insert the new layer. Position should be less than len(layer.subLayerPaths). Any other position will be treated as invalid index. - **layer_identifier** – New layer path. #### Returns - Sublayer handle or None if sublayer_position is not valid or layer_identifier is empty or replaced layer is not existed. ### resolve_paths Resolve all paths from References, Sublayers and AssetPaths of target layer based on source layer. This function is used normally when you transfer the content from source layer to target layer that are not in the same directory. So it needs to resolve all references so that they point to correct location. #### Parameters - **base_layer** (`Sdf.Layer`) – Source layer that references in target layer based on. - **target_layer** (`Sdf.Layer`) – Target layer to resolve. - **store_relative_path** (`bool`) – True to store relative path, or False to store absolute path. if relative path cannot be computed (like source layer and target are not in the same domain), it will save absolute paths. - **relative_to_base_layer** (`bool`) – True if the relative path is computed against the target_layer. False otherwise. - **copy_sublayer_offsets** (`bool`) – True to copy sublayer offsets and scales from base to target. ### set_custom_layer_name Sets the custom name of layer, or clear it if name is empty or None. The name is saved inside the custom data of layer and can only be consumed by Kit application. #### Parameters - **layer** (`Layer`) - **name** (`str`) ### transfer_layer_content Transfer layer content from source layer to target layer with re-pathing all external Dependencies. ### Parameters - **source_layer** (`Sdf.Layer`) – Source layer handle. - **target_layer** (`Sdf.Layer`) – Target layer handle. - **copy_custom_data** (`bool`) – Whether copying layer metadata or not. - **skip_sublayers** (`bool`) – Whether skipping to copy sublayers or not if `copy_custom_data` is True.
10,080
omni.kit.widget.layers.md
# omni.kit.widget.layers ## Classes Summary - **ContextMenu** - Context menu for the layers widget - **LayerExtension** - The entry point for Layer 2 - **LayerItem** - A single AbstractItemModel item that represents a single sublayer - **LayerModel** - Class representing the Layer Model. - **LayerUtils** - LayerUtils provides utilities for operating layers. - **PrimSpecItem** - A single AbstractItemModel item that represents a single prim ## Functions Summary - **get_instance** - Returns the instance of the LayerExtension.
546
omni.kit.widget.layers.PrimSpecItem.md
# PrimSpecItem ## PrimSpecItem ```python class omni.kit.widget.layers.PrimSpecItem(usd_context, path: Path, layer_item) ``` Bases: `AbstractItem` A single AbstractItemModel item that represents a single prim ### Methods | Method | Description | |--------|-------------| | `__init__(usd_context, path, layer_item)` | Initializes a PrimSpecItem object. | | `destroy()` | Destroys the item object. | | `get_item_value_model(column_id)` | Retrieves the value of an item in the model based on the given column ID. | | `on_layer_edit_mode_changed()` | Callback function for handling layer edit mode changes. | | `on_layer_muteness_changed()` | Callback function for handling layer muteness changes. | ### Functions - **on_layer_muteness_changed** - Callback function for handling layer muteness changes. - **update_flags** - Updates the flags for this item object. ### Attributes - **children** - List of children. - **filtered** - If this prim spec is filtered in the search list. - **has_children** - If the object has children. - **has_missing_reference** - If this prim spec includes missing references. - **instanceable** - If this prim spec is instanceable. - **layer** - Handle of Sdf.Layer this prim spec resides in. - **layer_item** - Gets the relate layer item. - **linked** - If the object is linked. - **locked** - If the object is locked. - **name** - Name of this prim spec in stage. - **parent** - Parent spec. - **path** - Path of this prim spec in stage. - **prim_spec** - Handle of Sdf.PrimSpec. - **specifier** - The specifier of this prim spec. ## Prim Specifier ### Specifier of prim spec. ### Type Name of Prim Spec - **type_name** - Type name of this prim spec in stage. ### PrimSpecItem Initialization - **__init__(usd_context: omni.usd.UsdContext, path: Sdf.Path, layer_item: LayerItem)** - Initializes a PrimSpecItem object. - **Parameters:** - **usd_context** (omni.usd.UsdContext) – The USD context. - **path** (Sdf.Path) – The path to the prim. - **layer_item** (LayerItem) – The layer item. ### PrimSpecItem Methods - **destroy()** - Destroys the item object. - **get_item_value_model(column_id: int)** - Retrieves the value of an item in the model based on the given column ID. - **Parameters:** - **column_id** (int) – The ID of the column for which to retrieve the item value. - **Returns:** - The value of the item in the model. - **Return type:** - omni.ui.AbstractValueModel - **on_layer_edit_mode_changed()** - Callback function for handling layer edit mode changes. - **on_layer_muteness_changed()** - Callback function for handling layer muteness changes. - **update_flags()** - Updates the flags for this item object. ### PrimSpecItem Properties - **children** - List of children. - **filtered** - (Text missing, please provide the content) ### omni.kit.widget.layers.PrimSpecItem.filtered - **Description:** If this prim spec is filtered in the search list. - **Returns:** bool ### omni.kit.widget.layers.PrimSpecItem.has_children - **Description:** If the object has children. - **Returns:** bool ### omni.kit.widget.layers.PrimSpecItem.has_missing_reference - **Description:** If this prim spec includes missing references. ### omni.kit.widget.layers.PrimSpecItem.instanceable - **Description:** If this prim spec is instanceable. - **Returns:** bool ### omni.kit.widget.layers.PrimSpecItem.layer - **Description:** Handle of Sdf.Layer this prim spec resides in. ### omni.kit.widget.layers.PrimSpecItem.layer_item - **Description:** Gets the relate layer item. - **Returns:** obj:'LayerItem' ### omni.kit.widget.layers.PrimSpecItem.linked - **Description:** If the object is linked. - **Returns:** True if the object is linked, False otherwise. - **Return type:** bool ### omni.kit.widget.layers.PrimSpecItem.locked - **Description:** If the object is locked. - **Returns:** True if the object is locked, False otherwise. - **Return type:** bool ### omni.kit.widget.layers.PrimSpecItem.name - **Description:** Name of this prim spec in stage. ### omni.kit.widget.layers.PrimSpecItem.parent - **Description:** Parent spec. ### omni.kit.widget.layers.PrimSpecItem.path - **Description:** Path of this prim spec in stage. Path of this prim spec in stage. Handle of Sdf.PrimSpec. Specifier of prim spec. Type name of this prim spec in stage.
4,405
omni.kit.widget.live_session_management.build_live_session_user_layout.md
# build_live_session_user_layout ## build_live_session_user_layout ``` ```python omni.kit.widget.live_session_management.build_live_session_user_layout( user_info: LiveSessionUser, size: int = 16, tooltip: str = '', on_double_click_fn: Optional[Callable[[float, float, int, int, LiveSessionUser], None]] = None, on_mouse_click_fn: Optional[Callable[[float, float, int, int, LiveSessionUser], None]] = None ) ``` Utility function to build an user icon widget with user information. ### Parameters - **user_info** (`omni.kit.user.layers.LiveSessionUser`) – User information. - **size** (`int`) – Icon size. Default is 16. - **tooltip** (`str`) – Tooltip of the widget. - **on_double_click_fn** (`Callable[[float, float, int, int, layers.LiveSessionUser], None]`) – It’s called when the widget is double clicked. The first params of the callback are the mouse position x and y. The third param is the mouse button, and 0 for LMB, and 1 for RMB. The fourth param is the keyboard modifier, see carb.input.KEYBOARD_MODIFIER_FLAG_* for details. - **on_mouse_click_fn** (`Callable[[float, float, int, int, layers.LiveSessionUser], None]`) – It’s called when the widget is single clicked.
1,202
omni.kit.widget.live_session_management.Classes.md
# omni.kit.widget.live_session_management Classes ## Classes Summary - **LiveSessionCameraFollowerList** - Widget to build an user list to show all followers to the specific camera. - **LiveSessionModel** - omni.ui Model for omni.ui.Combobox, which can be used to build customized combobox - **LiveSessionUserList** - Widget to build an user list to show all live session users of interested layer. - **LiveSessionWidgetExtension** - (No description provided)
472
omni.kit.widget.live_session_management.Functions.md
# omni.kit.widget.live_session_management Functions ## Functions Summary - **build_live_session_user_layout** - Utility function to build an user icon widget with user information. - **is_viewer_only_mode** - When it returns True, it will follow rules: - **stop_or_show_live_session_widget** - Stops current live session or shows widget to join/leave session. If current session is empty, it will show
411
omni.kit.widget.live_session_management.is_viewer_only_mode.md
# is_viewer_only_mode ## is_viewer_only_mode When it returns True, it will follow rules: > - When joining a live session, if the user has unsaved changes, skip the dialog and automatically reload the stage, then join the session. > - When creating a live session, if the user has unsaved changes, skip the dialog and automatically reload the stage, then create the session. > - When leaving a live session, do not offer to merge changes, instead reload the stage to its original state. This mode can be controlled by setting omni.kit.widget.live_session_management.VIEWER_ONLY_MODE_SETTING.
594
omni.kit.widget.live_session_management.LiveSessionCameraFollowerList.md
# LiveSessionCameraFollowerList ## LiveSessionCameraFollowerList ``` ```markdown class omni.kit.widget.live_session_management.LiveSessionCameraFollowerList(usd_context: UsdContext, camera_path: Path, **kwargs) ``` ```markdown Bases: object Widget to build an user list to show all followers to the specific camera. ``` ```markdown ### Methods - `__init__(usd_context, camera_path, **kwargs)` - Constructor. - `destroy()` - `empty()` - Checks if it has any user icons added. - `track_camera()` - Tracks the camera and updates the follower list. ``` | Attribute | Description | |-----------|-------------| | `layout` | Root widget of the list. | ## Attributes | Attribute | Description | |-----------|-------------| | `layout` | Root widget of the list. | ## Methods ### `__init__(usd_context: UsdContext, camera_path: Path, **kwargs)` Constructor. **Parameters:** - **usd_context** (`omni.usd.UsdContext`) – USD Context instance. - **camera_path** (`str`) – Interested camera. **Keyword Arguments:** - **icon_size** (`int`) – The width and height of the user icon. 16 pixel by default. - **spacing** (`int`) – The horizonal spacing between two icons. 2 pixel by default. - **maximum_users** (`int`) – The maximum users to show, and show others with overflow. - **show_my_following_users** (`bool`) – Whether it should show the users that are following me or not. ### `empty()` Checks if it has any user icons added. ### `track_camera(camera_path: Path)` Switches the camera path to listen to. ## Property ### `layout: HStack` Root widget of the list.
1,577
omni.kit.widget.live_session_management.LiveSessionModel.md
# LiveSessionModel ## Class: omni.kit.widget.live_session_management.LiveSessionModel Bases: `LiveSessionComboBoxModel` omni.ui Model for omni.ui.Combobox, which can be used to build customized combobox for listing/watching/selecting Live Sessions for a specific layer. ### Methods - `__init__(layers_interface, layer_identifier)` - Constructor. - `create_new_session_name()` - Empty by default - `destroy()` - (No description provided) ### Attributes (No attributes listed) ### Constructor **Parameters** - **layers_interface** (omni.kit.usd.layers.Layers) – Layers instance. - **layer_identifier** (str) – Layer identifier to query. - **update_users** (bool) – When it’s True, it will listen for user list updates for the Live Session that’s currently selected by this model. ### create_new_session_name Empty by default
840
omni.kit.widget.live_session_management.LiveSessionModel_omni.kit.widget.live_session_management.LiveSessionModel.md
# LiveSessionModel ## LiveSessionModel ```python class omni.kit.widget.live_session_management.LiveSessionModel(layers_interface, layer_identifier, update_users=True) ``` Bases: `LiveSessionComboBoxModel` omni.ui Model for omni.ui.Combobox, which can be used to build customized combobox for listing/watching/selecting Live Sessions for a specific layer. ### Methods | Method | Description | |--------|-------------| | `__init__(layers_interface, layer_identifier)` | Constructor. | | `create_new_session_name()` | Empty by default | | `destroy()` | | ### Attributes | Attribute | Description | |-----------|-------------| ### Constructor Constructor. #### Parameters - **layers_interface** (`omni.kit.usd.layers.Layers`) – Layers instance. - **layer_identifier** (`str`) – Layer identifier to query. - **update_users** (`bool`) – When it’s True, it will listen for user list updates for the Live Session that’s currently selected by this model. ### create_new_session_name Empty by default
1,003
omni.kit.widget.live_session_management.LiveSessionUserList.md
# LiveSessionUserList ## Class Definition ```python class omni.kit.widget.live_session_management.LiveSessionUserList(usd_context: UsdContext, base_layer_identifier: str, **kwargs) ``` ### Description Widget to build an user list to show all live session users of interested layer. ### Methods - `__init__(usd_context, base_layer_identifier, ...)` - Constructor. - `destroy()` - (No description provided) - `empty()` - Checks if it has any user icons added. - `track_layer(layer_identifier)` - (Description not provided in the HTML) ``` ## Attributes ### Layout - **layout**: Root widget of the list. ### __init__ - **Constructor** - **Parameters** - **usd_context** (omni.usd.UsdContext) – USD Context instance. - **base_layer_identifier** (str) – Interested layer to listen to. - **follow_user_with_double_click** (bool) – Whether to enable follow user function of double click. - **Keyword Arguments** - **icon_size** (int) – The width and height of the user icon. 16 pixel by default. - **spacing** (int) – The horizonal spacing between two icons. 2 pixel by default. - **show_myself** (int) – Whether to show local user or not. True by default. - **show_myself_to_leftmost** (bool) – Whether to show local user to the left most, or right most otherwise. True by default. - **maximum_users** (int) – The maximum users to show, and show others with overflow. Unlimited by default. - **prim_path** (Sdf.Path) – Track Live Session for this prim only. ### empty - **empty**() - Checks if it has any user icons added. ### track_layer - **track_layer**(layer_identifier) - Switches the base layer to listen to.
1,667
omni.kit.widget.live_session_management.LiveSessionWidgetExtension.md
# LiveSessionWidgetExtension ## LiveSessionWidgetExtension ``` class omni.kit.widget.live_session_management.LiveSessionWidgetExtension ``` Bases: `IExt` ### Methods | Method | Description | |---------------|-------------| | `get_instance()` | | | `on_shutdown()` | | | `on_startup(ext_id)` | | ```python def __init__(self: omni.ext._extensions.IExt) -> None: ``` ```
416
omni.kit.widget.live_session_management.stop_or_show_live_session_widget.md
# stop_or_show_live_session_widget  ## Functions ### stop_or_show_live_session_widget ```python def stop_or_show_live_session_widget(usd_context: Union[str, UsdContext] = '', stop_session_only: bool = False, stop_session_forcely: bool = False, show_join_options: bool = True, layer_identifier: Optional[str] = None): pass ``` This function allows you to control the live session widget, including stopping the session, showing join options, and more. ``` <em class="sig-param"> <span class="n"> <span class="pre"> usd_context <span class="p"> <span class="pre"> : <span class="w"> <span class="default_value"> <span class="pre"> None , <em class="sig-param"> <span class="n"> <span class="pre"> stop_session_only <span class="p"> <span class="pre"> : <span class="w"> <span class="default_value"> <span class="pre"> False , <em class="sig-param"> <span class="n"> <span class="pre"> stop_session_forcely <span class="p"> <span class="pre"> : <span class="w"> <span class="default_value"> <span class="pre"> False , <em class="sig-param"> <span class="n"> <span class="pre"> show_join_options <span class="p"> <span class="pre"> : <span class="w"> <span class="default_value"> <span class="pre"> False , <em class="sig-param"> <span class="n"> <span class="pre"> layer_identifier <span class="p"> <span class="pre"> : <span class="w"> <span class="default_value"> <span class="pre"> None , <em class="sig-param"> <span class="n"> <span class="pre"> quick_join <span class="p"> <span class="pre"> : <span class="w"> <span class="default_value"> <span class="pre"> False , <em class="sig-param"> <span class="n"> <span class="pre"> prim_path <span class="p"> <span class="pre"> : <span class="w"> <span class="default_value"> <span class="pre"> None ) Stops current live session or shows widget to join/leave session. If current session is empty, it will show the session start dialog. If current session is not empty, it will stop session directly or show stop session menu. Parameters: - **usd_context** – The current usd context to operate on. - **stop_session_only** – If it’s true, it will ask user to stop session if session is not empty without showing merge options. If it’s false, it will show both leave and merge session options. - **stop_session_forcely** – If it’s true, it will stop session forcely even if current sesison is not empty. Otherwise, it will show leave session or both leave and merge options that’s dependent on if stop_session_only is true or false. - **show_join_options** – If it’s true, it will show menu options. If it’s false, it will show session dialog directly. This option is only used when layer is not in a live session. If both quick_join and this param have the same value, it will do quick join. - **layer_identifier** – By default, it will join/stop the live session of the root layer. If layer_identifier is not None, it will join/stop the live session for the specific sublayer. - **quick_join** – Quick Join / Leave a session without bringing up a dialog. This option is only used when layer is not in a live session. If both show_join_options and this param have the same value, this param will be True. - **prim_path** – If prim path is specified, it will join live session for the prim instead of sublayers. Only prim with references or payloads supports to join a live session. Prim path is not needed when it’s to stop a live session. Returns: - It will return the menu widgets created if it needs to create options menu. Otherwise, it will return None.
3,974
omni.kit.widget.live_session_management.stop_or_show_live_session_widget_omni.kit.widget.live_session_management.stop_or_show_live_session_widget.md
# stop_or_show_live_session_widget  ## Functions ### stop_or_show_live_session_widget ```python def stop_or_show_live_session_widget(usd_context: Union[str, UsdContext] = '', stop_session_only: bool = False, stop_session_forcely: bool = False, show_join_options: bool = True, layer_identifier: Optional[str] = None): ... ``` ### Parameters - **usd_context** – The current usd context to operate on. - **stop_session_only** – If it’s true, it will ask user to stop session if session is not empty without showing merge options. If it’s false, it will show both leave and merge session options. - **stop_session_forcely** – If it’s true, it will stop session forcely even if current sesison is not empty. Otherwise, it will show leave session or both leave and merge options that’s dependent on if stop_session_only is true or false. - **show_join_options** – If it’s true, it will show menu options. If it’s false, it will show session dialog directly. This option is only used when layer is not in a live session. If both quick_join and this param have the same value, it will do quick join. - **layer_identifier** – By default, it will join/stop the live session of the root layer. If layer_identifier is not None, it will join/stop the live session for the specific sublayer. - **quick_join** – Quick Join / Leave a session without bringing up a dialog. This option is only used when layer is not in a live session. If both show_join_options and this param have the same value, this param will be True. - **prim_path** – If prim path is specified, it will join live session for the prim instead of sublayers. Only prim with references or payloads supports to join a live session. Prim path is not needed when it’s to stop a live session. ### Returns It will return the menu widgets created if it needs to create options menu. Otherwise, it will return None.
1,865
omni.kit.widget.prompt.Classes.md
# omni.kit.widget.prompt Classes ## Classes Summary - **Prompt** - Pop up a prompt window that asks the user a simple question with up to four buttons for answers. - **PromptButtonInfo** - Prompt button’s information - **PromptManager** - Prompt Manager
261
omni.kit.widget.prompt.Prompt.md
# Prompt ## Prompt Class ```python class omni.kit.widget.prompt.Prompt(title, text, ok_button_text='OK', cancel_button_text=None, middle_button_text=None, middle_2_button_text=None, ok_button_fn=None, cancel_button_fn=None, middle_button_fn=None, middle_2_button_fn=None, modal=False, on_closed_fn=None) ``` This class defines a prompt widget with various configurable options for buttons and their functions. ``` Bases: object ``` Pop up a prompt window that asks the user a simple question with up to four buttons for answers. Callbacks are executed for each button press, as well as when the window is closed manually. ### Methods | Method | Description | |--------|-------------| | `__init__(title, text[, ok_button_text, ...])` | Initialize the callbacks and window information | | `destroy()` | Destructor. | | `hide()` | Make the prompt window invisible | | `is_visible()` | Returns True if the prompt is currently visible. | | `set_cancel_fn(on_cancel_button_clicked)` | Define a new callback for when the third (cancel) button is clicked | | `set_confirm_fn(on_ok_button_clicked)` | Define a new callback for when the first (okay) button is clicked | | `set_middle_2_button_fn(...)` | Define a new callback for when the second (middle) button is clicked | | `set_middle_button_fn(on_middle_button_clicked)` | Define a new callback for when the second (middle) button is clicked | | `set_on_closed_fn(on_on_closed)` | Define a new callback for when the window is closed without pressing a button | | `set_text(...)` | | set_text ``` (text) Set a new question label ``` show ``` () Make the prompt window visible ``` visible ``` Get the prompt's visible stat. ```python __init__(title, text, ok_button_text='OK', cancel_button_text=None, middle_button_text=None, middle_2_button_text=None, ok_button_fn=None, cancel_button_fn=None, middle_button_fn=None, middle_2_button_fn=None, modal=False, on_closed_fn=None, shortcut_keys=True, no_title_bar=False, width=None, height=None, callback_addons: List) ``` ## __init__ Initialize the callbacks and window information ### Parameters - **title** (str) – Text appearing in the titlebar of the window. - **text** (str) – Text of the question being posed to the user. - **ok_button_text** (str) – Text for the first button. - **cancel_button_text** (str) – Text for the last button. - **middle_button_text** (str) – Text for the middle button. - **middle_button_2_text** (str) – Text for the second middle button. - **ok_button_fn** (Callable[[], None]) – Function executed when the first button is pressed. The function signature is: void on_button_clicked_fn(). Defaults to None. - **cancel_button_fn** (Callable[[], None]) – void on_button_clicked_fn(). Defaults to None. - **middle_button_fn** (Callable[[], None]) – void on_button_clicked_fn(). Defaults to None. - **middle_2_button_fn** (Callable[[], None]) – void on_button_clicked_fn(). Defaults to None. - **modal** (bool) – True if the window is modal, shutting down other UI until an answer is received. - **on_closed_fn** (Callable[[], None]) – void on_button_clicked_fn(). Defaults to None. - **shortcut_keys** (bool) – If it can be confirmed or hidden with shortcut keys like Enter or ESC. Defaults to True. - **no_title_bar** (bool) – If it needs to show title bar. Defaults to True. - **width** (int) – The specified width. By default, it will use the computed width. - **height** (int) – The specified height. By default, it will use the computed height. - **callback_addons** (List) – Addon widgets which is appended in the prompt window. By default, it is empty. ## destroy Destructor. ## hide ### omni.kit.widget.prompt.Prompt.hide Make the prompt window invisible ### omni.kit.widget.prompt.Prompt.is_visible is_visible() → bool Returns True if the prompt is currently visible. - Returns: bool ### omni.kit.widget.prompt.Prompt.set_cancel_fn set_cancel_fn(on_cancel_button_clicked) Define a new callback for when the third (cancel) button is clicked ### omni.kit.widget.prompt.Prompt.set_confirm_fn set_confirm_fn(on_ok_button_clicked) Define a new callback for when the first (okay) button is clicked ### omni.kit.widget.prompt.Prompt.set_middle_2_button_fn set_middle_2_button_fn(on_middle_2_button_clicked) Define a new callback for when the second (middle) button is clicked ### omni.kit.widget.prompt.Prompt.set_middle_button_fn set_middle_button_fn(on_middle_button_clicked) Define a new callback for when the second (middle) button is clicked ### omni.kit.widget.prompt.Prompt.set_on_closed_fn set_on_closed_fn(on_on_closed) Define a new callback for when the window is closed without pressing a button ### omni.kit.widget.prompt.Prompt.set_text set_text(text) Set a new question label ### omni.kit.widget.prompt.Prompt.show show() Make the prompt window visible ### omni.kit.widget.prompt.Prompt.visible property visible Get the prompt’s visible stat. - Returns: True is prompt is visible else False. - Return type: bool
4,973
omni.kit.widget.prompt.PromptButtonInfo.md
# PromptButtonInfo ## PromptButtonInfo ### PromptButtonInfo Prompt button’s information #### Methods | Method | Description | |--------|-------------| | `__init__(name[, on_button_clicked_fn])` | Constructor. | #### Attributes | Attribute | Description | |-----------|-------------| | `name` | Get the button's name. | <table> <tbody> <tr class="row-even"> <td> <p> <code> on_button_clicked_fn <td> <p> Get the button clicked function. <dl> <dt> <span> __init__ ( <em> <span> name : <span> str , <em> <span> on_button_clicked_fn : <span> Optional [ Callable [ ] , None ] = <span> None ) <dd> <p> Construtor. <dl> <dt> Parameters <dd> <ul> <li> <p> <strong> name ( <em> str ) – The button’s name. <li> <p> <strong> on_button_clicked_fn ( <em> Callable [ [ ] , None ] , <em> optional ) – Function executed when this button clicked. The function signature is: void on_button_clicked_fn(). Defaults to None. <dl> <dt> <em> property <span> name <em> : <span> str <dd> <p> Get the button’s name. <dl> <dt> Returns <dd> <p> Name of the button. <dt> Return type <dd> <p> str <dl> <dt> <em> property <span> on_button_clicked_fn <em> : <span> Callable [ [ ] , None ] <dd> <p> Get the button clicked function. <dl> <dt> Returns <dd> <p> Function executed when this button clicked. The function signature is: void on_button_clicked_fn() <dt> Return type <dd> <p> Callable[[], None]
2,805
omni.kit.widget.prompt.PromptManager.md
# PromptManager ## Methods - `add_prompt(prompt)` - Add the prompt to manager. - `on_shutdown()` - Remove all the prompts when shut down - `on_startup()` - (No description provided) - `post_simple_prompt(title, message[, ...])` - Post a simple prompt with given parameters. - `query_prompt_by_title(title)` - Query the prompt by title. - `remove_prompt(prompt)` - Remove the prompt from manager. ## `__init__` - (No description provided) ## Methods ### `__init__()` ### `add_prompt(prompt: Prompt)` Add the prompt to manager. Parameters: - **prompt** (`Prompt`) – Prompt to add. ### `on_shutdown()` Remove all the prompts when shut down. ### `post_simple_prompt(title: str, message: str, ok_button_info: PromptButtonInfo = <PromptButtonInfo object>, cancel_button_info: Optional[PromptButtonInfo] = None, middle_button_info: Optional[PromptButtonInfo] = None, middle_2_button_info: Optional[PromptButtonInfo] = None, on_window_closed_fn: Optional[Callable[[], None]] = None, modal=True, shortcut_keys=True, standalone=True, no_title_bar=False, width=None, height=None, callback_addons: List = [])` Post a simple prompt with given param. Note: When standalone is true, it will hide all other managed prompts in this manager. Parameters: - **title** (`str`) – Text appearing in the titlebar of the window. - **message** (`str`) – The message to display in the prompt. - **ok_button_info** (`PromptButtonInfo`) – Information about the OK button. - **cancel_button_info** (`Optional[PromptButtonInfo]`) – Information about the Cancel button. - **middle_button_info** (`Optional[PromptButtonInfo]`) – Information about the middle button. - **middle_2_button_info** (`Optional[PromptButtonInfo]`) – Information about the second middle button. - **on_window_closed_fn** (`Optional[Callable[[], None]]`) – Function to call when the window is closed. - **modal** (`bool`) – If true, the prompt will be modal. - **shortcut_keys** (`bool`) – If true, shortcut keys will be enabled. - **standalone** (`bool`) – If true, the prompt will be standalone. - **no_title_bar** (`bool`) – If true, the title bar will not be displayed. - **width** (`Optional[int]`) – Width of the prompt window. - **height** (`Optional[int]`) – Height of the prompt window. - **callback_addons** (`List`) – List of additional callback addons. <p> <strong> message ( <em> str ) – Message being posed to the user. <li> <p> <strong> ( ( <em> middle_2_button_info ) – obj:’PromptButtonInfo’): Information for the ok button. <li> <p> <strong> ( – obj:’PromptButtonInfo’): Information for the last button. <li> <p> <strong> ( – obj:’PromptButtonInfo’): Information for the middle button. <li> <p> <strong> ( – obj:’PromptButtonInfo’): Information for the second middle button. <li> <p> <strong> on_window_closed_fn ( <em> Callable <em> [ <em> [ <em> ] <em> , <em> None <em> ] ) – Function executed when the window is closed.The function signature is: void on_button_clicked_fn(). Defaults to None. <li> <p> <strong> modal ( <em> bool ) – True if the window is modal, shutting down other UI until an answer is received <li> <p> <strong> shortcut_keys ( <em> bool ) – If it can be confirmed or hidden with shortcut keys like Enter or ESC. Defaults to True. <li> <p> <strong> no_title_bar ( <em> bool ) – If it needs to show title bar. Defaults to True. <li> <p> <strong> width ( <em> int ) – The specified width. By default, it will use the computed width. <li> <p> <strong> height ( <em> int ) – The specified height. By default, it will use the computed height. <li> <p> <strong> callback_addons ( <em> List ) – Addon widgets which is appended in the prompt window. By default, it is empty. <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.prompt.PromptManager.query_prompt_by_title"> <em class="property"> <span class="pre"> static <span class="w"> <span class="sig-name descname"> <span class="pre"> query_prompt_by_title <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 <span class="sig-paren"> ) <a class="headerlink" href="#omni.kit.widget.prompt.PromptManager.query_prompt_by_title" title="Permalink to this definition">  <dd> <p> Query the prompt by tiyle. <dl class="field-list simple"> <dt class="field-odd"> Parameters <dd class="field-odd"> <p> <strong> title ( <em> str ) – Prompt to query. <dt class="field-even"> Returns <dd class="field-even"> <p> obj:’Prompt’): Prompt with the title in manager. <dt class="field-odd"> Return type <dd class="field-odd"> <p> prompt ( <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.widget.prompt.PromptManager.remove_prompt"> <em class="property"> <span class="pre"> static <span class="w"> <span class="sig-name descname"> <span class="pre"> remove_prompt <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> prompt <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <a class="reference internal" href="omni.kit.widget.prompt.Prompt.html#omni.kit.widget.prompt.Prompt" title="omni.kit.widget.prompt.prompt.Prompt"> <span class="pre"> Prompt <span class="sig-paren"> ) <a class="headerlink" href="#omni.kit.widget.prompt.PromptManager.remove_prompt" title="Permalink to this definition">  <dd> <p> Remove the prompt from mananger. <dl class="field-list simple"> <dt class="field-odd"> Parameters <dd class="field-odd"> <p> <strong> ( ( <em> prompt ) – obj:’Prompt’): Prompt to be remove. <footer> <hr/> <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); });
5,772
omni.kit.widget.settings.Classes.md
# omni.kit.widget.settings Classes ## Classes Summary - **SettingType** - Supported setting types for create_setting_widget. - **SettingWidgetType** - Supported setting UI widget types. - **SettingsSearchableCombo** - Searchable combo box, needs omni.kit.widget.searchable_combobox extensions. - **SettingsWidgetBuilder** - Widget builder functions.
362
omni.kit.widget.settings.create_setting_widget.md
# create_setting_widget ## create_setting_widget ``` ```markdown Create a UI widget connected with a setting. If `range_from` >= `range_to` there is no limit. Undo/redo operations are also supported, because changing setting goes through the `omni.kit.commands` module, using `:class:`.ChangeSettingCommand`. ### Parameters ``` ```markdown - `setting_path`: str - `setting_type`: SettingType - `range_from`: int = 0 - `range_to`: int = 0 - `speed`: int = 1 - `**kwargs` Returns: Tuple[Widget, AbstractValueModel] ``` ```markdown This markdown content is a direct conversion from the provided HTML, ensuring that all text content is preserved and formatted according to markdown syntax. All links and images have been removed as per the instructions. - **setting_path** – Path to the setting to show and edit. - **setting_type** – Type of the setting to expect. - **range_from** – Limit setting value lower bound. - **range_to** – Limit setting value upper bound. - **speed** – Range speed Returns : ui.Widget` and :class:`ui.AbstractValueModel connected with the setting on the path specified.
1,101
omni.kit.widget.settings.create_setting_widget_combo.md
# create_setting_widget_combo ## create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ####### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown # create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ####### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown # create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ####### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown # create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ####### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown # create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ####### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown # create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ####### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown # create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ####### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown # create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ####### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown # create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ####### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown # create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ####### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown # create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ####### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown # create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ####### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown # create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ####### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown # create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ####### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown # create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ####### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown # create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ####### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown # create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ####### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown # create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ####### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown # create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ####### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown # create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ####### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown # create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ####### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown # create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ####### create_setting_widget_combo ``` ```markdown ###### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown # create_setting_widget_combo ``` ```markdown ## create_setting_widget_combo ``` ```markdown ### create_setting_widget_combo ``` ```markdown #### create_setting_widget_combo ``` ```markdown ##### create_setting_widget_combo - **items** – Can be either ``` dict` or :py:obj:`list`. For :py:obj:`dict ``` keys are UI displayed names, values are actual values set into settings. If it is a ``` list ``` UI displayed names are equal to setting values. - **setting_is_index** – None - Detect type from setting_path value. If the type is int, set to True. True - setting_path value is index into items list (default) False - setting_path value is string in items list
13,878
omni.kit.widget.settings.Functions.md
# omni.kit.widget.settings Functions ## Functions Summary - **create_setting_widget** - Create a UI widget connected with a setting. - **create_setting_widget_combo** - Create a Combo Setting widget. - **get_style** - Get default style. - **get_ui_style_name** - Gets which light/dark theme kit is using. Not widely supported.
339
omni.kit.widget.settings.get_ui_style_name.md
# get_ui_style_name ## get_ui_style_name ```python omni.kit.widget.settings.get_ui_style_name() ``` Gets which light/dark theme kit is using. Not wildly supported. ```
170
omni.kit.widget.settings.md
# omni.kit.widget.settings ## Submodules Summary: - [omni.kit.widget.settings.settings_model](omni.kit.widget.settings.settings_model.html) - Source for SettingModel, RadioButtonSettingModel, AssetPathSettingsModel, VectorFloatComponentModel, VectorIntComponentModel, VectorSettingsModel, VectorFloatSettingsModel, VectorIntSettingsModel, SettingsComboValueModel, SettingsComboNameValueItem, SettingsComboItemModel. - [omni.kit.widget.settings.settings_widget](omni.kit.widget.settings.settings_widget.html) - Source for SettingType, SettingWidgetType, SettingsSearchableCombo, create_setting_widget, create_setting_widget_combo. - [omni.kit.widget.settings.settings_widget_builder](omni.kit.widget.settings.settings_widget_builder.html) - Source for SettingsWidgetBuilder, AssetPicker. - [omni.kit.widget.settings.style](omni.kit.widget.settings.style.html) - Source for get_ui_style_name, get_style. ## Classes Summary: - [SettingType](omni.kit.widget.settings/omni.kit.widget.settings.SettingType.html) - Supported setting types for create_setting_widget. - [SettingWidgetType](omni.kit.widget.settings/omni.kit.widget.settings.SettingWidgetType.html) - Supported setting UI widget types - [SettingsSearchableCombo](omni.kit.widget.settings/omni.kit.widget.settings.SettingsSearchableCombo.html) - Searchable combo box, needs omni.kit.widget.searchable_combobox extensions - [SettingsWidgetBuilder](omni.kit.widget.settings/omni.kit.widget.settings.SettingsWidgetBuilder.html) - Widget builder functions. ## Functions Summary: - [create_setting_widget](omni.kit.widget.settings/omni.kit.widget.settings.create_setting_widget.html) - Create a UI widget connected with a setting. | create_setting_widget_combo | Create a Combo Setting widget. | |------------------------------|--------------------------------| | get_style | Get default style. | | get_ui_style_name | Gets which light/dark theme kit is using. Not wildly supported. |
2,006
omni.kit.widget.settings.SettingsSearchableCombo.md
# SettingsSearchableCombo ## Class: omni.kit.widget.settings.SettingsSearchableCombo ### Constructor ```python __init__(setting_path: str, key_value_pairs: dict, default_key: str) ``` ### Methods - **__init__(setting_path, key_value_pairs, default_key)** - **destroy()** - Destroy class and cleanup. - **get_current_key()** - Gets current key selected in combo box. - **get_key_from_value()** - Gets the key from the given value. | Method Name | Description | |-------------|-------------| | `get_key_from_value(value)` | Gets key from value. | ### __init__(setting_path: str, key_value_pairs: dict, default_key: str) ### destroy() Destroy class and cleanup. ### get_current_key() Gets current key selected in combo box. ### get_key_from_value(value) Gets key from value.
785
omni.kit.widget.settings.SettingsWidgetBuilder.md
# SettingsWidgetBuilder ## Methods - `createAssetWidget(model[, ...])` - Create widget for file asset with filepicker. - `createBoolWidget(model[, ...])` - Create a boolean widget. - `createColorWidget(model[, comp_count, ...])` - Create a three color floating-point widget. - `createComboboxWidget(setting_path[, items, ...])` - Create a Combo Setting widget. - `createDoubleArrayWidget(model, range_min, ...)` - Create a widget for multiple double-precision floating-point numbers. | Function Name | Description | |---------------|-------------| | `createFloatWidget(model, range_min, range_max)` | Create a floating point widget. | | `createIntArrayWidget(model, range_min, range_max)` | Create a widget for multiple integer numbers. | | `createIntWidget(model, range_min, range_max)` | Create a integer widget. | | `createRadiobuttonWidget(model[, ...])` | Create a RadioButtons Setting widget. | | `createVecWidget(model, range_min, range_max)` | Create a widget for multiple XYZW float values. | | `get_checkbox_alignment()` | Get checkbox alignment from setting "/ext/omni.kit.window.property/checkboxAlignment" and return True/False | | `get_label_alignment()` | Get label alignment from setting "/ext/omni.kit.window.property/labelAlignment" and return True/False | ### `__init__()` ### `createAssetWidget(model, additional_widget_kwargs=None)` Create widget for file asset with filepicker. ### `createBoolWidget(model, additional_widget_kwargs=None)` Create a boolean widget. ### `createColorWidget(model, comp_count=3)` Create a color widget. ### createColorWidget ```markdown Create a three color floating-point widget. ```markdown ### createComboboxWidget ```markdown Create a Combo Setting widget. This function creates a combo box that shows a provided list of names and it is connected with setting by path specified. Underlying setting values are used from values of `items` dict. #### Parameters - **setting_path** – Path to the setting to show and edit. - **items** – Can be either `dict` or :py:obj:`list`. For :py:obj:`dict` keys are UI displayed names, values are actual values set into settings. If it is a `list` - UI displayed names are equal to setting values. - **setting_is_index** – None - Detect type from setting_path value. If the type is int, set to True. True - setting_path value is index into items list (default) False - setting_path value is string in items list ## createDoubleArrayWidget ```python classmethod createDoubleArrayWidget(model, range_min, range_max, comp_count=3, additional_widget_kwargs=None) ``` Create a widget for multiple double-precision floating-point numbers. ## createFloatWidget ```python classmethod createFloatWidget(model, range_min, range_max, additional_widget_kwargs=None) ``` Create a floating point widget. ## createIntArrayWidget ```python classmethod createIntArrayWidget(model, range_min, range_max, comp_count=3, additional_widget_kwargs=None) ``` Create a widget for multiple integer numbers. ## createIntWidget ```python classmethod createIntWidget(model, range_min, range_max, additional_widget_kwargs=None) ``` Create a integer widget. ### createRadiobuttonWidget **classmethod** ```python createRadiobuttonWidget(model: RadioButtonSettingModel, setting_path: str = '', additional_widget_kwargs: Optional[dict] = None) -> RadioCollection ``` - **Description:** Create a RadioButtons Setting widget. This function creates a Radio Buttons that shows a list of names that are connected with setting by path specified - “{setting_path}/items”. - **Parameters:** - **model** – A RadioButtonSettingModel instance. - **setting_path** – Path to the setting to show and edit. - **Returns:** - A omni.ui.RadioCollection instance. - **Return type:** - (omni.ui.RadioCollection) ### createVecWidget **classmethod** ```python createVecWidget(model, range_min, range_max, comp_count=3, additional_widget_kwargs=None) ``` - **Description:** Create a widget for multiple XYZW float values. ### get_checkbox_alignment **classmethod** ```python get_checkbox_alignment() ``` - **Description:** Get checkbox alignment from setting “/ext/omni.kit.window.property/checkboxAlignment” and return True/False ### get_label_alignment **classmethod** ```python get_label_alignment() ``` - **Description:** Get label alignment from setting “/ext/omni.kit.window.property/labelAlignment” and return True/False
4,421
omni.kit.widget.settings.settings_model.AssetPathSettingsModel.md
# AssetPathSettingsModel ## AssetPathSettingsModel ``` ```markdown class omni.kit.widget.settings.settings_model.AssetPathSettingsModel(setting_path: str, draggable: bool = False) ``` ```markdown Bases: SettingModel ``` ```markdown ### Methods - **get_resolved_path**() - Get full path. ``` ```markdown ### Attributes ``` ```markdown __init__(setting_path: str, draggable: bool = False) ``` ### __init__(setting_path: str, draggable: bool = False) SettingModel init function. #### Parameters - **setting_path** – setting_path carb setting to create a model for - **draggable** – is it a numeric value you will drag in the UI? ### get_resolved_path() Get full path.
675
omni.kit.widget.settings.settings_model.Classes.md
# omni.kit.widget.settings.settings_model Classes ## Classes Summary - **AssetPathSettingsModel** - Model for simple scalar/POD carb.settings - **RadioButtonSettingModel** - Model for simple RadioButton widget. The setting value and options are strings. - **SettingModel** - Model for simple scalar/POD carb.settings - **SettingsComboItemModel** - Model for a combo box - for each setting we have a dictionary of key, values - **SettingsComboNameValueItem** - SettingsComboNameValueItem for combo boxes - **SettingsComboValueModel** - Model to store a pair (label, value of arbitrary type) for use in a ComboBox - **VectorFloatComponentModel** - VectorFloatComponentModel - **VectorFloatSettingsModel** - Model For Color, Vec3 and other multi-component settings - **VectorIntComponentModel** - A very simple Int model. VectorIntSettingsModel ===================== Model For Color, Vec3 and other multi-component settings VectorSettingsModel =================== Model For Color, Vec3 and other multi-component settings
1,048
omni.kit.widget.settings.settings_model.Functions.md
# omni.kit.widget.settings.settings_model Functions ## Functions Summary | Function Name | Description | |---------------|-------------| | update_reset_button | work out whether to show the reset button highlighted or not depending on whether the setting |
258
omni.kit.widget.settings.settings_model.md
# omni.kit.widget.settings.settings_model ## Classes Summary: - **AssetPathSettingsModel** - Model for simple scalar/POD carb.settings - **RadioButtonSettingModel** - Model for simple RadioButton widget. The setting value and options are strings. - **SettingModel** - Model for simple scalar/POD carb.settings - **SettingsComboItemModel** - Model for a combo box - for each setting we have a dictionary of key, values - **SettingsComboNameValueItem** - SettingsComboNameValueItem for combo boxes - **SettingsComboValueModel** - Model to store a pair (label, value of arbitrary type) for use in a ComboBox - **VectorFloatComponentModel** - VectorFloatComponentModel - **VectorFloatSettingsModel** - Model For Color, Vec3 and other multi-component settings - **VectorIntComponentModel** - A very simple Int model. | VectorIntSettingsModel | Model For Color, Vec3 and other multi-component settings | |------------------------|--------------------------------------------------------| | VectorSettingsModel | Model For Color, Vec3 and other multi-component settings | Functions Summary: | update_reset_button | work out whether to show the reset button highlighted or not depending on whether the setting |
1,236
omni.kit.widget.settings.settings_model.RadioButtonSettingModel.md
# RadioButtonSettingModel ## RadioButtonSettingModel ```python class omni.kit.widget.settings.settings_model.RadioButtonSettingModel(setting_path: str) ``` Bases: `SimpleStringModel` Model for simple RadioButton widget. The setting value and options are strings. ### Methods - **__init__(setting_path)** - RadioButtonSettingModel init function. - **get_value()** - Return current selected item string/label. - **get_value_as_int()** - Return current selected item idx. - **set_reset_button(button)** - Set reset button from ui.Rectangle. ``` <p> <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> set_value (value[, update_setting]) <p> Set given value as current selected <p class="rubric"> Attributes <table> <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"> items <td> <p> <tr class="row-even"> <td> <p> <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> setting_path <td> <p> <dl> <dt> <span class="pre"> __init__ (setting_path: str) <dd> <p> RadioButtonSettingModel init function. <dl> <dt> Parameters <dd> <p> <strong> setting_path – Carb setting path to create a model for. RadioButton items are specified in carb.settings “{setting_path}/items” <dl> <dt> <span class="pre"> get_value () -> str <dd> <p> Return current selected item string/label. <dl> <dt> <span class="pre"> get_value_as_int () -> int <dd> <p> Return current selected item idx. <dl> <dt> <span class="pre"> set_reset_button (button: Rectangle) <dd> <p> Set reset button from ui.Rectangle. <dl> <dt> <span class="pre"> set_value (value: Union[int, str], update_setting: bool = True) <dd> <p> Set given value as current selected ### Parameters **value** (**int** | **str**) – Value to set. It can be either an int (index) or a string (label) ### Kwargs: - update_setting (bool): Update corresponding carb.setting. Default True.
2,648