file_path
stringlengths 5
148
| content
stringlengths 0
526k
|
---|---|
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
</span>
</span>
</dt>
<dd>
<p>
Alias for field number 2
</p>
</dd>
</dl>
<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
</span>
</span>
</dt>
<dd>
<p>
Alias for field number 1
</p>
</dd>
</dl>
<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
</span>
</span>
</dt>
<dd>
<p>
Alias for field number 0
</p>
</dd>
</dl> |
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. | |
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
--- |
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 | |
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`</span>
- Model to display the node graph
- `delegate <span class="classifier">AbstractGraphNodeDelegate`</span>
- Delegate to draw the node
- `virtual_ports <span class="classifier">bool`</span>
- True when the model should use reversed output for better look of the graph.
- `port_grouping <span class="classifier">bool`</span>
- True when the widget should use sub-ports for port grouping.
- `draw_curve_top_layer <span class="classifier">bool`</span>
- 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`</span>
- 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>
<span class="w">
</span>
</em>
<span class="sig-name descname">
<span class="pre">
pan_x
</span>
</span>
<dd>
<p>
The horizontal offset of the scene
</p>
</dd>
</dt>
</dl>
<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>
<span class="w">
</span>
</em>
<span class="sig-name descname">
<span class="pre">
pan_y
</span>
</span>
<dd>
<p>
The vertical offset of the scene
</p>
</dd>
</dt>
</dl>
<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>
<span class="w">
</span>
</em>
<span class="sig-name descname">
<span class="pre">
selection
</span>
</span>
<dd>
<p>
Return selected nodes
</p>
</dd>
</dt>
</dl>
<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>
<span class="w">
</span>
</em>
<span class="sig-name descname">
<span class="pre">
virtual_ports
</span>
</span>
<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>
<p>
Example:
A.out ————-> B.surface
A.color [REVERSED] <- B.color
</p>
</dd>
</dt>
</dl>
<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>
<span class="w">
</span>
</em>
<span class="sig-name descname">
<span class="pre">
zoom
</span>
</span>
<dd>
<p>
The zoom level of the scene
</p>
</dd>
</dt>
</dl>
<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>
<span class="w">
</span>
</em>
<span class="sig-name descname">
<span class="pre">
zoom_max
</span>
</span>
<dd>
<p>
The maximum zoom level of the scene
</p>
</dd>
</dt>
</dl>
<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>
<span class="w">
</span>
</em>
<span class="sig-name descname">
<span class="pre">
zoom_min
</span>
</span>
<dd>
<p>
The minminum zoom level of the scene
</p>
</dd>
</dt>
</dl> |
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>
<span class="w">
</span>
</em>
<span class="sig-name descname">
<span class="pre">
get_type_name
</span>
</span>
<span class="sig-paren">
(
</span>
<span class="sig-paren">
)
</span>
<span class="sig-return">
<span class="sig-return-icon">
→
</span>
<span class="sig-return-typehint">
<span class="pre">
str
</span>
</span>
</span>
</dt>
<dd>
<p>
The string type that goes the source model and view
</p>
</dd>
</dl>
<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>
<span class="w">
</span>
</em>
<span class="sig-name descname">
<span class="pre">
ports
</span>
</span>
<em class="property">
<span class="p">
<span class="pre">
:
</span>
</span>
<span class="w">
</span>
<span class="pre">
Optional
</span>
<span class="p">
<span class="pre">
[
</span>
</span>
<span class="pre">
List
</span>
<span class="p">
<span class="pre">
[
</span>
</span>
<span class="pre">
Any
</span>
<span class="p">
<span class="pre">
]
</span>
</span>
<span class="p">
<span class="pre">
]
</span>
</span>
</em>
</dt>
<dd>
<p>
The list of ports of this node. It only has output ports from the compound node.
</p>
</dd>
</dl>
<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>
</span>
<span class="sig-paren">
(
</span>
<em class="sig-param">
<span class="n">
<span class="pre">
source
</span>
</span>
<span class="p">
<span class="pre">
:
</span>
</span>
<span class="w">
</span>
<span class="n">
<span class="pre">
Any
</span>
</span>
</em>
,
<em class="sig-param">
<span class="n">
<span class="pre">
target
</span>
</span>
<span class="p">
<span class="pre">
:
</span>
</span>
<span class="w">
</span>
<span class="n">
<span class="pre">
Any
</span>
</span>
</em>
<span class="sig-paren">
)
</span>
</dt>
<dd>
<p>
Return if it’s possible to connect source to target
</p>
</dd>
</dl>
<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>
</span>
<span class="sig-paren">
(
</span>
<em class="sig-param">
<span class="n">
<span class="pre">
fn
</span>
</span>
</em>
<span class="sig-paren">
)
</span>
</dt>
<dd>
<p>
Return the object that will automatically unsubscribe when destroyed.
</p>
</dd>
</dl>
<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>
</span>
<span class="sig-paren">
(
</span>
<em class="sig-param">
<span class="n">
<span class="pre">
fn
</span>
</span>
</em>
<span class="sig-paren">
)
</span>
</dt>
<dd>
<p>
Return the object that will automatically unsubscribe when destroyed.
</p>
</dd>
</dl>
<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>
</span>
<span class="sig-paren">
(
</span>
<em class="sig-param">
<span class="n">
<span class="pre">
fn
</span>
</span>
</em>
<span class="sig-paren">
)
</span>
</dt>
<dd>
<p>
Return the object that will automatically unsubscribe when destroyed.
</p>
</dd>
</dl>
<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>
<span class="w">
</span>
</em>
<span class="sig-name descname">
<span class="pre">
nodes
</span>
</span>
</dt>
<dd>
<p>
It’s only called to get the nodes from the top level
</p>
</dd>
</dl> |
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) |
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. |
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 |
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)
```
``` |
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 | |
omni.kit.widget.graph.selection_getter.SelectionGetter.md | # SelectionGetter
## Methods
- `__init__(model)`
## Attributes
- None
### `__init__(model)`
Initialize the SelectionGetter with a GraphModel.
# 标题
这是一个段落,包含一些文本信息。
## 子标题
这里是另一个段落。 |
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 | |
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 | |
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>
<p>
Check if the selected item is not from session layer tree.
</p>
<p>
is_not_live_layer()
</p>
<p>
Check if selected layer item is not live syncing layer.
</p>
<p>
is_not_live_session_layer()
</p>
<p>
Check if selected layer item is not live session layer.
</p>
<p>
is_not_missing_layer()
</p>
<p>
Check if the selected item is not missing layer.
</p>
<p>
is_not_omni_layer()
</p>
<p>
Check if the selected item is not omniverse layer.
</p>
<p>
is_not_reserved_layer()
</p>
<p>
Check if the selected item is not reserved layer.
</p>
<p>
is_omni_layer()
</p>
<p>
Check if the selected item is omniverse layer.
</p>
<p>
is_over_specifier(objects)
</p>
<p>
Check if the selected prim item's specifier is 'OVER_ONLY'.
</p>
<p>
is_prim_spec_item()
</p>
<p>
Check if the selected item is prim spec item.
</p>
<p>
is_reserved_layer()
</p>
<p>
Check if the selected item is reserved layer.
</p>
<p>
is_spec_linking_mode()
</p>
<p>
Check if the selected item is in spec linking mode.
</p>
<p>
link_selected_prims(objects)
</p>
<p>
Link the selected prims to a specific layer item.
</p>
<p>
link_selected_prims_with_hierarchy(objects)
</p>
<p>
Link the selected prims to a specific layer item with hierarchy.
</p>
<p>
merge_down_one()
</p>
<p>
Merge selected layer items down to one.
</p>
<p>
move_prims()
</p>
<p>
Move selected prims to a specific layer item.
</p>
- `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.
</p>
<dl class="field-list simple">
<dt class="field-odd">
Parameters
</dt>
<dd class="field-odd">
<p>
<strong>
objects
</strong>
(
<em>
dict
</em>
) – A dictionary containing selected item information.
</p>
</dd>
<dt class="field-even">
Returns
</dt>
<dd class="field-even">
<p>
bool
</p>
</dd>
</dl>
</dd>
</dl>
<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>
</span>
<span class="sig-paren">
(
</span>
<span class="sig-paren">
)
</span>
<a class="headerlink" href="#omni.kit.widget.layers.ContextMenu.can_flatten_sublayers" title="Permalink to this definition">
</a>
</dt>
<dd>
<p>
Check if selected layer item can flatten sublayer.
</p>
<dl class="field-list simple">
<dt class="field-odd">
Parameters
</dt>
<dd class="field-odd">
<p>
<strong>
objects
</strong>
(
<em>
dict
</em>
) – A dictionary containing selected item information.
</p>
</dd>
<dt class="field-even">
Returns
</dt>
<dd class="field-even">
<p>
bool
</p>
</dd>
</dl>
</dd>
</dl>
<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>
</span>
<span class="sig-paren">
(
</span>
<span class="sig-paren">
)
</span>
<a class="headerlink" href="#omni.kit.widget.layers.ContextMenu.can_merge_layer_down" title="Permalink to this definition">
</a>
</dt>
<dd>
<p>
Check if the selected layer item can be merged down.
</p>
<dl class="field-list simple">
<dt class="field-odd">
Parameters
</dt>
<dd class="field-odd">
<p>
<strong>
objects
</strong>
(
<em>
dict
</em>
) – A dictionary containing selected item information.
</p>
</dd>
<dt class="field-even">
Returns
</dt>
<dd class="field-even">
<p>
bool
</p>
</dd>
</dl>
</dd>
</dl>
<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>
</span>
<span class="sig-paren">
(
</span>
<span class="sig-paren">
)
</span>
<a class="headerlink" href="#omni.kit.widget.layers.ContextMenu.can_not_edit_sublayer" title="Permalink to this definition">
</a>
</dt>
<dd>
<p>
Check if selected layer item can edit sublayer.
</p>
<dl class="field-list simple">
<dt class="field-odd">
Parameters
</dt>
<dd class="field-odd">
<p>
<strong>
objects
</strong>
(
<em>
dict
</em>
) – A dictionary containing selected item information.
</p>
</dd>
<dt class="field-even">
Returns
</dt>
<dd class="field-even">
<p>
bool
</p>
</dd>
</dl>
</dd>
</dl>
<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>
</span>
<span class="sig-paren">
(
</span>
<span class="sig-paren">
)
</span>
<a class="headerlink" href="#omni.kit.widget.layers.ContextMenu.can_set_as_edit_target" title="Permalink to this definition">
</a>
</dt>
<dd>
<p>
Check if selected layer can set as edit target.
</p>
<dl class="field-list simple">
<dt class="field-odd">
Parameters
</dt>
<dd class="field-odd">
<p>
<strong>
objects
</strong>
(
<em>
dict
</em>
) – A dictionary containing selected item information.
</p>
</dd>
<dt class="field-even">
Returns
</dt>
<dd class="field-even">
<p>
bool
</p>
</dd>
</dl>
</dd>
</dl>
<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>
</span>
<span class="sig-paren">
(
</span>
<em class="sig-param">
<span class="n">
<span class="pre">
objects
</span>
</span>
</em>
<span class="sig-paren">
)
</span>
<a class="headerlink" href="#omni.kit.widget.layers.ContextMenu.clear_all_linked_prims" title="Permalink to this definition">
</a>
</dt>
<dd>
<p>
Clear all the linked prims from a specific layer item.
</p>
<dl class="field-list simple">
<dt class="field-odd">
Parameters
</dt>
<dd class="field-odd">
<p>
<strong>
objects
</strong>
(
<em>
dict
</em>
) – A dictionary containing selected item information.
</p>
</dd>
</dl>
</dd>
</dl>
<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>
</span>
<span class="sig-paren">
(
</span>
<span class="sig-paren">
)
</span>
<a class="headerlink" href="#omni.kit.widget.layers.ContextMenu.copy_layer_url" title="Permalink to this definition">
</a>
</dt>
<dd>
<p>
Deprecated.
</p>
</dd>
</dl>
<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>
</span>
<span class="sig-paren">
(
</span>
<span class="sig-paren">
)
</span>
<a class="headerlink" href="#omni.kit.widget.layers.ContextMenu.copy_url" title="Permalink to this definition">
</a>
</dt>
<dd>
<p>
Copy the selected item’s url to clipboard.
</p>
<dl class="field-list simple">
<dt class="field-odd">
Parameters
</dt>
<dd class="field-odd">
<p>
<strong>
objects
</strong>
(
<em>
dict
</em>
) – A dictionary containing selected item information.
</p>
</dd>
### 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
</em>
) – A dictionary containing selected item information.
```markdown
Unlink the selected prims to a specific layer item.
### Parameters
- **objects** (
<em>
dict
</em>
) – A dictionary containing selected item information.
```
## unlink_selected_prims_with_hierarchy
```
(
<em>
dict
</em>
) – A dictionary containing selected item information.
```
Unlink the selected prims to a specific layer item with hierarchy.
### Parameters
- **objects** (
<em>
dict
</em>
) – A dictionary containing selected item information.
``` |
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. | |
omni.kit.widget.layers.get_instance.md | # get_instance
Returns the instance of the LayerExtension.
## Returns
- obj: 'omni.ext.IExt': The instance of the LayerExtension. |
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
# 这是一个标题
```
这是一段代码
```
描述图片的文本
--- |
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</em>) – The USD context associated with the item.
<strong>identifier</strong> (<em>str</em>) – The identifier of the item.
<strong>layer</strong> (<em>Sdf.Layer</em>) – The Sdf.Layer object associated with the item.
<strong>model</strong> (<em>LayerModel</em>) – The model associated with the item.
<strong>parent_item</strong> (<em>LayerItem</em>) – The parent item of the item.
<span class="pre">destroy</span>() – Clean up used model and subscription.
<span class="pre">find_all_specs</span>(<em>paths: List[Path]</em>) – Find the child node with given name and return the list of all the parent nodes and the found node. It populates the children during search.
Parameters:
- <strong>paths</strong> (<em>List[Sdf.Path]</em>) – Paths of child prims to find.
Returns:
- List[PrimSpecItem]
<span class="pre">get_item_value_model</span>(<em>column_id</em>) – Returns the value model associated with the specified column ID.
Parameters:
- <strong>column_id</strong> (<em>int</em>) – The ID of the column.
Returns:
- The value model associated with the column.
Return type:
- model(omni.ui.AbstractValueModel)
<span class="pre">on_content_changed</span>(<em>changed_prim_spec_paths: List[str]</em>) – Handles updates to content based on changes in prim spec paths.
Parameters:
- <strong>changed_prim_spec_paths</strong> (<em>List[str]</em>) – A list of string paths representing the prims that have changed.
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
]]
</p>
</dd>
</dl>
</dd>
</dl>
<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>
</span>
<span class="sig-paren">
(
</span>
<span class="sig-paren">
)
</span>
</dt>
<dd>
<p>
Notifies all items in the prim specs cache about the change in layer edit mode.
</p>
</dd>
</dl>
<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>
</span>
<span class="sig-paren">
(
</span>
<span class="sig-paren">
)
</span>
</dt>
<dd>
<p>
Handles the change of layer lock status.
</p>
</dd>
</dl>
<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>
</span>
<span class="sig-paren">
(
</span>
<span class="sig-paren">
)
</span>
</dt>
<dd>
<p>
Updates the layer’s auto-reload and outdated status based on the current state.
</p>
</dd>
</dl>
<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>
</span>
<span class="sig-paren">
(
</span>
<span class="sig-paren">
)
</span>
</dt>
<dd>
<p>
Handles the change of live session state.
</p>
</dd>
</dl>
<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>
</span>
<span class="sig-paren">
(
</span>
<span class="sig-paren">
)
</span>
</dt>
<dd>
<p>
Handles the change of muteness state.
</p>
</dd>
</dl>
<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>
</span>
<span class="sig-paren">
(
</span>
<span class="sig-paren">
)
</span>
</dt>
<dd>
<p>
Handles the change of muteness scope.
</p>
</dd>
</dl>
<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>
</span>
<span class="sig-paren">
(
</span>
<em class="sig-param">
<span class="n">
<span class="pre">
text
</span>
</span>
<span class="p">
<span class="pre">
:
</span>
</span>
<span class="w">
</span>
<span class="n">
<span class="pre">
str
</span>
</span>
</em>
<span class="sig-paren">
)
</span>
</dt>
<dd>
<p>
Applies prefiltering with the given text.
</p>
<dl class="field-list simple">
<dt class="field-odd">
Parameters
</dt>
<dd class="field-odd">
<p>
<strong>
text
</strong>
(
<em>
str
</em>
) – The text to be prefiltered.
</p>
</dd>
</dl>
</dd>
</dl>
<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>
</span>
<span class="sig-paren">
(
</span>
<span class="sig-paren">
)
</span>
</dt>
<dd>
<p>
Reload the layer of this layer item.
</p>
</dd>
</dl>
<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>
</span>
<span class="sig-paren">
(
</span>
<em class="sig-param">
<span class="n">
<span class="pre">
on_save_done
</span>
</span>
<span class="o">
<span class="pre">
=
</span>
</span>
<span class="default_value">
<span class="pre">
None
</span>
</span>
</em>
<span class="sig-paren">
)
</span>
</dt>
<dd>
<p>
Save the layer of this layer item.
</p>
<dl class="field-list simple">
<dt class="field-odd">
Parameters
</dt>
<dd class="field-odd">
<p>
<strong>
on_save_done
</strong>
(
<em>
Callable
</em>
<em>
,
</em>
<em>
optional
</em>
) – Callback function to be called when save is done.
Signature is fn(bool, str, List[str])->None. Defaults to None.
</p>
</dd>
</dl>
</dd>
</dl>
<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>
</span>
<span class="sig-paren">
(
</span>
<span class="sig-paren">
)
</span>
</dt>
<dd>
<p>
Update flags.
</p>
</dd>
</dl>
<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>
</span>
<span class="sig-paren">
(
</span>
<em class="sig-param">
<span class="n">
<span class="pre">
spec_paths
</span>
</span>
<span class="p">
<span class="pre">
:
</span>
</span>
<span class="w">
</span>
<span class="n">
<span class="pre">
List
</span>
<span class="p">
<span class="pre">
[
</span>
</span>
<span class="pre">
Union
</span>
<span class="p">
<span class="pre">
[
</span>
</span>
<span class="pre">
str
</span>
<span class="p">
<span class="pre">
,
</span>
</span>
<span class="w">
</span>
<span class="pre">
Path
</span>
<span class="p">
<span class="pre">
]
</span>
</span>
<span class="p">
<span class="pre">
]
</span>
</span>
</span>
</em>
<span class="sig-paren">
)
</span>
</dt>
<dd>
<p>
Updates the status of spec links for the provided spec paths.
</p>
<dl class="field-list simple">
<dt class="field-odd">
Parameters
</dt>
<dd class="field-odd">
<p>
<strong>
spec_paths
</strong>
(
<em>
List
</em>
<em>
[
</em>
<em>
Union
</em>
<em>
[
</em>
<em>
str
</em>
<em>
,
</em>
<em>
Sdf.Path
</em>
<em>
]
</em>
<em>
]
</em>
) – The list of spec paths to update.
</p>
</dd>
</dl>
</dd>
</dl>
<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>
</span>
<span class="sig-paren">
(
</span>
<em class="sig-param">
<span class="n">
<span class="pre">
spec_paths
</span>
</span>
<span class="p">
<span class="pre">
:
</span>
</span>
<span class="w">
</span>
<span class="n">
<span class="pre">
List
</span>
<span class="p">
<span class="pre">
[
</span>
</span>
<span class="pre">
Union
</span>
<span class="p">
<span class="pre">
[
</span>
</span>
<span class="pre">
str
</span>
<span class="p">
<span class="pre">
,
</span>
</span>
<span class="w">
</span>
<span class="pre">
Path
</span>
<span class="p">
<span class="pre">
]
</span>
</span>
<span class="p">
<span class="pre">
]
</span>
</span>
</span>
</em>
<span class="sig-paren">
)
</span>
</dt>
<dd>
<p>
Updates the status of spec locks for the provided spec paths.
</p>
<dl class="field-list simple">
<dt class="field-odd">
Parameters
</dt>
<dd class="field-odd">
<p>
<strong>
spec_paths
</strong>
(
<em>
List
</em>
<em>
[
</em>
<em>
Union
</em>
<em>
[
</em>
<em>
str
</em>
<em>
,
</em>
<em>
Sdf.Path
</em>
<em>
]
</em>
<em>
]
</em>
) – The list of spec paths to update.
</p>
</dd>
</dl>
</dd>
</dl>
<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>
<span class="w">
</span>
</em>
<span class="sig-name descname">
<span class="pre">
absolute_root_spec
</span>
</span>
</dt>
<dd>
<p>
The prim spec that represents the root of prim tree.
</p>
</dd>
</dl>
<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>
<span class="w">
</span>
</em>
<span class="sig-name descname">
<span class="pre">
add_sublayer
</span>
</span>
</dt>
<dd>
<p>
Adds a sublayer item to the layer item.
</p>
<dl class="field-list simple">
<dt class="field-odd">
Parameters
</dt>
<dd class="field-odd">
<p>
<strong>
sublayer_item
</strong>
<strong>
(
</strong>
– obj:’LayerItem’): The sublayer item to be added.
</p>
</dd>
</dl>
</dd>
</dl>
<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>
<span class="w">
</span>
</em>
<span class="sig-name descname">
<span class="pre">
anonymous
</span>
</span>
</dt>
<dd>
<p>
If this layer is anonymous layer.
</p>
</dd>
</dl>
<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>
<span class="w">
</span>
</em>
<span class="sig-name descname">
<span class="pre">
auto_reload
</span>
</span>
</dt>
<dd>
<p>
The prim spec that represents the root of prim tree.
</p>
</dd>
</dl>
- **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
</section>
</div> |
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'. |
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
</span>
</code>
(stage)
</p>
<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
</span>
</code>
</a>
(layer, name)
</p>
<p>
Sets the custom name of layer, or clear it if name is empty or None.
</p>
<p>
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
set_edit_target
</span>
</code>
(stage, layer_identifier)
</p>
<p>
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
set_layer_global_muteness
</span>
</code>
(root_layer, ...)
</p>
<p>
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
set_layer_lock_status
</span>
</code>
(root_layer, ...)
</p>
<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
</span>
</code>
</a>
(source_layer, ...[, ...])
</p>
<p>
Transfer layer content from source layer to target layer with re-pathing all external dependencies.
</p>
<p class="rubric">
Attributes
</p>
<p>
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
LAYER_AUTHORING_LAYER_CUSTOM_KEY
</span>
</code>
</p>
<p>
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
LAYER_LOCK_STATUS_CUSTOM_KEY
</span>
</code>
</p>
<p>
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
LAYER_MUTENESS_CUSTOM_KEY
</span>
</code>
</p>
<p>
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
LAYER_NAME_CUSTOM_KEY
</span>
</code>
</p>
<p>
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
LAYER_OMNI_CUSTOM_KEY
</span>
</code>
</p>
<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>
</span>
<span class="sig-paren">
(
</span>
<span class="sig-paren">
)
</span>
<a class="headerlink" href="#omni.kit.widget.layers.LayerUtils.__init__" title="Permalink to this definition">
</a>
</dt>
<dd>
</dd>
</dl>
<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>
<span class="w">
</span>
</em>
<span class="sig-name descname">
<span class="pre">
create_sublayer
</span>
</span>
<span class="sig-paren">
(
</span>
<em class="sig-param">
<span class="n">
<span class="pre">
layer
</span>
</span>
<span class="p">
<span class="pre">
:
</span>
</span>
<span class="w">
</span>
<span class="n">
<span class="pre">
Layer
</span>
</span>
</em>
,
<em class="sig-param">
<span class="n">
<span class="pre">
sublayer_position
</span>
</span>
<span class="p">
<span class="pre">
:
</span>
</span>
<span class="w">
</span>
<span class="n">
<span class="pre">
int
</span>
</span>
</em>
,
<em class="sig-param">
<span class="n">
<span class="pre">
layer_identifier
</span>
</span>
<span class="p">
<span class="pre">
:
</span>
</span>
<span class="w">
</span>
<span class="n">
<span class="pre">
str
</span>
</span>
</em>
<span class="sig-paren">
)
</span>
<a class="headerlink" href="#omni.kit.widget.layers.LayerUtils.create_sublayer" title="Permalink to this definition">
</a>
</dt>
<dd>
<p>
Creates new sublayer at specific position.
</p>
<dl class="field-list simple">
<dt class="field-odd">
Parameters
</dt>
<dd class="field-odd">
<ul class="simple">
<li>
<p>
<strong>
layer
</strong>
(<em>Sdf.Layer</em>) – Layer handle.
</p>
</li>
<li>
<p>
<strong>
sublayer_position
</strong>
– Position to create the new layer.
Position should be -1 (the last position) or above 0.
If position == -1 or position > len(layer.subLayerPaths), it will create the sublayer at the end.
Any other position will be treated as invalid index.
</p>
</li>
<li>
<p>
<strong>
layer_identifier
</strong>
– New layer path. If it’s empty or None, it will create anonymous layer.
</p>
</li>
</ul>
</dd>
</dl>
</dd>
</dl>
### 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. |
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. |
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. |
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. |
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) |
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 |
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. |
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. |
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 |
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 |
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. |
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:
```
```
```
``` |
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>
</span>
<span class="p">
<span class="pre">
:
</span>
</span>
<span class="w">
</span>
<span class="default_value">
<span class="pre">
None
</span>
</span>
</em>
,
<em class="sig-param">
<span class="n">
<span class="pre">
stop_session_only
</span>
</span>
<span class="p">
<span class="pre">
:
</span>
</span>
<span class="w">
</span>
<span class="default_value">
<span class="pre">
False
</span>
</span>
</em>
,
<em class="sig-param">
<span class="n">
<span class="pre">
stop_session_forcely
</span>
</span>
<span class="p">
<span class="pre">
:
</span>
</span>
<span class="w">
</span>
<span class="default_value">
<span class="pre">
False
</span>
</span>
</em>
,
<em class="sig-param">
<span class="n">
<span class="pre">
show_join_options
</span>
</span>
<span class="p">
<span class="pre">
:
</span>
</span>
<span class="w">
</span>
<span class="default_value">
<span class="pre">
False
</span>
</span>
</em>
,
<em class="sig-param">
<span class="n">
<span class="pre">
layer_identifier
</span>
</span>
<span class="p">
<span class="pre">
:
</span>
</span>
<span class="w">
</span>
<span class="default_value">
<span class="pre">
None
</span>
</span>
</em>
,
<em class="sig-param">
<span class="n">
<span class="pre">
quick_join
</span>
</span>
<span class="p">
<span class="pre">
:
</span>
</span>
<span class="w">
</span>
<span class="default_value">
<span class="pre">
False
</span>
</span>
</em>
,
<em class="sig-param">
<span class="n">
<span class="pre">
prim_path
</span>
</span>
<span class="p">
<span class="pre">
:
</span>
</span>
<span class="w">
</span>
<span class="default_value">
<span class="pre">
None
</span>
</span>
</em>
)
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. |
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. |
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 |
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 |
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
</code>
</p>
</td>
<td>
<p>
Get the button clicked function.
</p>
</td>
</tr>
</tbody>
</table>
<dl>
<dt>
<span>
__init__
</span>
(
<em>
<span>
name
</span>
:
<span>
str
</span>
</em>
,
<em>
<span>
on_button_clicked_fn
</span>
:
<span>
Optional
[
Callable
[
]
,
None
]
</span>
=
<span>
None
</span>
</em>
)
</dt>
<dd>
<p>
Construtor.
</p>
<dl>
<dt>
Parameters
</dt>
<dd>
<ul>
<li>
<p>
<strong>
name
</strong>
(
<em>
str
</em>
) – The button’s name.
</p>
</li>
<li>
<p>
<strong>
on_button_clicked_fn
</strong>
(
<em>
Callable
[
[
]
,
None
]
</em>
,
<em>
optional
</em>
) – Function executed when this button clicked. The function signature is:
void on_button_clicked_fn(). Defaults to None.
</p>
</li>
</ul>
</dd>
</dl>
</dd>
</dl>
<dl>
<dt>
<em>
property
</em>
<span>
name
</span>
<em>
:
<span>
str
</span>
</em>
</dt>
<dd>
<p>
Get the button’s name.
</p>
<dl>
<dt>
Returns
</dt>
<dd>
<p>
Name of the button.
</p>
</dd>
<dt>
Return type
</dt>
<dd>
<p>
str
</p>
</dd>
</dl>
</dd>
</dl>
<dl>
<dt>
<em>
property
</em>
<span>
on_button_clicked_fn
</span>
<em>
:
<span>
Callable
[
[
]
,
None
]
</span>
</em>
</dt>
<dd>
<p>
Get the button clicked function.
</p>
<dl>
<dt>
Returns
</dt>
<dd>
<p>
Function executed when this button clicked. The function signature is:
void on_button_clicked_fn()
</p>
</dd>
<dt>
Return type
</dt>
<dd>
<p>
Callable[[], None]
</p>
</dd>
</dl>
</dd>
</dl> |
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
</strong>
(
<em>
str
</em>
) – Message being posed to the user.
</p>
</li>
<li>
<p>
<strong>
(
</strong>
(
<em>
middle_2_button_info
</em>
) – obj:’PromptButtonInfo’): Information for the ok button.
</p>
</li>
<li>
<p>
<strong>
(
</strong>
– obj:’PromptButtonInfo’): Information for the last button.
</p>
</li>
<li>
<p>
<strong>
(
</strong>
– obj:’PromptButtonInfo’): Information for the middle button.
</p>
</li>
<li>
<p>
<strong>
(
</strong>
– obj:’PromptButtonInfo’): Information for the second middle button.
</p>
</li>
<li>
<p>
<strong>
on_window_closed_fn
</strong>
(
<em>
Callable
</em>
<em>
[
</em>
<em>
[
</em>
<em>
]
</em>
<em>
,
</em>
<em>
None
</em>
<em>
]
</em>
) – Function executed when the window is closed.The function signature is:
void on_button_clicked_fn(). Defaults to None.
</p>
</li>
<li>
<p>
<strong>
modal
</strong>
(
<em>
bool
</em>
) – True if the window is modal, shutting down other UI until an answer is received
</p>
</li>
<li>
<p>
<strong>
shortcut_keys
</strong>
(
<em>
bool
</em>
) – If it can be confirmed or hidden with shortcut keys like Enter or ESC. Defaults to True.
</p>
</li>
<li>
<p>
<strong>
no_title_bar
</strong>
(
<em>
bool
</em>
) – If it needs to show title bar. Defaults to True.
</p>
</li>
<li>
<p>
<strong>
width
</strong>
(
<em>
int
</em>
) – The specified width. By default, it will use the computed width.
</p>
</li>
<li>
<p>
<strong>
height
</strong>
(
<em>
int
</em>
) – The specified height. By default, it will use the computed height.
</p>
</li>
<li>
<p>
<strong>
callback_addons
</strong>
(
<em>
List
</em>
) – Addon widgets which is appended in the prompt window. By default, it is empty.
</p>
</li>
</ul>
</dd>
</dl>
</dd>
</dl>
<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>
<span class="w">
</span>
</em>
<span class="sig-name descname">
<span class="pre">
query_prompt_by_title
</span>
</span>
<span class="sig-paren">
(
</span>
<em class="sig-param">
<span class="n">
<span class="pre">
title
</span>
</span>
<span class="p">
<span class="pre">
:
</span>
</span>
<span class="w">
</span>
<span class="n">
<span class="pre">
str
</span>
</span>
</em>
<span class="sig-paren">
)
</span>
<a class="headerlink" href="#omni.kit.widget.prompt.PromptManager.query_prompt_by_title" title="Permalink to this definition">
</a>
</dt>
<dd>
<p>
Query the prompt by tiyle.
</p>
<dl class="field-list simple">
<dt class="field-odd">
Parameters
</dt>
<dd class="field-odd">
<p>
<strong>
title
</strong>
(
<em>
str
</em>
) – Prompt to query.
</p>
</dd>
<dt class="field-even">
Returns
</dt>
<dd class="field-even">
<p>
obj:’Prompt’): Prompt with the title in manager.
</p>
</dd>
<dt class="field-odd">
Return type
</dt>
<dd class="field-odd">
<p>
prompt (
</p>
</dd>
</dl>
</dd>
</dl>
<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>
<span class="w">
</span>
</em>
<span class="sig-name descname">
<span class="pre">
remove_prompt
</span>
</span>
<span class="sig-paren">
(
</span>
<em class="sig-param">
<span class="n">
<span class="pre">
prompt
</span>
</span>
<span class="p">
<span class="pre">
:
</span>
</span>
<span class="w">
</span>
<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>
</a>
</span>
</em>
<span class="sig-paren">
)
</span>
<a class="headerlink" href="#omni.kit.widget.prompt.PromptManager.remove_prompt" title="Permalink to this definition">
</a>
</dt>
<dd>
<p>
Remove the prompt from mananger.
</p>
<dl class="field-list simple">
<dt class="field-odd">
Parameters
</dt>
<dd class="field-odd">
<p>
<strong>
(
</strong>
(
<em>
prompt
</em>
) – obj:’Prompt’): Prompt to be remove.
</p>
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</section>
</div>
</div>
<footer>
<hr/>
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script> |
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. |
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. |
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 |
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. |
omni.kit.widget.settings.get_style.md | # get_style
## get_style |
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.
``` |
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. | |
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. |
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 |
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. |
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 |
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 | |
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 | |
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
</span>
</code>
(value[, update_setting])
</p>
<p>
Set given value as current selected
</p>
<p class="rubric">
Attributes
</p>
<table>
<colgroup>
<col style="width: 10%"/>
<col style="width: 90%"/>
</colgroup>
<tbody>
<tr class="row-odd">
<td>
<p>
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
items
</span>
</code>
</p>
</td>
<td>
<p>
</p>
</td>
</tr>
<tr class="row-even">
<td>
<p>
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
setting_path
</span>
</code>
</p>
</td>
<td>
<p>
</p>
</td>
</tr>
</tbody>
</table>
<dl>
<dt>
<span class="pre">
__init__
</span>
(setting_path: str)
</dt>
<dd>
<p>
RadioButtonSettingModel init function.
</p>
<dl>
<dt>
Parameters
</dt>
<dd>
<p>
<strong>
setting_path
</strong>
– Carb setting path to create a model for.
RadioButton items are specified in carb.settings “{setting_path}/items”
</p>
</dd>
</dl>
</dd>
</dl>
<dl>
<dt>
<span class="pre">
get_value
</span>
() -> str
</dt>
<dd>
<p>
Return current selected item string/label.
</p>
</dd>
</dl>
<dl>
<dt>
<span class="pre">
get_value_as_int
</span>
() -> int
</dt>
<dd>
<p>
Return current selected item idx.
</p>
</dd>
</dl>
<dl>
<dt>
<span class="pre">
set_reset_button
</span>
(button: Rectangle)
</dt>
<dd>
<p>
Set reset button from ui.Rectangle.
</p>
</dd>
</dl>
<dl>
<dt>
<span class="pre">
set_value
</span>
(value: Union[int, str], update_setting: bool = True)
</dt>
<dd>
<p>
Set given value as current selected
</p>
</dl>
### 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. |
omni.kit.widget.settings.settings_model.SettingModel.md | # SettingModel
## SettingModel
```
```markdown
class omni.kit.widget.settings.settings_model.SettingModel(setting_path: str, draggable: bool = False)
```
```markdown
Bases: AbstractValueModel
Model for simple scalar/POD carb.settings
### Methods
- **__init__(setting_path[, draggable])**
- SettingModel init function.
- **begin_edit(self)**
- Called when the user starts the editing.
- **destroy()**
- Destroy class and cleanup.
```
# omni.kit.widget.settings.settings_model.SettingModel Methods
## end_edit (self)
Called when the user finishes the editing.
## get_value ()
Get current value
## get_value_as_bool ()
Get current value as bool
## get_value_as_float ()
Get current value as float
## get_value_as_int ()
Get current value as integer
## get_value_as_string ()
Get current value as string
## set_range (min_val, max_val)
set the allowable range for the setting.
## set_reset_button (button)
Set reset button from ui.Rectangle.
## set_value (*args, **kwargs)
Overloaded function.
# Attributes
## __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?
## begin_edit (self)
### SettingModel.begin_edit
Called when the user starts the editing. If it’s a field, this method is called when the user activates the field and places the cursor inside. This method should be reimplemented.
### SettingModel.destroy
Destroy class and cleanup.
### SettingModel.end_edit
Called when the user finishes the editing. If it’s a field, this method is called when the user presses Enter or selects another field for editing. It’s useful for undo/redo. This method should be reimplemented.
### SettingModel.get_value
Get current value
### SettingModel.get_value_as_bool
Get current value as bool
### SettingModel.get_value_as_float
Get current value as float
### SettingModel.get_value_as_int
Get current value as integer
### SettingModel.get_value_as_string
Get current value as string
### SettingModel.set_range
set the allowable range for the setting. This is more restrictive than the UI min/max setting which still lets you set out of range values using the keyboard (e.g click and type in slider)
## set_reset_button
Set reset button from ui.Rectangle.
## set_value
Overloaded function.
1. set_value(self: omni.ui._ui.AbstractValueModel, value: bool) -> None
Set the value.
2. set_value(self: omni.ui._ui.AbstractValueModel, value: int) -> None
Set the value.
3. set_value(self: omni.ui._ui.AbstractValueModel, value: float) -> None
Set the value.
4. set_value(self: omni.ui._ui.AbstractValueModel, value: str) -> None
Set the value. |
omni.kit.widget.settings.settings_model.SettingsComboItemModel.md | # SettingsComboItemModel
## SettingsComboItemModel
```
```python
class omni.kit.widget.settings.settings_model.SettingsComboItemModel(setting_path, key_value_pairs: Dict[str, Any], setting_is_index: bool = True)
```
- Bases: `AbstractItemModel`
- Model for a combo box - for each setting we have a dictionary of key, values
### Methods
- `__init__(self)`
- Constructs AbstractItemModel.
- `destroy()`
- (Description not provided in the HTML snippet)
Destroy class and cleanup.
`get_item_children` ([item])
this is called by the widget when it needs the submodel items
`get_item_index` (value)
Get the item index to the given value.
`get_item_value_model` (self[, item, column_id])
Get the value model associated with this item.
`get_value` ()
Get current selected item value or index value if setting_is_index is True.
`get_value_as_int` ()
Get current selected item index :returns: (int) Current selected item index
`get_value_as_string` ()
Get current selected item label string.
`set_items` (key_value_pairs)
Set items and refresh UI.
`set_reset_button` (button)
Set reset button from ui.Rectangle.
`set_value` (value)
Set current selected to the given value
`setting_is_index`
Attributes
`__init__` (self: omni.ui._ui.AbstractItemModel) -> None
Constructs AbstractItemModel.
### Keyword Arguments:
- `kwargs` dict: See below
`class` ComboboxIndexModel
ComboboxIndexModel(combobox_model, *args, **kwargs)
Bases:
```python
SimpleIntModel
```
A custom ui.SimpleIntModel that can handle value <-> index conversion when setting values.
set_value(value, as_index=True)
Set the given index value to the model.
If the given value is not int type, it will try to find the index from the given value.
If the given value is int but as_index is False, it will still try to find the index
from the given value.
destroy()
Destroy class and cleanup.
get_item_children(item: Optional[AbstractItem] = None)
this is called by the widget when it needs the submodel items
get_item_index(value: Any) -> Optional[int]
Get the item index to the given value.
Arg:
- value (int|str|float): The value to set.
Returns
- (int|None) Item index. None if no item found.
get_item_value_model(self: omni.ui._ui.AbstractItemModel, item)
### omni.kit.widget.settings.settings_model.SettingsComboItemModel.get_item_value_model
```
```python
def get_item_value_model(item: omni.ui._ui.AbstractItem = None, column_id: int = 0) -> omni.ui._ui.AbstractValueModel:
pass
```
```markdown
Get the value model associated with this item.
### Arguments:
```
```markdown
- `item :` The item to request the value model from. If it’s null, the root value model will be returned.
- `index :` The column number to get the value model.
```
### omni.kit.widget.settings.settings_model.SettingsComboItemModel.get_value
```python
def get_value() -> Any:
pass
```
```markdown
Get current selected item value or index value if setting_is_index is True.
Returns: (int|str|float) Current selected item value or index value depends on the self._setting_is_index attribute.
```
### omni.kit.widget.settings.settings_model.SettingsComboItemModel.get_value_as_int
```python
def get_value_as_int() -> int:
pass
```
```markdown
Get current selected item index
:returns: (int) Current selected item index
```
### omni.kit.widget.settings.settings_model.SettingsComboItemModel.get_value_as_string
```python
def get_value_as_string() -> str:
pass
```
```markdown
Get current selected item label string.
Returns: (str) Current selected item label string.
```
### omni.kit.widget.settings.settings_model.SettingsComboItemModel.set_items
```python
def set_items(key_value_pairs: Dict[str, Any]) -> None:
pass
```
```markdown
Set items and refresh UI.
```
### omni.kit.widget.settings.settings_model.SettingsComboItemModel.set_reset_button
```python
def set_reset_button(button: Any) -> None:
pass
```
```markdown
Set reset button and refresh UI.
```
```markdown
### set_reset_button(Rectangle)
Set reset button from ui.Rectangle.
### set_value(value: Any) -> Optional[int]
Set current selected to the given value
**Arg:**
- value (int|str|float): The value to set.
**Returns:**
- (int|None) Item index set. None if no item found. |
omni.kit.widget.settings.settings_model.SettingsComboNameValueItem.md | # SettingsComboNameValueItem
## SettingsComboNameValueItem
```
```text
class omni.kit.widget.settings.settings_model.SettingsComboNameValueItem(label: str, value: str)
```
```text
Bases: AbstractItem
SettingsComboNameValueItem for combo boxes
```
### Methods
| Method | Description |
|--------|-------------|
| `__init__(label: str, value: str)` | SettingsComboNameValueItem init function. |
```text
__init__(label: str, value: str)
```
## SettingsComboNameValueItem init function. |
omni.kit.widget.settings.settings_model.SettingsComboValueModel.md | # SettingsComboValueModel
## SettingsComboValueModel
```python
class omni.kit.widget.settings.settings_model.SettingsComboValueModel(label: str, value: Any)
```
Bases: `AbstractValueModel`
Model to store a pair (label, value of arbitrary type) for use in a ComboBox
### Methods
```python
__init__(label, value)
```
SettingsComboValueModel init function.
```python
get_setting_value()
```
we call this to get the value of the combo box item
```python
get_value_as_string()
```
this is called to get the label of the combo box item
### Attributes
```
<colgroup>
<col style="width: 10%"/>
<col style="width: 90%"/>
</colgroup>
<tbody>
</tbody>
</table>
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.widget.settings.settings_model.SettingsComboValueModel.__init__">
<span class="sig-name descname">
<span class="pre">
__init__
</span>
</span>
<span class="sig-paren">
(
</span>
<em class="sig-param">
<span class="n">
<span class="pre">
label
</span>
</span>
<span class="p">
<span class="pre">
:
</span>
</span>
<span class="w">
</span>
<span class="n">
<span class="pre">
str
</span>
</span>
</em>
,
<em class="sig-param">
<span class="n">
<span class="pre">
value
</span>
</span>
<span class="p">
<span class="pre">
:
</span>
</span>
<span class="w">
</span>
<span class="n">
<span class="pre">
Any
</span>
</span>
</em>
<span class="sig-paren">
)
</span>
</dt>
<dd>
<p>
SettingsComboValueModel init function.
</p>
<dl class="field-list simple">
<dt class="field-odd">
Parameters
</dt>
<dd class="field-odd">
<ul class="simple">
<li>
<p>
<strong>
label
</strong>
– what appears in the UI widget
</p>
</li>
<li>
<p>
<strong>
value
</strong>
– the value corresponding to that label
</p>
</li>
</ul>
</dd>
</dl>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.widget.settings.settings_model.SettingsComboValueModel.get_setting_value">
<span class="sig-name descname">
<span class="pre">
get_setting_value
</span>
</span>
<span class="sig-paren">
(
</span>
<span class="sig-paren">
)
</span>
<span class="sig-return">
<span class="sig-return-icon">
→
</span>
<span class="sig-return-typehint">
<span class="pre">
Union
</span>
<span class="p">
<span class="pre">
[
</span>
</span>
<span class="pre">
str
</span>
<span class="p">
<span class="pre">
,
</span>
</span>
<span class="w">
</span>
<span class="pre">
int
</span>
<span class="p">
<span class="pre">
,
</span>
</span>
<span class="w">
</span>
<span class="pre">
float
</span>
<span class="p">
<span class="pre">
]
</span>
</span>
</span>
</span>
</dt>
<dd>
<p>
we call this to get the value of the combo box item
</p>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.widget.settings.settings_model.SettingsComboValueModel.get_value_as_string">
<span class="sig-name descname">
<span class="pre">
get_value_as_string
</span>
</span>
<span class="sig-paren">
(
</span>
<span class="sig-paren">
)
</span>
<span class="sig-return">
<span class="sig-return-icon">
→
</span>
<span class="sig-return-typehint">
<span class="pre">
str
</span>
</span>
</span>
</dt>
<dd>
<p>
this is called to get the label of the combo box item
</p>
</dd>
</dl>
</dd>
</dl>
</section>
</div>
</div>
<footer>
<hr/>
</footer>
</div>
</div>
</section>
</div> |
omni.kit.widget.settings.settings_model.update_reset_button.md | # update_reset_button
## update_reset_button
```python
omni.kit.widget.settings.settings_model.update_reset_button(settingModel)
```
work out whether to show the reset button highlighted or not depending on whether the setting is set to it’s default value
``` |
omni.kit.widget.settings.settings_model.VectorFloatComponentModel.md | # VectorFloatComponentModel
## VectorFloatComponentModel
```python
class omni.kit.widget.settings.settings_model.VectorFloatComponentModel(parent, vec_index, immediate_mode)
```
**Bases:** `SimpleFloatModel`
**Methods:**
- **`__init__(parent, vec_index, immediate_mode)`**
- VectorFloatComponentModel init function.
- **`get_value_as_float(self)`**
- Return the float representation of the value.
- **`set_range([min_val, max_val])`**
- Set the allowable range for the setting.
- **`set_value(*args, **kwargs)`**
- (Description not provided in the HTML)
# Attributes
## __init__
```python
__init__(parent, vec_index, immediate_mode)
```
VectorFloatComponentModel init function.
## get_value_as_float
```python
get_value_as_float(self: omni.ui._ui.AbstractValueModel) -> float
```
Return the float representation of the value.
## set_range
```python
set_range(min_val=None, max_val=None)
```
set the allowable range for the setting. This is more restrictive than the UI min/max setting which still lets you set out of range values using the keyboard (e.g click and type in slider)
## set_value
```python
set_value(*args, **kwargs)
```
Overloaded function.
1. set_value(self: omni.ui._ui.AbstractValueModel, value: bool) -> None
2. set_value(self: omni.ui._ui.AbstractValueModel, value: int) -> None
3. set_value(self: omni.ui._ui.AbstractValueModel, value: float) -> None
4. set_value(self: omni.ui._ui.AbstractValueModel, value: str) -> None
Set the value. |
omni.kit.widget.settings.settings_model.VectorFloatSettingsModel.md | # VectorFloatSettingsModel
## VectorFloatSettingsModel
```python
class omni.kit.widget.settings.settings_model.VectorFloatSettingsModel(setting_path: str, component_count: int, immediate_mode: bool = True)
```
Bases: `VectorSettingsModel`
### Methods
- `__init__(setting_path, component_count[, ...])`
- VectorSettingsModel init function.
- `end_edit(self, item)`
- (Description not provided in HTML)
| Called when the user finishes the editing.
| Return current float values tuple.
__init__(setting_path: str, component_count: int, immediate_mode: bool = True)
- VectorSettingsModel init function.
- Parameters:
- setting_path – setting_path carb setting to create a model for
- component_count – how many elements does the setting have?
- immediate_mode – do we update the underlying setting immediately, or wait for endEdit
end_edit(self: omni.ui._ui.AbstractItemModel, item: omni.ui._ui.AbstractItem) -> None
- Called when the user finishes the editing. If it’s a field, this method is called when the user presses Enter or selects another field for editing. It’s useful for undo/redo.
get_value() -> tuple
- Return current float values tuple. |
omni.kit.widget.settings.settings_model.VectorIntComponentModel.md | # VectorIntComponentModel
## Class Definition
```python
class omni.kit.widget.settings.settings_model.VectorIntComponentModel(parent, vec_index, immediate_mode)
```
Bases: `SimpleIntModel`
### Methods
| Method | Description |
|--------|-------------|
| `__init__(parent, vec_index, immediate_mode)` | VectorIntComponentModel init function. |
| `get_value_as_int(self)` | Return the int representation of the value. |
| `set_value(*args, **kwargs)` | Overloaded function. |
### Attributes
| Attribute | Description |
|-----------|-------------|
VectorIntComponentModel init function.
### get_value_as_int
```python
get_value_as_int(self: omni.ui._ui.AbstractValueModel) -> int
```
Return the int representation of the value.
### set_value
```python
set_value(*args, **kwargs)
```
Overloaded function.
1. ```python
set_value(self: omni.ui._ui.AbstractValueModel, value: bool) -> None
```
Set the value.
2. ```python
set_value(self: omni.ui._ui.AbstractValueModel, value: int) -> None
```
Set the value.
3. ```python
set_value(self: omni.ui._ui.AbstractValueModel, value: float) -> None
```
Set the value.
4. ```python
set_value(self: omni.ui._ui.AbstractValueModel, value: str) -> None
```
Set the value.
``` |
omni.kit.widget.settings.settings_model.VectorIntSettingsModel.md | # VectorIntSettingsModel
## VectorIntSettingsModel
```python
class omni.kit.widget.settings.settings_model.VectorIntSettingsModel(setting_path: str, component_count: int, immediate_mode: bool = True)
```
Bases: `VectorSettingsModel`
### Methods
| Method | Description |
|--------|-------------|
| `__init__(setting_path, component_count[, ...])` | VectorSettingsModel init function. |
| `end_edit(self, item)` | Called when the user finishes the editing. |
```
<table>
<tbody>
<tr class="row-odd">
<td>
<p>
<code>get_value</code>
()
</p>
</td>
<td>
<p>Return current int values tuple.</p>
</td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.widget.settings.settings_model.VectorIntSettingsModel.__init__">
<span class="sig-name descname">
<span class="pre">__init__</span>
</span>
<span class="sig-paren">(</span>
<em class="sig-param">
<span class="n">setting_path</span>
<span class="p">:</span>
<span class="n">str</span>
</em>
,
<em class="sig-param">
<span class="n">component_count</span>
<span class="p">:</span>
<span class="n">int</span>
</em>
,
<em class="sig-param">
<span class="n">immediate_mode</span>
<span class="p">:</span>
<span class="n">bool</span>
<span class="o">=</span>
<span class="default_value">True</span>
</em>
<span class="sig-paren">)</span>
</dt>
<dd>
<p>VectorSettingsModel init function.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd">
<ul class="simple">
<li>
<p><strong>setting_path</strong> – setting_path carb setting to create a model for</p>
</li>
<li>
<p><strong>component_count</strong> – how many elements does the setting have?</p>
</li>
<li>
<p><strong>immediate_mode</strong> – do we update the underlying setting immediately, or wait for endEdit</p>
</li>
</ul>
</dd>
</dl>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.widget.settings.settings_model.VectorIntSettingsModel.end_edit">
<span class="sig-name descname">
<span class="pre">end_edit</span>
</span>
<span class="sig-paren">(</span>
<em class="sig-param">
<span class="n">self</span>
<span class="p">:</span>
<span class="n">omni.ui._ui.AbstractItemModel</span>
</em>
,
<em class="sig-param">
<span class="n">item</span>
<span class="p">:</span>
<span class="n">omni.ui._ui.AbstractItem</span>
</em>
<span class="sig-paren">)</span>
<span class="sig-return">
<span class="sig-return-icon">→</span>
<span class="sig-return-typehint">
<span class="pre">None</span>
</span>
</span>
</dt>
<dd>
<p>Called when the user finishes the editing. If it’s a field, this method is called when the user presses Enter or selects another field for editing. It’s useful for undo/redo.</p>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.widget.settings.settings_model.VectorIntSettingsModel.get_value">
<span class="sig-name descname">
<span class="pre">get_value</span>
</span>
<span class="sig-paren">()</span>
<span class="sig-return">
<span class="sig-return-icon">→</span>
<span class="sig-return-typehint">
<span class="pre">tuple</span>
</span>
</span>
</dt>
<dd>
<p>Return current int values tuple.</p>
</dd>
</dl> |
omni.kit.widget.settings.settings_model.VectorSettingsModel.md | # VectorSettingsModel
## VectorSettingsModel
```python
class omni.kit.widget.settings.settings_model.VectorSettingsModel(setting_path: str, component_count: int, item_class: AbstractItemModel, immediate_mode: bool)
```
Bases: `AbstractItemModel`
Model For Color, Vec3 and other multi-component settings. Assumption is the items are draggable, so we only store a command when the dragging has completed.
TODO: Needs testing with component_count = 2,4
### Methods
| Method | Description |
|--------|-------------|
| `__init__(setting_path, component_count, ...)` | VectorSettingsModel init function. |
| `begin_edit()` | |
| Method Name | Description |
|-------------|-------------|
| destroy() | Destroy class and cleanup. |
| end_edit(self, item) | Called when the user finishes the editing. |
| get_item_children([item]) | This is called by the widget when it needs the submodel items. |
| get_item_value_model([sub_model_item, column_id]) | This is called by the widget when it needs the submodel item models. |
| set_reset_button(button) | Set reset button from ui.Rectangle. |
| set_value(values) | Set list of values to the model. |
### __init__(setting_path: str, component_count: int, item_class: AbstractItemModel, immediate_mode: bool)
VectorSettingsModel init function.
**Parameters:**
- **setting_path** – setting_path carb setting to create a model for
- **component_count** – how many elements does the setting have?
- **immediate_mode** – do we update the underlying setting immediately, or wait for endEdit
### begin_edit(item: AbstractItem)
Stub: need implementation to prevent crashes.
### destroy
Destroy class and cleanup.
### end_edit
Called when the user finishes the editing. If it’s a field, this method is called when the user presses Enter or selects another field for editing. It’s useful for undo/redo.
### get_item_children
this is called by the widget when it needs the submodel items
### get_item_value_model
This is called by the widget when it needs the submodel item models. (to then get or set them)
### set_reset_button
Set reset button from ui.Rectangle.
### set_value
### set_value(
Union[
tuple,
list
]
)
Set list of values to the model. |
omni.kit.widget.settings.settings_widget.Classes.md | # omni.kit.widget.settings.settings_widget Classes
## Classes Summary
| Class | Description |
|-------|-------------|
| [SettingType](#settingtype) | Supported setting types for create_setting_widget. |
| [SettingWidgetType](#settingwidgettype) | Supported setting UI widget types |
| [SettingsSearchableCombo](#settingssearchablecombo) | Searchable combo box, needs omni.kit.widget.searchable_combobox extensions |
### 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 |
omni.kit.widget.settings.settings_widget.create_setting_widget.md | # create_setting_widget
## create_setting_widget
```
```python
omni.kit.widget.settings.settings_widget.create_setting_widget(setting_path: str, setting_type: SettingType, range_from=0, range_to=0, speed=1, **kwargs) -> Tuple[Widget, AbstractValueModel]
```
```
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`
```code
module,
using
:class:`.ChangeSettingCommand
```
### Parameters
- **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
A `ui.Widget` and `ui.AbstractValueModel` connected with the setting on the path specified. |
omni.kit.widget.settings.settings_widget.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
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 |
omni.kit.widget.settings.settings_widget.Functions.md | # omni.kit.widget.settings.settings_widget Functions
## Functions Summary
- **create_setting_widget**
- Create a UI widget connected with a setting.
- **create_setting_widget_combo**
- Create a Combo Setting widget. |
omni.kit.widget.settings.settings_widget.md | # omni.kit.widget.settings.settings_widget
## 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.
## Functions Summary
- **create_setting_widget**
- Create a UI widget connected with a setting.
- **create_setting_widget_combo**
- Create a Combo Setting widget. |
omni.kit.widget.settings.settings_widget.SettingsSearchableCombo.md | # SettingsSearchableCombo
## Class: omni.kit.widget.settings.settings_widget.SettingsSearchableCombo
**Bases:** `object`
Searchable combo box, needs omni.kit.widget.searchable_combobox extensions
### Methods
- **`__init__(setting_path: str, key_value_pairs: dict, default_key: str)`**
- **`destroy()`**
- Destroy class and cleanup.
- **`get_current_key()`**
| Method Name | Description |
|-------------|-------------|
| get_key_from_value(value) | Gets key from value. |
| get_current_key() | Gets current key selected in combo box. |
| destroy() | Destroy class and cleanup. |
| __init__(setting_path: str, key_value_pairs: dict, default_key: str) | Initialize the class with setting path, key-value pairs, and default key. | |
omni.kit.widget.settings.settings_widget.SettingType.md | # SettingType
## SettingType
```python
class omni.kit.widget.settings.settings_widget.SettingType(value)
```
Bases: `Enum`
Supported setting types for create_setting_widget.
### Attributes
| Attribute | Description |
|-----------|-------------|
| `FLOAT` | Setting is a floating-point number. |
| `INT` | Setting is a integer number. |
| `COLOR3` | Setting is a three color floating-point numbers (0.0-1.0). |
| `BOOL` | Setting is a boolean. |
| `STRING` | Setting is a string. |
```
| Setting Type | Description |
|--------------|-------------|
| `DOUBLE3` | Setting is a three double-precision floating-point numbers. |
| `INT2` | Setting is a two integer numbers. |
| `DOUBLE2` | Setting is a two double-precision floating-point numbers. |
| `ASSET` | Setting is a asset path. |
### omni.kit.widget.settings.settings_widget.SettingType.__init__
```python
__init__()
```
### omni.kit.widget.settings.settings_widget.SettingType.ASSET
```python
ASSET = 8
```
Setting is a asset path.
### omni.kit.widget.settings.settings_widget.SettingType.BOOL
```python
BOOL = 3
```
Setting is a boolean.
### omni.kit.widget.settings.settings_widget.SettingType.COLOR3
```python
COLOR3 = 2
```
Setting is a three color floating-point numbers (0.0-1.0).
### omni.kit.widget.settings.settings_widget.SettingType.DOUBLE2
```python
DOUBLE2 = 7
```
Setting is a two double-precision floating-point numbers.
### omni.kit.widget.settings.settings_widget.SettingType.DOUBLE3
```python
DOUBLE3 = 5
```
Setting is a three double-precision floating-point numbers.
### omni.kit.widget.settings.settings_widget.SettingType.FLOAT
```python
FLOAT = 0
```
Setting is a floating-point number.
### omni.kit.widget.settings.settings_widget.SettingType.INT
```python
INT = 1
```
Setting is a integer number.
<dl class="py attribute">
<dt class="sig sig-object py" id="omni.kit.widget.settings.settings_widget.SettingType.INT">
<span class="sig-name descname">
<span class="pre">
INT
</span>
</span>
<em class="property">
<span class="w">
</span>
<span class="p">
<span class="pre">
=
</span>
</span>
<span class="w">
</span>
<span class="pre">
5
</span>
</em>
</dt>
<dd>
<p>
Setting is a integer number.
</p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="omni.kit.widget.settings.settings_widget.SettingType.INT2">
<span class="sig-name descname">
<span class="pre">
INT2
</span>
</span>
<em class="property">
<span class="w">
</span>
<span class="p">
<span class="pre">
=
</span>
</span>
<span class="w">
</span>
<span class="pre">
6
</span>
</em>
</dt>
<dd>
<p>
Setting is a two integer numbers.
</p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="omni.kit.widget.settings.settings_widget.SettingType.STRING">
<span class="sig-name descname">
<span class="pre">
STRING
</span>
</span>
<em class="property">
<span class="w">
</span>
<span class="p">
<span class="pre">
=
</span>
</span>
<span class="w">
</span>
<span class="pre">
4
</span>
</em>
</dt>
<dd>
<p>
Setting is a string.
</p>
</dd>
</dl> |
omni.kit.widget.settings.settings_widget.SettingWidgetType.md | # SettingWidgetType
## SettingWidgetType
```
```markdown
class omni.kit.widget.settings.settings_widget.SettingWidgetType(value)
```
```markdown
Bases: Enum
```
```markdown
Supported setting UI widget types
```
```markdown
Attributes
```
```markdown
FLOAT
```
```markdown
Setting is a floating-point number.
```
```markdown
INT
```
```markdown
Setting is a integer number.
```
```markdown
COLOR3
```
```markdown
Setting is a three color floating-point numbers (0.0-1.0).
```
```markdown
BOOL
```
```markdown
Setting is a boolean.
```
```markdown
STRING
```
```markdown
Setting is a string.
| Setting Type | Description |
| --- | --- |
| `DOUBLE3` | Setting is a three double-precision floating-point numbers. |
| `INT2` | Setting is a two integer numbers. |
| `DOUBLE2` | Setting is a two double-precision floating-point numbers. |
| `ASSET` | Setting is a asset path. |
| `COMBOBOX` | Setting is Combo box. |
| `RADIOBUTTON` | Setting is Radio buttons. |
| `VECTOR3` | Setting is Vector3. |
### SettingWidgetType.__init__()
### SettingWidgetType.ASSET = 8
Setting is a asset path.
### SettingWidgetType.BOOL = 3
Setting is a boolean.
### SettingWidgetType.COLOR3 = 2
Setting is a three color floating-point numbers (0.0-1.0).
### SettingWidgetType.COMBOBOX = 9
Setting is Combo box.
### SettingWidgetType.DOUBLE2 = 7
Setting is a two double-precision floating-point numbers.
<dl class="py attribute">
<dt class="sig sig-object py" id="omni.kit.widget.settings.settings_widget.SettingWidgetType.DOUBLE2">
<span class="sig-name descname">
<span class="pre">DOUBLE2</span>
</span>
<em class="property">
<span class="w"></span>
<span class="p">
<span class="pre">=</span>
</span>
<span class="w"></span>
<span class="pre">7</span>
</em>
<a class="headerlink" href="#omni.kit.widget.settings.settings_widget.SettingWidgetType.DOUBLE2" title="Permalink to this definition"></a>
</dt>
<dd>
<p>Setting is a two double-precision floating-point numbers.</p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="omni.kit.widget.settings.settings_widget.SettingWidgetType.DOUBLE3">
<span class="sig-name descname">
<span class="pre">DOUBLE3</span>
</span>
<em class="property">
<span class="w"></span>
<span class="p">
<span class="pre">=</span>
</span>
<span class="w"></span>
<span class="pre">5</span>
</em>
<a class="headerlink" href="#omni.kit.widget.settings.settings_widget.SettingWidgetType.DOUBLE3" title="Permalink to this definition"></a>
</dt>
<dd>
<p>Setting is a three double-precision floating-point numbers.</p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="omni.kit.widget.settings.settings_widget.SettingWidgetType.FLOAT">
<span class="sig-name descname">
<span class="pre">FLOAT</span>
</span>
<em class="property">
<span class="w"></span>
<span class="p">
<span class="pre">=</span>
</span>
<span class="w"></span>
<span class="pre">0</span>
</em>
<a class="headerlink" href="#omni.kit.widget.settings.settings_widget.SettingWidgetType.FLOAT" title="Permalink to this definition"></a>
</dt>
<dd>
<p>Setting is a floating-point number.</p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="omni.kit.widget.settings.settings_widget.SettingWidgetType.INT">
<span class="sig-name descname">
<span class="pre">INT</span>
</span>
<em class="property">
<span class="w"></span>
<span class="p">
<span class="pre">=</span>
</span>
<span class="w"></span>
<span class="pre">1</span>
</em>
<a class="headerlink" href="#omni.kit.widget.settings.settings_widget.SettingWidgetType.INT" title="Permalink to this definition"></a>
</dt>
<dd>
<p>Setting is a integer number.</p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="omni.kit.widget.settings.settings_widget.SettingWidgetType.INT2">
<span class="sig-name descname">
<span class="pre">INT2</span>
</span>
<em class="property">
<span class="w"></span>
<span class="p">
<span class="pre">=</span>
</span>
<span class="w"></span>
<span class="pre">6</span>
</em>
<a class="headerlink" href="#omni.kit.widget.settings.settings_widget.SettingWidgetType.INT2" title="Permalink to this definition"></a>
</dt>
<dd>
<p>Setting is a two integer numbers.</p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="omni.kit.widget.settings.settings_widget.SettingWidgetType.RADIOBUTTON">
<span class="sig-name descname">
<span class="pre">RADIOBUTTON</span>
</span>
<em class="property">
<span class="w"></span>
<span class="p">
<span class="pre">=</span>
</span>
<span class="w"></span>
<span class="pre">10</span>
</em>
<a class="headerlink" href="#omni.kit.widget.settings.settings_widget.SettingWidgetType.RADIOBUTTON" title="Permalink to this definition"></a>
</dt>
<dd>
<p>Setting is Radio buttons.</p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="omni.kit.widget.settings.settings_widget.SettingWidgetType.STRING">
<span class="sig-name descname">
<span class="pre">STRING</span>
</span>
<em class="property">
<span class="w"></span>
<span class="p">
<span class="pre">=</span>
</span>
<span class="w"></span>
<span class="pre">4</span>
</em>
<a class="headerlink" href="#omni.kit.widget.settings.settings_widget.SettingWidgetType.STRING" title="Permalink to this definition"></a>
</dt>
<dd>
<p>Setting is a string.</p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="omni.kit.widget.settings.settings_widget.SettingWidgetType.VECTOR3">
<span class="sig-name descname">
<span class="pre">VECTOR3</span>
</span>
<em class="property">
<span class="w"></span>
<span class="p">
<span class="pre">=</span>
</span>
<span class="w"></span>
<span class="pre">11</span>
</em>
<a class="headerlink" href="#omni.kit.widget.settings.settings_widget.SettingWidgetType.VECTOR3" title="Permalink to this definition"></a>
</dt>
<dd>
<p>Setting is Vector3.</p>
</dd>
</dl> |
omni.kit.widget.settings.settings_widget_builder.AssetPicker.md | # AssetPicker
## AssetPicker Class
```python
class omni.kit.widget.settings.settings_widget_builder.AssetPicker(model)
```
**Bases:** `object`
AssetPicker class.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(model)` | AssetPicker init function. |
| `build_ui([additional_widget_kwargs])` | Build UI for asset picker. |
| `get_icon_path()` | Get icon path for extension |
| `on_show_dialog(model, item_filter_options)` | Browse button clicked function. |
### AssetPicker Methods
#### `__init__(model)`
AssetPicker init function.
#### `build_ui(additional_widget_kwargs=None)`
Build UI for asset picker.
#### `get_icon_path()`
Get icon path for extension
#### `on_show_dialog(model, item_filter_options)`
Browse button clicked function. |
omni.kit.widget.settings.settings_widget_builder.Classes.md | # omni.kit.widget.settings.settings_widget_builder Classes
## Classes Summary
- **AssetPicker**
- [AssetPicker class.](omni.kit.widget.settings.settings_widget_builder/omni.kit.widget.settings.settings_widget_builder.AssetPicker.html)
- **SettingsWidgetBuilder**
- [Widget builder functions.](omni.kit.widget.settings.settings_widget_builder/omni.kit.widget.settings.settings_widget_builder.SettingsWidgetBuilder.html) |
omni.kit.widget.settings.settings_widget_builder.md | # omni.kit.widget.settings.settings_widget_builder
## Classes Summary:
| Class Name | Description |
|------------|-------------|
| [AssetPicker](omni.kit.widget.settings.settings_widget_builder/omni.kit.widget.settings.settings_widget_builder.AssetPicker.html) | AssetPicker class. |
| [SettingsWidgetBuilder](omni.kit.widget.settings.settings_widget_builder/omni.kit.widget.settings.settings_widget_builder.SettingsWidgetBuilder.html) | Widget builder functions. | |
omni.kit.widget.settings.settings_widget_builder.SettingsWidgetBuilder.md | # SettingsWidgetBuilder
## SettingsWidgetBuilder
```python
class omni.kit.widget.settings.settings_widget_builder.SettingsWidgetBuilder
```
Widget builder functions.
### Methods
| Method | Description |
|--------|-------------|
| `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. |
```
| Method Name | Description |
|-------------|-------------|
| `createDoubleArrayWidget(model, range_min, ...)` | Create a widget for multiple double-precision floating-point numbers. |
| `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
```python
classmethod
createColorWidget(model, comp_count=3, additional_widget_kwargs=None) -> HStack
```
Create a three color floating-point widget.
### createComboboxWidget
```python
classmethod
createComboboxWidget(setting_path: str, items: Optional[Union[list, dict]] = None, setting_is_index: Optional[bool] = None, additional_widget_kwargs: Optional[dict] = None) -> Tuple[SettingsComboItemModel, ComboBox]
```
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.
```
- **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
```
```markdown
- **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
```
```markdown
- **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
```
```markdown
- **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
```
```markdown
- **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
```
```markdown
- **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
```
```markdown
- **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
```
```markdown
- **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
```
```markdown
- **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
```
```markdown
- **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
```
```markdown
- **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
```
```markdown
- **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
```
```markdown
- **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
```
```markdown
- **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
```
```markdown
- **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
```
```markdown
- **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
```
```markdown
- **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
```
```markdown
- **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
```
```markdown
- **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
```
```markdown
- **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
```
```markdown
- **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
```
```markdown
- **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
```
```markdown
- **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
```
```markdown
- **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
```
```markdown
- **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
```
```markdown
- **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
```
```markdown
- **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
```
```markdown
- **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
```
```markdown
- **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
```
### SettingsWidgetBuilder.createIntWidget
```python
classmethod createIntWidget(model: IntSettingModel, setting_path: str = '', range_min: int, range_max: int, additional_widget_kwargs: Optional[dict] = None) -> IntWidget
```
Create a integer widget.
### SettingsWidgetBuilder.createRadiobuttonWidget
```python
classmethod createRadiobuttonWidget(model: RadioButtonSettingModel, setting_path: str = '', additional_widget_kwargs: Optional[dict] = None) -> RadioCollection
```
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)
### SettingsWidgetBuilder.createVecWidget
```python
classmethod createVecWidget(model, range_min: int, range_max: int, comp_count: int = 3, additional_widget_kwargs: Optional[dict] = None)
```
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 |
omni.kit.widget.settings.SettingType.md | # SettingType
## SettingType
### omni.kit.widget.settings.SettingType
#### class SettingType(value)
Bases: Enum
Supported setting types for create_setting_widget.
### Attributes
| Attribute | Description |
|-----------|-------------|
| FLOAT | Setting is a floating-point number. |
| INT | Setting is a integer number. |
| COLOR3 | Setting is a three color floating-point numbers (0.0-1.0). |
| BOOL | Setting is a boolean. |
| STRING | Setting is a string. |
| DOUBLE3 | Setting is a three double-precision floating-point numbers. |
<p>
INT2
</p>
<p>
Setting is a two integer numbers.
</p>
<p>
DOUBLE2
</p>
<p>
Setting is a two double-precision floating-point numbers.
</p>
<p>
ASSET
</p>
<p>
Setting is a asset path.
</p>
<p>
__init__()
</p>
<p>
ASSET = 8
</p>
<p>
Setting is a asset path.
</p>
<p>
BOOL = 3
</p>
<p>
Setting is a boolean.
</p>
<p>
COLOR3 = 2
</p>
<p>
Setting is a three color floating-point numbers (0.0-1.0).
</p>
<p>
DOUBLE2 = 7
</p>
<p>
Setting is a two double-precision floating-point numbers.
</p>
<p>
DOUBLE3 = 5
</p>
<p>
Setting is a three double-precision floating-point numbers.
</p>
<p>
FLOAT = 0
</p>
<p>
Setting is a floating-point number.
</p>
<p>
INT = 1
</p>
<p>
Setting is a integer number.
</p>
<p>
INT2 = 6
</p>
<p>
Setting is a two integer numbers.
</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="omni.kit.widget.settings.SettingType.INTEGER">
<span class="sig-name descname">
<span class="pre">
INTEGER
</span>
</span>
<em class="property">
<span class="w">
</span>
<span class="p">
<span class="pre">
=
</span>
</span>
<span class="w">
</span>
<span class="pre">
3
</span>
</em>
<a class="headerlink" href="#omni.kit.widget.settings.SettingType.INTEGER" title="Permalink to this definition">
</a>
</dt>
<dd>
<p>
Setting is a two integer numbers.
</p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="omni.kit.widget.settings.SettingType.STRING">
<span class="sig-name descname">
<span class="pre">
STRING
</span>
</span>
<em class="property">
<span class="w">
</span>
<span class="p">
<span class="pre">
=
</span>
</span>
<span class="w">
</span>
<span class="pre">
4
</span>
</em>
<a class="headerlink" href="#omni.kit.widget.settings.SettingType.STRING" title="Permalink to this definition">
</a>
</dt>
<dd>
<p>
Setting is a string.
</p>
</dd>
</dl> |
omni.kit.widget.settings.SettingWidgetType.md | # SettingWidgetType
## SettingWidgetType
- **Bases:** `Enum`
- **Description:** Supported setting UI widget types
### Attributes
| Attribute | Description |
|-----------|-------------|
| `FLOAT` | Setting is a floating-point number. |
| `INT` | Setting is a integer number. |
| `COLOR3` | Setting is a three color floating-point numbers (0.0-1.0). |
| `BOOL` | Setting is a boolean. |
| `STRING` | Setting is a string. |
| `DOUBLE3` | Setting is a double precision vector of three numbers. |
| Setting Type | Description |
|--------------|-------------|
| `INT2` | Setting is a two integer numbers. |
| `DOUBLE2` | Setting is a two double-precision floating-point numbers. |
| `ASSET` | Setting is a asset path. |
| `COMBOBOX` | Setting is Combo box. |
| `RADIOBUTTON`| Setting is Radio buttons. |
| `VECTOR3` | Setting is Vector3. |
### SettingWidgetType Methods
#### `__init__()`
### SettingWidgetType Attributes
#### `ASSET`
Setting is a asset path.
#### `BOOL`
Setting is a boolean.
#### `COLOR3`
Setting is a three color floating-point numbers (0.0-1.0).
#### `COMBOBOX`
Setting is Combo box.
#### `DOUBLE2`
Setting is a two double-precision floating-point numbers.
#### `DOUBLE3`
Setting is a three double-precision floating-point numbers.
<dl class="py attribute">
<dt class="sig sig-object py" id="omni.kit.widget.settings.SettingWidgetType.DOUBLE3">
<span class="sig-name descname">
<span class="pre">
DOUBLE3
</span>
</span>
<em class="property">
<span class="w">
</span>
<span class="p">
<span class="pre">
=
</span>
</span>
<span class="w">
</span>
<span class="pre">
5
</span>
</em>
</dt>
<dd>
<p>
Setting is a three double-precision floating-point numbers.
</p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="omni.kit.widget.settings.SettingWidgetType.FLOAT">
<span class="sig-name descname">
<span class="pre">
FLOAT
</span>
</span>
<em class="property">
<span class="w">
</span>
<span class="p">
<span class="pre">
=
</span>
</span>
<span class="w">
</span>
<span class="pre">
0
</span>
</em>
</dt>
<dd>
<p>
Setting is a floating-point number.
</p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="omni.kit.widget.settings.SettingWidgetType.INT">
<span class="sig-name descname">
<span class="pre">
INT
</span>
</span>
<em class="property">
<span class="w">
</span>
<span class="p">
<span class="pre">
=
</span>
</span>
<span class="w">
</span>
<span class="pre">
1
</span>
</em>
</dt>
<dd>
<p>
Setting is a integer number.
</p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="omni.kit.widget.settings.SettingWidgetType.INT2">
<span class="sig-name descname">
<span class="pre">
INT2
</span>
</span>
<em class="property">
<span class="w">
</span>
<span class="p">
<span class="pre">
=
</span>
</span>
<span class="w">
</span>
<span class="pre">
6
</span>
</em>
</dt>
<dd>
<p>
Setting is a two integer numbers.
</p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="omni.kit.widget.settings.SettingWidgetType.RADIOBUTTON">
<span class="sig-name descname">
<span class="pre">
RADIOBUTTON
</span>
</span>
<em class="property">
<span class="w">
</span>
<span class="p">
<span class="pre">
=
</span>
</span>
<span class="w">
</span>
<span class="pre">
10
</span>
</em>
</dt>
<dd>
<p>
Setting is Radio buttons.
</p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="omni.kit.widget.settings.SettingWidgetType.STRING">
<span class="sig-name descname">
<span class="pre">
STRING
</span>
</span>
<em class="property">
<span class="w">
</span>
<span class="p">
<span class="pre">
=
</span>
</span>
<span class="w">
</span>
<span class="pre">
4
</span>
</em>
</dt>
<dd>
<p>
Setting is a string.
</p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="omni.kit.widget.settings.SettingWidgetType.VECTOR3">
<span class="sig-name descname">
<span class="pre">
VECTOR3
</span>
</span>
<em class="property">
<span class="w">
</span>
<span class="p">
<span class="pre">
=
</span>
</span>
<span class="w">
</span>
<span class="pre">
11
</span>
</em>
</dt>
<dd>
<p>
Setting is Vector3.
</p>
</dd>
</dl> |
omni.kit.widget.settings.style.Functions.md | # omni.kit.widget.settings.style Functions
## Functions Summary:
| Function | Description |
|----------|-------------|
| get_style | Get default style. |
| get_ui_style_name | Gets which light/dark theme kit is using. Not widely supported. | |
omni.kit.widget.settings.style.get_style.md | # get_style
## get_style
Get default style. |
omni.kit.widget.settings.Submodules.md | # omni.kit.widget.settings Submodules
## Submodules Summary
- **omni.kit.widget.settings.settings_model**
- Source for SettingModel, RadioButtonSettingModel, AssetPathSettingsModel, VectorFloatComponentModel, VectorIntComponentModel, VectorSettingsModel, VectorFloatSettingsModel, VectorIntSettingsModel, SettingsComboValueModel, SettingsComboNameValueItem, SettingsComboItemModel.
- **omni.kit.widget.settings.settings_widget**
- Source for SettingType, SettingWidgetType, SettingsSearchableCombo, create_setting_widget, create_setting_widget_combo.
- **omni.kit.widget.settings.settings_widget_builder**
- Source for SettingsWidgetBuilder, AssetPicker.
- **omni.kit.widget.settings.style**
- Source for get_ui_style_name, get_style. |
omni.kit.widget.toolbar.Classes.md | # omni.kit.widget.toolbar Classes
## Classes Summary
- **Hotkey**
- A helper class to add hotkey to a Toolbar widget.
- **SimpleToolButton**
- A helper class to create simple WidgetGroup that contains only one ToolButton.
- **Toolbar**
- Main Toolbar class.
- **WidgetGroup**
- Base class to create a group of widgets on Toolbar |
omni.kit.widget.toolbar.Functions.md | # omni.kit.widget.toolbar Functions
## Functions Summary
| Function | Description |
|----------|-------------|
| get_instance | Get the instance of the toolbar. | |
omni.kit.widget.toolbar.get_instance.md | # get_instance
## get_instance
```python
omni.kit.widget.toolbar.get_instance()
```
- **Returns**: `Toolbar`
- **Description**: Get the instance of the toolbar.
``` |
omni.kit.widget.toolbar.Hotkey.md | # Hotkey
## Hotkey
```python
class omni.kit.widget.toolbar.Hotkey:
def __init__(self, action_name: str, hotkey: KeyboardInput, on_action_fn: Callable[[], None], hotkey_enabled_fn: Callable[[], bool], modifiers: int = 0, on_hotkey_changed_fn: Optional[Callable[[], None]] = None):
pass
```
```
Bases:
```python
object
```
A helper class to add hotkey to a Toolbar widget.
Hotkey registers an Action with `omni.kit.actions.core` and assigns a hotkey using `omni.kit.hotkeys.core`. If `omni.kit.hotkeys.core` is not enabled, hotkey will not be in effect.
### Methods
| Method | Description |
| --- | --- |
| `__init__(action_name, hotkey, on_action_fn, ...)` | Initialize a Hotkey object. |
| `clean()` | Cleanup function to be called before Hotkey object is destroyed. |
| `get_as_string(default)` | Gets the string representation of the hotkey combo. |
#### `__init__(action_name: str, hotkey: KeyboardInput, on_action_fn: Callable[[], None], hotkey_enabled_fn: Callable[[], bool], modifiers: int = 0, on_hotkey_changed_fn: Optional[Callable[[], None]] = None)`
Initialize a Hotkey object.
Initialize a Hotkey object.
### Parameters
- **action_name** (str) – The Action name associated with the hotkey. It needs to be unique.
- **hotkey** (carb.input.KeyboardInput) – The keyboard key binding.
- **on_action_fn** (Callable[[], None]) – Callback function to be called when Action is triggered.
- **hotkey_enabled_fn** (Callable[[bool], None]) – Predicate callback function to be called when Action is triggered, but before `on_action_fn` to determine if it should be called.
- **modifiers** (int) – Modifier of the hotkey.
- **on_hotkey_changed_fn** (Callable[[str], None]) – Callback function when Hotkey is reassigned by external system such as `omni.kit.hotkeys.window`. The parameter will be the new key combo.
### clean()
Cleanup function to be called before Hotkey object is destroyed.
### get_as_string(default: str) -> str
Gets the string representation of the hotkey combo. Useful as tooltip. |
omni.kit.widget.toolbar.md | # omni.kit.widget.toolbar
## Classes Summary:
- **Hotkey**
- A helper class to add hotkey to a Toolbar widget.
- **SimpleToolButton**
- A helper class to create simple WidgetGroup that contains only one ToolButton.
- **Toolbar**
- Main Toolbar class.
- **WidgetGroup**
- Base class to create a group of widgets on Toolbar
## Functions Summary:
- **get_instance**
- Get the instance of the toolbar. |
omni.kit.widget.toolbar.SimpleToolButton.md | # SimpleToolButton
## SimpleToolButton
```
```markdown
class omni.kit.widget.toolbar.SimpleToolButton(name, tooltip, icon_path, icon_checked_path, hotkey=None, toggled_fn=None, model=None, additional_style=None)
```
```markdown
Bases: `WidgetGroup`
A helper class to create simple WidgetGroup that contains only one ToolButton.
### Parameters
- **name** – Name of the ToolButton.
- **tooltip** – Tooltip of the ToolButton.
- **icon_path** – The icon to be used when button is not checked.
- **icon_checked_path** – The icon to be used when button is checked.
- **hotkey** – HotKey to toggle the button (optional).
- **toggled_fn** – Callback function when button is toggled. Signature: on_toggled(checked) (optional).
## Attributes
- **name** – Name for the ToolButton (required).
- **tooltip** – Tooltip text for the ToolButton (optional).
- **icon_path** – Path to the icon file for the ToolButton (required).
- **icon_checked_path** – Path to the icon file when the ToolButton is checked (optional).
- **hotkey** – Hotkey for the ToolButton (optional).
- **toggled_fn** – Function to call when the ToolButton is toggled (optional).
- **model** – Model for the ToolButton (optional).
- **additional_style** – Additional styling to apply to the ToolButton (optional).
## Methods
### `__init__(name, tooltip, icon_path, [...])`
- Initializes the SimpleToolButton.
### `clean()`
- Clean up function to be called before destroying the object.
### `create(default_size)`
- Main function to create the widget.
### `get_style()`
- Gets the style of all widgets defined in this Widgets group.
### `get_tool_button()`
- (No description provided)
---
title: "Example Document"
author: "John Doe"
date: "2023-01-01"
---
# Introduction
This is an example document.
## Section 1
Here is some content.
## Section 2
More content here.
### Subsection 2.1
Even more detailed content.
### Subsection 2.2
Additional details.
## Section 3
Final section of the document.
### Subsection 3.1
Last bit of content.
### Subsection 3.2
Closing thoughts.
---
This is the end of the document. |
omni.kit.widget.toolbar.Toolbar.md | # Toolbar
## omni.kit.widget.toolbar.Toolbar
Main Toolbar class.
### Methods
- `__init__()`
- `acquire_toolbar_context(context)`
- Request toolbar to switch to given context.
- `add_custom_move_type(entry_name, move_type)`
- `add_custom_select_type(entry_name, ...)`
- `add_widget(widget_group, priority[, context])`
- Adds a WidgetGroup instance to the Toolbar.
- `destroy()`
- `get_context()`
- Gets the current context of the Toolbar.
- `get_widget()`
| Method | Description |
|--------|-------------|
| `get_widget(name)` | Gets a ui.Widget item by its name. |
| `rebuild_toolbar([root_frame])` | |
| `release_toolbar_context(token)` | Request toolbar to release context associated with token. |
| `remove_custom_move(entry_name)` | |
| `remove_custom_select(entry_name)` | |
| `remove_widget(widget_group)` | Removes a WidgetGroup instance from the Toolbar. |
| `set_axis(axis)` | Sets the axis direction of the Toolbar |
| `subscribe_grab_mouse_pressed(function)` | |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `DEFAULT_CONTEXT` | |
| `DEFAULT_CONTEXT_TOKEN` | |
| `DEFAULT_SIZE` | |
| `WINDOW_NAME` | |
| `context_menu` | |
### Methods
#### `__init__()`
#### `acquire_toolbar_context(context: str)`
Request toolbar to switch to given context. It takes the context preemptively even if previous context owner has not release the context.
**Parameters:**
- **context** (str) – Context to switch to.
**Returns:**
A token to be used to release_toolbar_context
#### `add_widget(widget_group: WidgetGroup)`
### omni.kit.widget.toolbar.Toolbar.add_widget
```python
add_widget(widget_group: WidgetGroup, priority: int, context: str = '')
```
Adds a WidgetGroup instance to the Toolbar.
#### Parameters
- **widget_group** (WidgetGroup) – The WidgetGroup instance to be added to the Toolbar.
- **priority** (int) – priority of the WidgetGroup. With a smaller number the WidgetGroup will be shown on Toolbar first.
- **context** (str) – A context the WidgetGroup is associated with.
### omni.kit.widget.toolbar.Toolbar.get_context
```python
get_context()
```
Gets the current context of the Toolbar.
### omni.kit.widget.toolbar.Toolbar.get_widget
```python
get_widget(name: str) -> Widget
```
Gets a ui.Widget item by its name.
#### Parameters
- **name** (str) – The name of widget to fetch.
#### Returns
The ui.Widget associated with such name. None if not found.
### omni.kit.widget.toolbar.Toolbar.release_toolbar_context
```python
release_toolbar_context(token: int)
```
Request toolbar to release context associated with token. If token is expired (already released or context ownership taken by others), this function does nothing.
#### Parameters
- **token** (int) – Context token to release.
### omni.kit.widget.toolbar.Toolbar.remove_widget
```python
remove_widget(widget_group: WidgetGroup)
```
Removes a WidgetGroup instance from the Toolbar.
#### Parameters
- **widget_group** (WidgetGroup) – The WidgetGroup instance to be removed from the Toolbar.
## WidgetGroup
(WidgetGroup) – The WidgetGroup instance to be removed from the Toolbar.
## set_axis
```python
set_axis(axis: ToolBarAxis)
```
Sets the axis direction of the Toolbar
### Parameters
- **axis** (ui.ToolBarAxis) –
``` |
omni.kit.widget.toolbar.WidgetGroup.md | # WidgetGroup
## WidgetGroup
Base class to create a group of widgets on Toolbar
### Methods
- `__init__()`
- `clean()`
- Clean up function to be called before destroying the object.
- `create(default_size)`
- Main function to creates widget.
- `get_style()`
- Gets the style of all widgets defined in this Widgets group.
- `on_added(context)`
- Called when widget is added to toolbar when calling Toolbar.add_widget
- `on_removed()`
- Called when widget is removed from toolbar when calling Toolbar.remove_widget
(context)
Called when toolbar's effective context has changed.
__init__()
clean()
Clean up function to be called before destroying the object.
create(default_size) -> dict[str, omni.ui._ui.Widget]
Main function to creates widget.
If you want to export widgets and allow external code to fetch and manipulate them, return a Dict[str, Widget] mapping from name to instance at the end of the function.
get_style() -> dict
Gets the style of all widgets defined in this Widgets group.
on_added(context)
Called when widget is added to toolbar when calling Toolbar.add_widget
Parameters
----------
context – the context used to add widget when calling Toolbar.add_widget.
on_removed()
Called when widget is removed from toolbar when calling Toolbar.remove_widget
on_toolbar_context_changed(context: str)
Called when toolbar’s effective context has changed.
Parameters
----------
context – new toolbar context. |
omni.kit.widget.viewport.Classes.md | # omni.kit.widget.viewport Classes
## Classes Summary:
| Class | Description |
|-------|-------------|
| [ViewportWidget](#) | A low level omni.ui.Widget for displaying rendered output. | |
omni.kit.widget.viewport.md | # omni.kit.widget.viewport
## Classes Summary:
- **ViewportWidget**
- A low level omni.ui.Widget for displaying rendered output. |
omni.kit.widget.viewport.ViewportWidget.md | # ViewportWidget
## ViewportWidget
[Union[ViewportAPI, str]] = None,
hydra_engine_options: Optional[dict] = None,
*ui_args,
**ui_kwargs)
Bases: object
A low level omni.ui.Widget for displaying rendered output.
### Methods
- `__init__(usd_context_name, camera_path, ...)` - ViewportWidget constructor
- `destroy()` - Called by extension before destroying this object.
- `get_instances()` - Return an iterable object to enumerate all known ViewportWidget instances
- `set_resolution(resolution)`
### Attributes
- `display_delegate`
- `expand_viewport` - Whether the ui object containing the Viewport texture expands one dimension of resolution to cover the full ui size
- `fill_frame` - Whether the ui object containing the Viewport texture expands both dimensions of resolution based on the ui size
- `full_resolution` - Return the resolution being requested (not accounting for any % down-scaling
- `name` - Return the name of the ViewportWidget
- `resolution`
| Property | Description |
|----------|-------------|
| `resolution` | Return the resolution that the renderer is providing images at. |
| `resolution_uses_dpi` | Whether to account for DPI when driving the Viewport texture resolution |
| `usd_context_name` | Return the name of the USdContext this instance is attached to |
| `viewport_api` | Return the active omni.kit.widget.viewport.ViewportAPI for the ViewportWidget |
| `visible` | Set the visibility of this ViewportWidget |
### `__init__`
- `usd_context_name` (str, default: '')
- `camera_path` (Optional[str], default: None)
- `resolution` (Optional[tuple], default: None)
- `hd_engine` (Optional[str], default: None)
- `viewport_api` (Optional[Union[ViewportAPI, str]], default: None)
### ViewportWidget constructor
#### Parameters
- **usd_context_name** (`str`) – The name of a UsdContext this Viewport will be viewing.
- **camera_path** (`str`) – The path to a UsdGeom.Camera to render with.
- **resolution** – (x,y): The size of the backing texture that is rendered into (or 'fill_frame' to lock to UI size).
- **viewport_api** – (`ViewportAPI`, `str`) A ViewportAPI instance that users have access to via `.viewport_api` property or a unique string id used to create a default ViewportAPI instance.
### destroy()
Called by extension before destroying this object. It doesn’t happen automatically. Without this hot reloading doesn’t work.
### classmethod get_instances()
Return an iterable object to enumerate all known ViewportWidget instances
### property expand_viewport: bool
Whether the ui object containing the Viewport texture expands one dimension of resolution to cover the full ui size
### property fill_frame: bool
Whether the ui object containing the Viewport texture expands both dimensions of resolution based on the ui size
### property full_resolution
Return the resolution being requested (not accounting for any % down-scaling
### property name
Return the name of the ViewportWidget
### property resolution
<em>
<span class="sig-name descname">
<span class="pre">
resolution
</span>
</span>
<em class="property">
<span class="p">
<span class="pre">
:
</span>
</span>
<span class="w">
</span>
<span class="pre">
Tuple
</span>
<span class="p">
<span class="pre">
[
</span>
</span>
<span class="pre">
float
</span>
<span class="p">
<span class="pre">
,
</span>
</span>
<span class="w">
</span>
<span class="pre">
float
</span>
<span class="p">
<span class="pre">
]
</span>
</span>
</em>
</dt>
<dd>
<p>
Return the resolution that the renderer is providing images at.
</p>
</dd>
</dl>
<dl class="py property">
<dt class="sig sig-object py" id="omni.kit.widget.viewport.ViewportWidget.resolution_uses_dpi">
<em class="property">
<span class="pre">
property
</span>
<span class="w">
</span>
</em>
<span class="sig-name descname">
<span class="pre">
resolution_uses_dpi
</span>
</span>
<em class="property">
<span class="p">
<span class="pre">
:
</span>
</span>
<span class="w">
</span>
<span class="pre">
bool
</span>
</em>
</dt>
<dd>
<p>
Whether to account for DPI when driving the Viewport texture resolution
</p>
</dd>
</dl>
<dl class="py property">
<dt class="sig sig-object py" id="omni.kit.widget.viewport.ViewportWidget.usd_context_name">
<em class="property">
<span class="pre">
property
</span>
<span class="w">
</span>
</em>
<span class="sig-name descname">
<span class="pre">
usd_context_name
</span>
</span>
<em class="property">
<span class="p">
<span class="pre">
:
</span>
</span>
<span class="w">
</span>
<span class="pre">
str
</span>
</em>
</dt>
<dd>
<p>
Return the name of the USdContext this instance is attached to
</p>
</dd>
</dl>
<dl class="py property">
<dt class="sig sig-object py" id="omni.kit.widget.viewport.ViewportWidget.viewport_api">
<em class="property">
<span class="pre">
property
</span>
<span class="w">
</span>
</em>
<span class="sig-name descname">
<span class="pre">
viewport_api
</span>
</span>
</dt>
<dd>
<p>
Return the active omni.kit.widget.viewport.ViewportAPI for the ViewportWidget
</p>
</dd>
</dl>
<dl class="py property">
<dt class="sig sig-object py" id="omni.kit.widget.viewport.ViewportWidget.visible">
<em class="property">
<span class="pre">
property
</span>
<span class="w">
</span>
</em>
<span class="sig-name descname">
<span class="pre">
visible
</span>
</span>
</dt>
<dd>
<p>
Set the visibility of this ViewportWidget
</p>
</dd>
</dl>
</dd>
</dl>
</section>
</div>
</div>
<footer>
<hr/>
</footer>
</div>
</div>
</section>
</div> |
omni.kit.widget.viewport.ViewportWidget_omni.kit.widget.viewport.ViewportWidget.md | # ViewportWidget
## ViewportWidget
[Union[ViewportAPI, str]] = None,
hydra_engine_options: Optional[dict] = None,
*ui_args,
**ui_kwargs
)
Bases:
```
```
object
```
A low level omni.ui.Widget for displaying rendered output.
### Methods
| Method | Description |
| --- | --- |
| `__init__(usd_context_name, camera_path, ...)` | ViewportWidget constructor |
| `destroy()` | Called by extension before destroying this object. |
| `get_instances()` | Return an iterable object to enumerate all known ViewportWidget instances |
| `set_resolution(resolution)` | |
### Attributes
| Attribute | Description |
| --- | --- |
| `display_delegate` | |
| `expand_viewport` | Whether the ui object containing the Viewport texture expands one dimension of resolution to cover the full ui size |
| `fill_frame` | Whether the ui object containing the Viewport texture expands both dimensions of resolution based on the ui size |
| `full_resolution` | Return the resolution being requested (not accounting for any % down-scaling |
| `name` | Return the name of the ViewportWidget |
| `resolution` | |
```
| Property | Description |
|----------|-------------|
| `resolution` | Return the resolution that the renderer is providing images at. |
| `resolution_uses_dpi` | Whether to account for DPI when driving the Viewport texture resolution |
| `usd_context_name` | Return the name of the USdContext this instance is attached to |
| `viewport_api` | Return the active omni.kit.widget.viewport.ViewportAPI for the ViewportWidget |
| `visible` | Set the visibility of this ViewportWidget |
### `__init__(usd_context_name: str = '', camera_path: Optional[str] = None, resolution: Optional[tuple] = None, hd_engine: Optional[str] = None, viewport_api: Optional[Union[ViewportAPI, str]] = None)`
- `usd_context_name`: The name of the USD context. Default is an empty string.
- `camera_path`: The path to the camera. Default is None.
- `resolution`: The resolution settings. Default is None.
- `hd_engine`: The hardware description engine. Default is None.
- `viewport_api`: The viewport API. Default is None.
### ViewportWidget Constructor
ViewportWidget constructor
#### Parameters
- **usd_context_name** (str) – The name of a UsdContext this Viewport will be viewing.
- **camera_path** (str) – The path to a UsdGeom.Camera to render with.
- **resolution** – (x,y): The size of the backing texture that is rendered into (or ‘fill_frame’ to lock to UI size).
- **viewport_api** – (ViewportAPI, str) A ViewportAPI instance that users have access to via .viewport_api property or a unique string id used to create a default ViewportAPI instance.
### ViewportWidget.destroy()
Called by extension before destroying this object. It doesn’t happen automatically. Without this hot reloading doesn’t work.
### ViewportWidget.get_instances()
Return an iterable object to enumerate all known ViewportWidget instances
### ViewportWidget.expand_viewport
: bool
Whether the ui object containing the Viewport texture expands one dimension of resolution to cover the full ui size
### ViewportWidget.fill_frame
: bool
Whether the ui object containing the Viewport texture expands both dimensions of resolution based on the ui size
### ViewportWidget.full_resolution
Return the resolution being requested (not accounting for any % down-scaling
### ViewportWidget.name
Return the name of the ViewportWidget
### ViewportWidget.resolution
: property
### resolution
: Tuple[float, float]
Return the resolution that the renderer is providing images at.
### resolution_uses_dpi
: bool
Whether to account for DPI when driving the Viewport texture resolution
### usd_context_name
: str
Return the name of the USdContext this instance is attached to
### viewport_api
Return the active omni.kit.widget.viewport.ViewportAPI for the ViewportWidget
### visible
Set the visibility of this ViewportWidget |
omni.kit.window.content_browser.Classes.md | # omni.kit.window.content_browser Classes
## Classes Summary:
- **ContentBrowserExtension**
- The Content Browser extension |
omni.kit.window.content_browser.ContentBrowserExtension.md | # ContentBrowserExtension
## ContentBrowserExtension
The Content Browser extension
### Methods
- `__init__(self)`
- `add_checkpoint_menu(name, glyph, click_fn, ...)`
- Add menu item, with corresponding callbacks, to checkpoint items.
- `add_collection_data(collection_data)`
- `add_connections(connections)`
- Adds specified server connections to the tree browser.
- `add_context_menu(name, glyph, click_fn, show_fn)`
- Add menu item, with corresponding callbacks, to the context menu.
- `add_file_open_handler(name, open_fn, file_type)`
Registers callback/handler to open a file of matching type.
- `add_import_menu(name, glyph, click_fn, show_fn)`
Add menu item, with corresponding callbacks, to the Import combo box.
- `add_listview_menu(name, glyph, click_fn, show_fn)`
Add menu item, with corresponding callbacks, to the list view menu.
- `decorate_from_registry(event)`
- `delete_checkpoint_menu(name)`
Delete the menu item, with the given name, from context menu of checkpoint item.
- `delete_context_menu(name)`
Delete the menu item, with the given name, from the context menu.
- `delete_file_open_handler(name)`
Unregisters the named file open handler.
- `delete_import_menu(name)`
Delete the menu item, with the given name, from the Import combo box.
- `delete_listview_menu(name)`
Delete the menu item, with the given name, from the list view menu.
- `get_checkpoint_widget()`
Returns the checkpoint widget
- `get_current_directory()`
Returns the current directory from the browser bar.
- `get_current_selections([pane])`
Returns current selected as list of system path names.
- `get_file_open_handler(url)`
Returns the matching file open handler for the given file path.
- `get_timestamp_widget()`
Returns the timestamp widget
- `navigate_to` (url)
- Navigates to the given url, expanding all parent directories along the path.
- `navigate_to_async` (url)
- Asynchronously navigates to the given url, expanding all parent directories along the path.
- `on_shutdown` ()
- `on_startup` (ext_id)
- `refresh_current_directory` ()
- Refreshes the current directory set in the browser bar.
- `remove_collection_data` (collection_id)
- `select_items_async` (url[, filenames])
- Asynchronously selects display items by their names.
- `set_current_directory` (path)
- Procedurally sets the current directory path.
- `set_search_delegate` (delegate)
- Sets a custom search delegate for the tool bar.
- `show_model` (model)
- Displays the given model in the list view, overriding the default model.
- `show_window` (menu, value)
- Shows this window.
- `subscribe_selection_changed` (fn)
- Subscribes to file selection changes.
- `toggle_bookmark_from_path` (name, path, ...[, ...])
- Adds/deletes the given bookmark with the specified path.
- `toggle_grid_view` (show_grid_view)
- Toggles file picker between grid and list view.
- `unset_search_delegate` (delegate)
Clears the custom search delegate for the tool bar.
Unsubscribes this callback from selection changes.
Unsubscribes this callback from selection changes.
Attributes
| MENU_GROUP |
|------------|
| WINDOW_NAME |
|-------------|
| api |
|----|
| window |
|-------|
Main dialog window for this extension.
__init__(self: omni.ext._extensions.IExt) -> None
add_checkpoint_menu(name: str, glyph: str, click_fn: Callable, show_fn: Callable, index: int = -1) -> str
Add menu item, with corresponding callbacks, to checkpoint items.
Parameters
* name (str) – Name of the menu item, this name must be unique across the menu.
* glyph (str) – Associated glyph to display for this menu item.
* click_fn (Callable) – This callback function is executed when the menu item is clicked. Function signature: void fn(name: str, path: str), where name is menu name and path is absolute path to clicked item.
* show_fn (Callable) – Returns True to display this menu item. Function signature: bool fn(path: str). For example, test filename extension to decide whether to display a ‘Play Sound’ action.
### add_context_menu
```python
add_context_menu(name: str, glyph: str, click_fn: Callable, show_fn: Callable, index: int = 0, separator_name: str = '_add_on_end_separator_') -> str
```
Add menu item, with corresponding callbacks, to the context menu.
#### Parameters
- **name** (str) – Name of the menu item (e.g. ‘Open’), this name must be unique across the context menu.
- **glyph** (str) – Associated glyph to display for this menu item.
- **click_fn** (Callable) – This callback function is executed when the menu item is clicked. Function signature is void fn(name: str, path: str), where name is menu name and path is absolute path to clicked item.
- **show_fn** (Callable) – Returns True to display this menu item. Function signature - bool fn(path: str). For example, test filename extension to decide whether to display a ‘Play Sound’ action.
- **index** (int) – The position that this menu item will be inserted to.
- **separator_name** (str) – The separator name of the separator menu item. Default to ‘_placeholder_’. When the index is not explicitly set, or if the index is out of range, this will be used to locate where to add the menu item; if specified, the index passed in will be counted from the separator with the provided name.
```
### add_connections
```python
add_connections(connections: dict)
```
Adds specified server connections to the tree browser.
#### Parameters
- **connections** (dict) – A dictionary of name, path pairs. For example: {"C:": "C:", "ov-content": "omniverse://ov-content"}. Paths to Omniverse servers should be prefixed with “omniverse://”.
```
### add_menu_item
```python
add_menu_item(name: str, glyph: str, click_fn: Callable, show_fn: Callable, index: int = 0, separator_name: str = '_add_on_end_separator_') -> str
```
Adds a menu item with associated callbacks to the context menu.
#### Parameters
- **name** (str) – Name of the menu item (e.g. ‘Open’), this name must be unique across the context menu.
- **glyph** (str) – Associated glyph to display for this menu item.
- **click_fn** (Callable) – This callback function is executed when the menu item is clicked. Function signature is void fn(name: str, path: str), where name is menu name and path is absolute path to clicked item.
- **show_fn** (Callable) – Returns True to display this menu item. Function signature - bool fn(path: str). For example, test filename extension to decide whether to display a ‘Play Sound’ action.
- **index** (int) – The position that this menu item will be inserted to.
- **separator_name** (str) – The separator name of the separator menu item. Default to ‘_placeholder_’. When the index is not explicitly set, or if the index is out of range, this will be used to locate where to add the menu item; if specified, the index passed in will be counted from the separator with the provided name.
```
## ContentBrowserExtension Methods
### add_file_open_handler
Registers callback/handler to open a file of matching type.
**Parameters:**
- **name** (str) – Unique name of handler.
- **open_fn** (Callable) – This function is executed when a matching file is selected for open, i.e. double clicked, right mouse menu open, or path submitted to browser bar. Function signature: `void open_fn(full_path: str)`, full_path is the file’s system path.
- **file_type** (Union[int, Callable]) – Can either be an enumerated int that is one of: [FILE_TYPE_USD, FILE_TYPE_IMAGE, FILE_TYPE_SOUND, FILE_TYPE_TEXT, FILE_TYPE_VOLUME] or a more general boolean function that returns True if this function should be activated on the given file. Function signature: `bool file_type(full_path: str)`.
**Returns:**
- str - Name if successful, None otherwise.
### add_import_menu
Add menu item, with corresponding callbacks, to the Import combo box.
**Parameters:**
- **name** (str) – Name of the menu item, this name must be unique across the menu.
- **glyph** (str) – Description of glyph parameter.
- **click_fn** (Callable) – Description of click_fn parameter.
- **show_fn** (Callable) – Description of show_fn parameter.
**Returns:**
- str - Name if successful, None otherwise.
### add_listview_menu
```python
add_listview_menu(name: str, glyph: str, click_fn: Callable, show_fn: Callable, index: int = -1) -> str
```
Add menu item, with corresponding callbacks, to the list view menu.
#### Parameters
- **name** (str) – Name of the menu item (e.g. ‘Open’), this name must be unique across the list view menu.
- **glyph** (str) – Associated glyph to display for this menu item.
- **click_fn** (Callable) – This callback function is executed when the menu item is clicked. Function signature: void fn(name: str, path: str), where name is menu name and path is absolute path to clicked item.
- **show_fn** (Callable) – Returns True to display this menu item. Function signature: bool fn(path: str). For example, test filename extension to decide whether to display a ‘Play Sound’ action.
- **index** (int) – The position that this menu item will be inserted to.
#### Returns
- Name of menu item if successful, None otherwise.
#### Return type
- str
### delete_checkpoint_menu
```python
delete_checkpoint_menu(name: str)
```
Delete the menu item, with the given name, from context menu of checkpoint item.
#### Parameters
- **name** (str) – Name of the menu item.
### delete_context_menu
- **Parameters**
- **name** (str) – Name of the menu item (e.g. ‘Open’).
### delete_file_open_handler
- **Parameters**
- **name** (str) – Name of the handler.
### delete_import_menu
- **Parameters**
- **name** (str) – Name of the menu item.
### delete_listview_menu
- **Parameters**
- **name** (str) – Name of the menu item (e.g. 'Open').
### get_checkpoint_widget
- **Returns**
- CheckpointWidget
### get_current_directory
- **Returns**
- str
### get_current_selections
Returns current selected as list of system path names.
**Parameters**
- **pane** (int) – Specifies pane to retrieve selections from, one of {TREEVIEW_PANE = 1, LISTVIEW_PANE = 2, BOTH = None}. Default LISTVIEW_PANE.
**Returns**
- List of system paths (which may be different from displayed paths, e.g. bookmarks)
**Return type**
- List[str]
### get_file_open_handler
Returns the matching file open handler for the given file path.
**Parameters**
- **url** (str) – The url of the file to open.
### get_timestamp_widget
Returns the timestamp widget
### navigate_to
Navigates to the given url, expanding all parent directories along the path.
**Parameters**
- **url** (str) – The path to navigate to.
### navigate_to_async
Navigates to the given url asynchronously, expanding all parent directories along the path.
**Parameters**
- **url** (str) – The path to navigate to.
<dl>
<dt>
<p>
Asynchronously navigates to the given url, expanding all parent directories along the path.
</p>
<dl class="field-list simple">
<dt class="field-odd">
Parameters
</dt>
<dd class="field-odd">
<p>
<strong>
url
</strong>
(
<em>
str
</em>
) – The url to navigate to.
</p>
</dd>
</dl>
</dt>
<dd>
<p>
Refreshes the current directory set in the browser bar.
</p>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.window.content_browser.ContentBrowserExtension.select_items_async">
<em class="property">
<span class="pre">
async
</span>
<span class="w">
</span>
</em>
<span class="sig-name descname">
<span class="pre">
select_items_async
</span>
</span>
<span class="sig-paren">
(
</span>
<em class="sig-param">
<span class="n">
<span class="pre">
url
</span>
</span>
<span class="p">
<span class="pre">
:
</span>
</span>
<span class="w">
</span>
<span class="n">
<span class="pre">
str
</span>
</span>
</em>
,
<em class="sig-param">
<span class="n">
<span class="pre">
filenames
</span>
</span>
<span class="p">
<span class="pre">
:
</span>
</span>
<span class="w">
</span>
<span class="n">
<span class="pre">
List
</span>
<span class="p">
<span class="pre">
[
</span>
</span>
<span class="pre">
str
</span>
<span class="p">
<span class="pre">
]
</span>
</span>
</span>
<span class="w">
</span>
<span class="o">
<span class="pre">
=
</span>
</span>
<span class="w">
</span>
<span class="default_value">
<span class="pre">
[]
</span>
</span>
</em>
<span class="sig-paren">
)
</span>
<span class="sig-return">
<span class="sig-return-icon">
→
</span>
<span class="sig-return-typehint">
<span class="pre">
List
</span>
<span class="p">
<span class="pre">
[
</span>
</span>
<span class="pre">
FileBrowserItem
</span>
<span class="p">
<span class="pre">
]
</span>
</span>
</span>
</span>
</dt>
<dd>
<p>
Asynchronously selects display items by their names.
</p>
<dl class="field-list simple">
<dt class="field-odd">
Parameters
</dt>
<dd class="field-odd">
<ul class="simple">
<li>
<p>
<strong>
url
</strong>
(
<em>
str
</em>
) – Url of the parent folder.
</p>
</li>
<li>
<p>
<strong>
filenames
</strong>
(
<em>
str
</em>
) – Names of items to select.
</p>
</li>
</ul>
</dd>
<dt class="field-even">
Returns
</dt>
<dd class="field-even">
<p>
List of selected items.
</p>
</dd>
<dt class="field-odd">
Return type
</dt>
<dd class="field-odd">
<p>
List[FileBrowserItem]
</p>
</dd>
</dl>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.window.content_browser.ContentBrowserExtension.set_current_directory">
<span class="sig-name descname">
<span class="pre">
set_current_directory
</span>
</span>
<span class="sig-paren">
(
</span>
<em class="sig-param">
<span class="n">
<span class="pre">
path
</span>
</span>
<span class="p">
<span class="pre">
:
</span>
</span>
<span class="w">
</span>
<span class="n">
<span class="pre">
str
</span>
</span>
</em>
<span class="sig-paren">
)
</span>
</dt>
<dd>
<p>
Procedurally sets the current directory path.
</p>
<dl class="field-list simple">
<dt class="field-odd">
Parameters
</dt>
<dd class="field-odd">
<p>
<strong>
path
</strong>
(
<em>
str
</em>
) – The full path name of the folder, e.g. “omniverse://ov-content/Users/me.
</p>
</dd>
<dt class="field-even">
Raises
</dt>
<dd class="field-even">
<p>
<strong>
RuntimeWarning
</strong>
– If path doesn’t exist or is unreachable.
</p>
</dd>
</dl>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.window.content_browser.ContentBrowserExtension.set_search_delegate">
<span class="sig-name descname">
<span class="pre">
set_search_delegate
</span>
</span>
<span class="sig-paren">
(
</span>
<em class="sig-param">
<span class="n">
<span class="pre">
delegate
</span>
</span>
<span class="p">
<span class="pre">
:
</span>
</span>
<span class="w">
</span>
<span class="n">
<span class="pre">
SearchDelegate
</span>
</span>
</em>
<span class="sig-paren">
)
</span>
</dt>
<dd>
<p>
Sets a custom search delegate for the tool bar.
</p>
<dl class="field-list simple">
<dt class="field-odd">
Parameters
</dt>
<dd class="field-odd">
<p>
<strong>
delegate
</strong>
(
<em>
SearchDelegate
</em>
</p>
</dd>
</dl>
</dd>
</dl>
## Methods
### show_model
```python
show_model(model: FileBrowserModel)
```
Displays the given model in the list view, overriding the default model. For example, this model might be the result of a search.
**Parameters**
- **model** (`FileBrowserModel`) – Model to display.
### show_window
```python
show_window(menu, value)
```
Shows this window. Inputs are for backwards compatibility only and not used.
### subscribe_selection_changed
```python
subscribe_selection_changed(fn: Callable)
```
Subscribes to file selection changes.
**Parameters**
- **fn** (`Callable`) – callback function when file selection changed.
### toggle_bookmark_from_path
```python
toggle_bookmark_from_path(name: str, path: str, is_bookmark: bool, is_folder: bool = True) -> bool
```
Adds/deletes the given bookmark with the specified path. If deleting, then the path argument is optional.
**Parameters**
- **name** (`str`) – Name to call the bookmark or existing name if delete.
- **path** (`str`) – Path to the bookmark.
- **is_bookmark** (`bool`) – True to add, False to delete.
- **is_folder** (`bool`) – Whether the item to be bookmarked is a folder.
## Returns
- True if successful.
## Return type
- bool
## toggle_grid_view
- Toggles file picker between grid and list view.
- **Parameters**
- **show_grid_view** (bool) – True to show grid view, False to show list view.
## unset_search_delegate
- Clears the custom search delegate for the tool bar.
- **Parameters**
- **delegate** (SearchDelegate) – Object that creates the search widget.
## unsubscribe_selection_changed
- Unsubscribes this callback from selection changes.
- **Parameters**
- **fn** (Callable) – callback function when file selection changed.
## window
- Main dialog window for this extension.
- **Type**
- ui.Window |
omni.kit.window.content_browser.Functions.md | # omni.kit.window.content_browser Functions
## Functions Summary:
| Function | Description |
|----------|-------------|
| `get_content_window` | Returns the singleton content_browser extension instance | |
omni.kit.window.content_browser.get_content_window.md | # get_content_window
## get_content_window
|
omni.kit.window.content_browser.md | # omni.kit.window.content_browser
## Classes Summary
- **ContentBrowserExtension**
- The Content Browser extension
## Functions Summary
- **get_content_window**
- Returns the singleton content_browser extension instance |
omni.kit.window.file.add_reference.md | # add_reference
## add_reference
```python
omni.kit.window.file.add_reference(is_payload=False)
```
Prompt for the file to add reference or payload to.
### Keyword Arguments
- **is_payload** (bool) – True to add payload instead of reference.
``` |
omni.kit.window.file.Classes.md | # omni.kit.window.file Classes
## Classes Summary:
| Class | Description |
|-------|-------------|
| DialogOptions | Enum for dialog options. |
| FileWindowExtension | File window extension interface. |
| Prompt | A pop up window in context manager style to perform operations when inside the context. |
| ReadOnlyOptionsWindow | Prompt window class to show when opening a read only file. |
| StageSaveDialog | Dialog class for saving stage. | |
omni.kit.window.file.close.md | # close
## close
Check if current stage is dirty. If it’s dirty, it will ask if to save the file, then close stage.
### Keyword Arguments
- **on_closed** (`Callable`) – function to call after closing, Function Signature: `on_closed() -> None` |
omni.kit.window.file.DialogOptions.md | # DialogOptions
## DialogOptions
```python
class omni.kit.window.file.DialogOptions(value)
```
Bases: `Enum`
Enum for dialog options.
### Attributes
| Attribute | Description |
|-----------|-------------|
| `NONE` | Show dialog using is-required logic |
| `FORCE` | Force dialog to show and ignore is-required logic |
| `HIDE` | Never show dialog |
```python
def __init__(self):
pass
```
```python
FORCE = (1,)
```
Force dialog to show and ignore is-required logic
```python
HIDE = ()
```
Never show dialog
<em class="property">
<span class="w">
</span>
<span class="p">
<span class="pre">
=
</span>
</span>
<span class="w">
</span>
<span class="pre">
(2,)
</span>
</em>
</dt>
<dd>
<p>
Never show dialog
</p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="omni.kit.window.file.DialogOptions.NONE">
<span class="sig-name descname">
<span class="pre">
NONE
</span>
</span>
<em class="property">
<span class="w">
</span>
<span class="p">
<span class="pre">
=
</span>
</span>
<span class="w">
</span>
<span class="pre">
(0,)
</span>
</em>
</dt>
<dd>
<p>
Show dialog using is-required logic
</p>
</dd>
</dl>
</dd>
</dl>
</section>
</div>
</div>
<footer>
<hr/>
</footer>
</div>
</div>
</section>
</div> |
Subsets and Splits