file_path
stringlengths 5
148
| content
stringlengths 150
498k
| size
int64 150
498k
|
---|---|---|
omni.syntheticdata.dataclass.md | # dataclass
## dataclass
```python
omni.syntheticdata.dataclass(cls=None, /, *, init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False, match_args=True, kw_only=False, slots=False)
```
This function is a part of the `omni.syntheticdata` module and is used to define a data class with various parameters controlling its behavior.
```
Returns the same class as was passed in, with dunder methods added based on the fields defined in the class.
Examines PEP 526 __annotations__ to determine fields.
If init is true, an __init__() method is added to the class. If repr is true, a __repr__() method is added. If order is true, rich comparison dunder methods are added. If unsafe_hash is true, a __hash__() method function is added. If frozen is true, fields may not be assigned to after instance creation. If match_args is true, the __match_args__ tuple is added. If kw_only is true, then by default all fields are keyword-only. If slots is true, an __slots__ attribute is added. | 999 |
omni.syntheticdata.Extension.md | # Extension
## omni.syntheticdata.Extension
Bases: `IExt`
### Methods
- `__init__(self)`
- `get_instance()`
- `get_name()`
- `on_shutdown()`
- `on_startup(ext_id)`
#### `__init__(self)`
- Returns: `None` | 208 |
omni.syntheticdata.field.md | # field
## field
Return an object to identify dataclass fields.
default is the default value of the field. default_factory is a
0-argument function called to initialize a field’s value. If init
is true, the field will be a parameter to the class’s __init__()
function. If repr is true, the field will be included in the
object’s repr(). If hash is true, the field will be included in the
object’s hash(). If compare is true, the field will be used in
comparison functions. metadata, if specified, must be a mapping
which is stored but not otherwise examined by dataclass. If kw_only
is true, the field will become a keyword-only parameter to
__init__().
It is an error to specify both default and default_factory. | 722 |
omni.syntheticdata.Functions.md | # omni.syntheticdata Functions
## Functions Summary:
- **dataclass**
- Returns the same class as was passed in, with dunder methods
- **field**
- Return an object to identify dataclass fields. | 198 |
omni.syntheticdata.md | # omni.syntheticdata
## Submodules
Summary:
| Submodule | Description |
|-----------|-------------|
| omni.syntheticdata.ogn | No submodule docstring provided |
| omni.syntheticdata.scripts | No submodule docstring provided |
## Classes
Summary:
| Class | Description |
|-------|-------------|
| Extension | |
| SyntheticData | |
| SyntheticDataException | Common base class for all non-exit exceptions. |
| SyntheticDataStage | |
## Functions
Summary:
| Function | Description |
|----------|-------------|
| dataclass | Returns the same class as was passed in, with dunder methods |
| field | Return an object to identify dataclass fields. | | 651 |
omni.syntheticdata.ogn.md | # omni.syntheticdata.ogn
## Navigation
- [Omniverse Kit](https://docs.omniverse.nvidia.com/kit/docs) »
- [API (python)](API.html) »
- [Modules](Modules.html) »
- [omni.syntheticdata](omni.syntheticdata.html) »
- [omni.syntheticdata Submodules](omni.syntheticdata.Submodules.html) »
- omni.syntheticdata.ogn | 308 |
omni.syntheticdata.scripts.extension.Classes.md | # omni.syntheticdata.scripts.extension Classes
## Classes Summary
| Class Name | Description |
|------------|-------------|
| [Extension](omni.syntheticdata.scripts.extension/omni.syntheticdata.scripts.extension.Extension.html) | - |
| [SyntheticData](omni.syntheticdata.scripts.extension/omni.syntheticdata.scripts.extension.SyntheticData.html) | - |
| [SyntheticDataException](omni.syntheticdata.scripts.extension/omni.syntheticdata.scripts.extension.SyntheticDataException.html) | Common base class for all non-exit exceptions. |
| [SyntheticDataStage](omni.syntheticdata.scripts.extension/omni.syntheticdata.scripts.extension.SyntheticDataStage.html) | - | | 662 |
omni.syntheticdata.scripts.extension.Functions.md | # omni.syntheticdata.scripts.extension Functions
## Functions Summary
- **dataclass**
- [dataclass](./omni.syntheticdata.scripts.extension.dataclass.html)
- Returns the same class as was passed in, with dunder methods
- **field**
- [field](./omni.syntheticdata.scripts.extension.field.html)
- Return an object to identify dataclass fields. | 350 |
omni.syntheticdata.scripts.extension.md | # omni.syntheticdata.scripts.extension
## Classes Summary
- **Extension**
- **SyntheticData**
- **SyntheticDataException** - Common base class for all non-exit exceptions.
- **SyntheticDataStage**
## Functions Summary
- **dataclass** - Returns the same class as was passed in, with dunder methods
- **field** - Return an object to identify dataclass fields. | 359 |
omni.syntheticdata.scripts.helpers.Functions.md | # omni.syntheticdata.scripts.helpers Functions
## Functions Summary
| Function | Description |
|----------|-------------|
| [fish_eye_polynomial](#) | FTheta camera model based on DW src/dw/calibration/cameramodel/CameraModelsNoEigen.hpp |
| [ftheta_distortion](#) | F-Theta distortion. |
| [ftheta_distortion_prime](#) | Derivative to f_theta_distortion. |
| [get_bbox_3d_corners](#) | Return transformed points in the following order: [LDB, RDB, LUB, RUB, LDF, RDF, LUF, RUF] |
| [get_instance_mappings](#) | Get instance mappings. |
| [get_projection_matrix](#) | Calculate the camera projection matrix. |
| [get_view_params](#) | Get view parameters. |
| [get_view_proj_mat](#) | Get View Projection Matrix. |
| [image_to_world](#) | Map each image coordinate to a corresponding direction vector. |
| lru_cache | Least-recently-used cache decorator. |
| --- | --- |
| merge_sensors | Merge sensor structured array outputs. |
| project_fish_eye_map_to_sphere | |
| project_fish_eye_polynomial | Project F-Theta camera model. |
| project_pinhole | Project 3D points to 2D camera view using a pinhole camera model. |
| reduce_bboxes_2d | Reduce 2D bounding boxes of leaf nodes to prims with a semantic label. |
| reduce_bboxes_3d | Reduce 3D bounding boxes of leaf nodes to prims with a semantic label. |
| reduce_occlusion | Reduce occlusion value of leaf nodes to prims with a semantic label. |
| world_to_image | Project world coordinates to image-space. | | 1,463 |
omni.syntheticdata.scripts.md | # omni.syntheticdata.scripts
## Submodules Summary:
| Submodule | Description |
|-----------|-------------|
| [omni.syntheticdata.scripts.SyntheticData](omni.syntheticdata.scripts.SyntheticData.html) | No submodule docstring provided |
| [omni.syntheticdata.scripts.extension](omni.syntheticdata.scripts.extension.html) | No submodule docstring provided |
| [omni.syntheticdata.scripts.helpers](omni.syntheticdata.scripts.helpers.html) | No submodule docstring provided |
| [omni.syntheticdata.scripts.sensors](omni.syntheticdata.scripts.sensors.html) | No submodule docstring provided |
| [omni.syntheticdata.scripts.visualize](omni.syntheticdata.scripts.visualize.html) | No submodule docstring provided | | 709 |
omni.syntheticdata.scripts.sensors.Classes.md | # omni.syntheticdata.scripts.sensors Classes
## Classes Summary
| Class Name | Description |
|------------|-------------|
| [SyntheticData](omni.syntheticdata.scripts.sensors/omni.syntheticdata.scripts.sensors.SyntheticData.html) | |
| [SyntheticDataException](omni.syntheticdata.scripts.sensors/omni.syntheticdata.scripts.sensors.SyntheticDataException.html) | Common base class for all non-exit exceptions. |
| [SyntheticDataStage](omni.syntheticdata.scripts.sensors/omni.syntheticdata.scripts.sensors.SyntheticDataStage.html) | | | 536 |
omni.syntheticdata.scripts.sensors.Functions.md | # omni.syntheticdata.scripts.sensors Functions
## Functions Summary:
| Function Name | Description |
|---------------|-------------|
| create_or_retrieve_sensor | Retrieve a sensor for the specified viewport and sensor type. |
| create_or_retrieve_sensor_async | Retrieve a sensor for the specified viewport and sensor type. |
| dataclass | Returns the same class as was passed in, with dunder methods |
| disable_sensors | deactivate the host buffer copy nodes for given sensor |
| enable_sensors | activate the host buffer copy nodes for given sensor |
| field | Return an object to identify dataclass fields. |
| get_bounding_box_2d_loose | Get Bounding Box 2D Loose sensor output. |
| get_bounding_box_2d_tight | Get Bounding Box 2D Tight sensor output. |
| get_bounding_box_3d | Get Bounding Box 3D sensor output. |
| 方法 | 描述 |
| --- | --- |
| get_bounding_box_3d | Get bounding box 3D sensor output. |
| get_camera_3d_position | Get camera space 3d position sensor output. |
| get_cross_correspondence | Get Cross Correspondence sensor output. |
| get_depth | Get Inverse Depth sensor output. *** DEPRECATED *** |
| get_depth_linear | Get Linear Depth sensor output. *** DEPRECATED *** |
| get_distance_to_camera | Get distance to camera sensor output. |
| get_distance_to_image_plane | Get distance to image plane sensor output. |
| get_instance_segmentation | Get instance segmentation sensor output. |
| get_motion_vector | Get Motion Vector sensor output. |
| get_normals | Get Normals sensor output. |
| get_occlusion | Get Occlusion values. |
| get_occlusion_quadrant | Get Occlusion Quadrant. |
| get_rgb | Get RGB sensor output. |
| get_semantic_data | Get Semantic Data. |
| get_semantic_segmentation | Get semantic segmentation sensor output. |
| get_sensor_array | Retrieve the sensor array data from the last sensor node evaluation. |
| get_synthetic_data | |
| initialize_async | Initialize sensors in the list provided. |
| next_render_simulation_async | Fetch the current simulation time and wait for a frame to be rendered at or after this time. |
| next_sensor_data_async | Wait for frame complete event from Kit for specific viewport. | | 2,163 |
omni.syntheticdata.scripts.sensors.md | # omni.syntheticdata.scripts.sensors
## Classes Summary
- [SyntheticData](omni.syntheticdata.scripts.sensors/omni.syntheticdata.scripts.sensors.SyntheticData.html)
- [SyntheticDataException](omni.syntheticdata.scripts.sensors/omni.syntheticdata.scripts.sensors.SyntheticDataException.html) - Common base class for all non-exit exceptions.
- [SyntheticDataStage](omni.syntheticdata.scripts.sensors/omni.syntheticdata.scripts.sensors.SyntheticDataStage.html)
## Functions Summary
- [create_or_retrieve_sensor](omni.syntheticdata.scripts.sensors/omni.syntheticdata.scripts.sensors.create_or_retrieve_sensor.html) - Retrieve a sensor for the specified viewport and sensor type.
- [create_or_retrieve_sensor_async](omni.syntheticdata.scripts.sensors/omni.syntheticdata.scripts.sensors.create_or_retrieve_sensor_async.html) - Retrieve a sensor for the specified viewport and sensor type.
- [dataclass](omni.syntheticdata.scripts.sensors/omni.syntheticdata.scripts.sensors.dataclass.html) - Returns the same class as was passed in, with dunder methods
- [disable_sensors](omni.syntheticdata.scripts.sensors/omni.syntheticdata.scripts.sensors.disable_sensors.html) - deactivate the host buffer copy nodes for given sensor
- [enable_sensors](omni.syntheticdata.scripts.sensors/omni.syntheticdata.scripts.sensors.enable_sensors.html) - activate the host buffer copy nodes for given sensor
- [field](omni.syntheticdata.scripts.sensors/omni.syntheticdata.scripts.sensors.field.html)
| Function | Description |
|----------|-------------|
| get_bounding_box_2d_loose | Get Bounding Box 2D Loose sensor output. |
| get_bounding_box_2d_tight | Get Bounding Box 2D Tight sensor output. |
| get_bounding_box_3d | Get bounding box 3D sensor output. |
| get_camera_3d_position | Get camera space 3d position sensor output. |
| get_cross_correspondence | Get Cross Correspondence sensor output. |
| get_depth | Get Inverse Depth sensor output. *** DEPRECATED *** |
| get_depth_linear | Get Linear Depth sensor output. *** DEPRECATED *** |
| get_distance_to_camera | Get distance to camera sensor output. |
| get_distance_to_image_plane | Get distance to image plane sensor output. |
| get_instance_segmentation | Get instance segmentation sensor output. |
| get_motion_vector | Get Motion Vector sensor output. |
| get_normals | Get Normals sensor output. |
| get_occlusion | Get Occlusion values. |
| get_occlusion_quadrant | Get Occlusion Quadrant. |
| get_rgb | Get RGB sensor output. |
| get_semantic_data | Get Semantic Data. |
| get_semantic_segmentation | Get semantic segmentation sensor output. |
| get_sensor_array | Retrieve the sensor array data from the last sensor node evaluation. |
| get_synthetic_data | |
| initialize_async | |
## Sensors
### Initialize sensors in the list provided.
### next_render_simulation_async
Fetch the current simulation time and wait for a frame to be rendered at or after this time.
### next_sensor_data_async
Wait for frame complete event from Kit for specific viewport. | 3,000 |
omni.syntheticdata.scripts.Submodules.md | # omni.syntheticdata.scripts Submodules
## Submodules Summary:
| Module Name | Description |
|----------------------------|-------------------|
| omni.syntheticdata.scripts.SyntheticData | No submodule docstring provided |
| omni.syntheticdata.scripts.extension | No submodule docstring provided |
| omni.syntheticdata.scripts.helpers | No submodule docstring provided |
| omni.syntheticdata.scripts.sensors | No submodule docstring provided |
| omni.syntheticdata.scripts.visualize | No submodule docstring provided | | 562 |
omni.syntheticdata.scripts.SyntheticData.Classes.md | # omni.syntheticdata.scripts.SyntheticData Classes
## Classes Summary
- **SyntheticData**
- **SyntheticDataException**
- Common base class for all non-exit exceptions.
- **SyntheticDataStage** | 196 |
omni.syntheticdata.scripts.visualize.Functions.md | # omni.syntheticdata.scripts.visualize Functions
## Functions Summary
- **colorize_bboxes**
- **colorize_bboxes_3d**
- bboxes_3d_corners: in the local camera frame
- **colorize_distance**
- **colorize_segmentation**
- **get_bbox2d_loose**
- **get_bbox2d_tight**
- **get_bbox3d**
- **get_cross_correspondence**
- **get_depth**
- **get_distance**
- **get_instance_segmentation**
## Functions
- **get_instance_segmentation**
- **get_motion_vector**
- **get_normals**
- **get_semantic_segmentation**
- **random_colours**
- Generate random colors. | 549 |
omni.syntheticdata.scripts.visualize.md | # omni.syntheticdata.scripts.visualize
## Functions
Summary:
| Function | Description |
|----------|-------------|
| colorize_bboxes | - |
| colorize_bboxes_3d | bboxes_3d_corners: in the local camera frame |
| colorize_distance | - |
| colorize_segmentation | - |
| get_bbox2d_loose | - |
| get_bbox2d_tight | - |
| get_bbox3d | - |
| get_cross_correspondence | - |
| get_depth | - |
| get_distance | - |
| get_instance_segmentation | - |
| 奇数行 | 偶数行 |
|--------|--------|
| get_motion_vector | |
| get_normals | |
| get_semantic_segmentation | |
| random_colours | Generate random colors. | | 594 |
omni.syntheticdata.Submodules.md | # omni.syntheticdata Submodules
## Submodules Summary
- **omni.syntheticdata.ogn**
- No submodule docstring provided
- **omni.syntheticdata.scripts**
- No submodule docstring provided | 190 |
omni.syntheticdata.SyntheticData.md | # SyntheticData
## SyntheticData
```python
class omni.syntheticdata.SyntheticData
```
**Bases:** `object`
**Methods:**
- **Get()**
- Get the interface singleton instance.
- **Initialize()**
- Initialize interface singleton instance.
- **Reset()**
- Reset the interface singleton
- **__init__()**
- **activate_node_template(template_name, [...])**
- Activate a registered node.
- **connect_node_template(src_template_name, ...)**
- Connect the given source node template to the destination node template
```code
convert_sensor_type_to_rendervar
```
Convert of legacy sensor type name to its rendervar name
```code
deactivate_node_template
```
(template_name[, ...])
Deactivate a registered node.
```code
disable_async_rendering
```
()
Disable asynchronous rendering Since asyncRendering is not supported by the fabric, graphs are currently not compatible with this mode.
```code
disable_rendervar
```
(render_product_path, ...)
Explicitely disable the computation of a render_var for a given render_product.
```code
disconnect_node_template
```
(src_template_name, ...)
Disconnect the given source node template to the destination node template
```code
enable_rendervar
```
(render_product_path, render_var)
Explicitely enable the computation of a render_var for a given render_product.
```code
get_default_semantic_filter
```
()
Returns: The default semantic filter predicate.
```code
get_graph
```
([stage, renderProductPath])
Return the graph at a given stage, for a given renderProduct.
```code
get_instance_mapping_semantic_filter
```
()
Returns: The semantic filter predicate currently applied to the instance mapping.
```code
get_node_attributes
```
(template_name, ...[, ...])
Get the value of several activated node's attributes.
```code
get_registered_visualization_template_names
```
()
Get the registered node template names which types are in the display type list
```code
get_registered_visualization_template_names_for_display
```
()
Get the registered node template names which types are in the display type list and their display name
```code
get_semantic_filter
```
(filter_name)
Get the predicate of the given semantic filter.
```code
get_semantic_filter_label_template_name
```
(...)
1. **Get the template name of the node exposing the semantic label map of a given semantic filter.**
2. **Get the default activation status of a visualization node template**
- `get_visualization_template_name_default_activation`
3. **Query the activation status of a node template.**
- `is_node_template_activated(template_name[, ...])`
4. **Check if a node template has already been registered.**
- `is_node_template_registered(template_name)`
5. **Query the enabled status of a render var for a render product**
- `is_rendervar_enabled(render_product_path, ...)`
6. **Query the used status of a render var for a render product**
- `is_rendervar_used(render_product_path, ...)`
7. **Automatically register SdPostCompRenderVarTextures node template for the given template name.**
- `register_combine_rendervar_template(...)`
8. **Automatically register SdPostCompRenderVarTextures node template for all registered nodes whose type is in the post display type list.**
- `register_combine_rendervar_templates()`
9. **Automatically register SdPostRenderVarTextureToBuffer node templates for the given rendervars**
- `register_device_rendervar_tex_to_buff_templates(...)`
10. **Automatically register SdPostRenderVarToHost node templates for the given rendervars**
- `register_device_rendervar_to_host_templates(...)`
11. **Automatically register SdRenderVarDisplayTexture node template for all registered nodes whose type is in the post display type.**
- `register_display_rendervar_templates()`
12. **Automatically register SdRenderVarToRawArray node templates for the given rendervars**
- `register_export_rendervar_array_templates(...)`
13. **Automatically register SdRenderVarPtr node templates for the given rendervars**
- `register_export_rendervar_ptr_templates(...)`
14. **Automatically register SdPostRenderVarToHost node templates for the given rendervars**
- `register_host_rendervar_to_disk_templates(...)`
- Automatically register SdPostRenderVarToDisk node templates for the given rendervars
- Register a node template.
- Return the root renderer template name.
- Return the template name of the node triggering the execution of the post host to disk.
- Request the execution of an activated node.
- Reset the SyntheticData instance
- Deactivate all visualization node template by default
- Set the default semantic filter predicate.
- Set the semantic filter predicate to be applied to the instance mapping. Contrary to the default
- Set the value of an activated node attribute.
- Set a semantic filter predicate.
- Set the default activation status of visualization node template
- Unregister a node template.
__init__() → None
### NodeConnectionTemplate
```python
class NodeConnectionTemplate(node_template_id: str, render_product_idxs: tuple = (0), attributes_mapping: dict = <factory>)
```
Bases: object
### NodeTemplate
```python
class NodeTemplate(pipeline_stage: int, node_type_id: str, connections: list = <factory>, attributes: dict = <factory>)
```
Bases: object
### Get
```python
static Get()
```
Get the interface singleton instance.
### Initialize
```python
static Initialize()
```
Initialize interface singleton instance.
### Reset
```python
static Reset()
```
Reset the interface singleton
### activate_node_template
```python
activate_node_template(template_name: str, render_product_path_index: int = -1, render_product_paths: Optional[list] = None)
```
Activate a registered node.
Create a node instance for the given node template and all its missing dependencies (including nodes and renderVar). The node will be executed during the next stage execution.
**Parameters**
- **template_name** – name of the node template to be activate
- **render_product_path_index** – if the node template is associated to a render product, index of the associated render product in the render product path list
- **render_product_paths** – render product path list to be used for specifying the render product of the node template and its dependencies to activate
- **attributes** – dictionnary of attributes to set to the activated “template_name” node
- **stage** – the stage to change, if None use the stage of the current usd context
- **activate_render_vars** – if True activate the required render_vars, if False it is the user responsability to activate the required render_vars
**Returns**
A dictionnary containing for every render products the list of render var dependencies of this activation. NB: if activate_render_vars is True those render vars are added.
### connect_node_template
Connect the given source node template to the destination node template
#### Parameters
- **src_template_name** – name of the source node template
- **dst_template_name** – name of the destination node template
- **render_product_path** – render product path of the node templates (None if the node are not specific to a render product)
- **connection_map** – attribute mapping for the source inputs to the destination outputs. (None for an automatic mapping based on names)
### convert_sensor_type_to_rendervar
Convert of legacy sensor type name to its rendervar name
#### Parameters
- **legacy_type_name** – legacy sensor type name to convert
#### Returns
- the name of the renderVar correspoding to the legacy name
### deactivate_node_template
Deactivate a node template
#### Parameters
- **template_name** – name of the node template
- **render_product_path_index** – index of the render product path (default -1)
- **render_product_paths** – list of render product paths (default [])
- **stage** – optional Stage instance (default None)
- **deactivate_render_vars** – boolean indicating whether to deactivate render variables (default False)
### deactivate_node_template
Deactivate a registered node.
Delete a node instance for the given node template and all its automatically activated dependencies with no more downstream connections. The node won’t be executed anymore starting with the next stage execution.
#### Parameters
- **template_name** – name of the node template to deactivate
- **render_product_path_index** – if the node template is associated to a render product, index of the associated render product in the render product path list
- **render_product_paths** – render product path list to be used for specifying the render product of the node template and its dependencies to deactivate
- **stage** – the stage to change, if None use the stage of the current usd context
- **deactivate_render_vars** – if True deactivate the render_vars that have been activated in a call to activate_node_template and which are not used anymore by the managed graphs. Beware that in some cases, some of these render vars maybe actually used by other graphs, hence it is False by default if False it is the user responsability to deactivate the unused render_vars.
- **recurse_only_automatically_activated** – if True recursively deactivate only automatically activated upstream nodes without other connections if False recursively deactivate all upstream nodes without other connections
#### Returns
A dictionary containing for every render products path the list of render var dependencies that have been activated by activate_node_template and are not used anymore by the managed graphs. NB: if deactivate_render_vars is True those render vars are removed
### disable_async_rendering
Disable asynchronous rendering. Since asyncRendering is not supported by the fabric, graphs are currently not compatible with this mode.
### disable_rendervar
Explicitely disable the computation of a render_var for a given render_product.
#### Parameters
- **render_product_path** – the render_product for which to disable the given render_var computation
- **render_var** – the render_var to disable
- **usd_stage** – the USD stage, if None use the stage of the current usd context
#### Returns
None
### disconnect_node_template
```python
disconnect_node_template(src_template_name: str, dst_template_name: str, render_product_path: Optional[str] = None, connection_map: Optional[dict] = None)
```
Disconnect the given source node template to the destination node template.
**Parameters:**
- **src_template_name** – name of the source node template
- **dst_template_name** – name of the destination node template
- **render_product_path** – render product path of the node templates (None if the node are not specific to a render product)
- **connection_map** – attribute mapping for the source inputs to the destination outputs. (None for an automatic mapping based on names)
### enable_rendervar
```python
enable_rendervar(render_product_path: str, render_var: str, usd_stage: Optional[Stage] = None)
```
Explicitely enable the computation of a render_var for a given render_product.
**Parameters:**
- **render_product_path** – the render_product for which to enable the given render_var computation
- **render_var** – the render_var to enable
- **usd_stage** – usd stage (None if not specified)
- **render_var** – the name of the render_var to enable
- **usd_stage** – usd stage
### get_default_semantic_filter()
Returns:
The default semantic filter predicate.
### get_graph(stage: int = 3, renderProductPath: Optional[str] = None)
Return the graph at a given stage, for a given renderProduct.
Gives access to the SyntheticData graphs.
Parameters:
- **stage** – SyntheticDataStage of the queried graph
- **renderProductPath** – (for POST_RENDER stage only) the renderProductPath for which to get the POST_RENDER graph
Returns:
the graph at the given stage for the given renderProductPath.
### get_instance_mapping_semantic_filter()
Returns:
The semantic filter predicate currently applied to the instance mapping.
### get_node_attributes(template_name: str, attribute_names: list, render_product_path: Optional[str] = None, gpu: bool = False)
Get the value of several activated node’s attributes.
The function may be used to retrieve the value of multiple activated node output attributes after the execution of its graph.
Parameters:
- **template_name** – name of the activated node
- **attribute_names** – list of node attribute names to retrieve the value
- **render_product_path** – if the activated node is associated to a render product, provide its path
- **gpu** – for array data attribute, get a gpu data
Returns
- A dictionary of attribute name/value for every successfully retrieved attributes
- None if the node is not a valid activated node
static get_registered_visualization_template_names() → list
- Get the registered node template names which types are in the display type list
- Returns: list of registered template names which types are in the display type list
static get_registered_visualization_template_names_for_display() → list
- Get the registered node template names which types are in the display type list and their display name
- Returns: list of tuples of registered template names which types are in the display type list and their display name
get_semantic_filter(filter_name: str)
- Get the predicate of the given semantic filter
- Parameters:
- **filter_name** – name of a semantic filter
- Returns: the predicate of the semantic filter
get_semantic_filter_label_template_name(filter_name: str, post_render_stage: bool = True)
- Get the template name of the node exposing the semantic label map of a given semantic filter
- Parameters:
- **filter_name** – name of a semantic filter
- **post_render_stage** – if true return the POST_RENDER stage node template name otherwise the ON_DEMAND stage
- Returns: the template name of the node exposing the semantic labels of the given semantic filter
### get_visualization_template_name_default_activation
```python
static get_visualization_template_name_default_activation(template_name: str) -> bool
```
Get the default activation status of a visualization node template
**Parameters**
- **template_name** – the name of the visualization node template to activate/deactivate by default
**Returns**
- True if the visualization node template is activated by default, False otherwise
### is_node_template_activated
```python
is_node_template_activated(template_name: str, render_product_path: Optional[str] = None, only_manually_activated: bool = False) -> None
```
Query the activation status of a node template.
**Parameters**
- **template_name** – name of the node template to query the activation status
- **render_product_path** – render product path for which to check the template activation status (None if not applicable)
- **only_manually_activated** – if True check the activation for only the explicitely activated templates ( exclude the automatically activated template )
**Returns**
- True if the node template is currently activated and, if only_explicitely_activated is True, if it has been explicitely activated
### is_node_template_registered
```python
static is_node_template_registered(template_name: str) -> bool
```
Check if a node template has already been registered.
**Parameters**
- **template_name** – name of the node template to check
**Returns**
- True if the template_name specifie a node template within the registry, False otherwise
### is_rendervar_enabled
query the enabled status of a render var for a render product
#### Parameters
- **render_product_path** – the path of the render product
- **render_var** – the name of the render_var
- **only_sdg_activated** – consider only the render var automatically enabled by a call to activate_node_template
- **usd_stage** – the usd stage (if None use the current usd context stage)
#### Returns
True if the given render var is currently enabled for the given render product and, if only_sdg_activated is True, if it has been enabled by a call to activate_node_template
### is_rendervar_used
query the used status of a render var for a render product
#### Parameters
- **render_product_path** – the path of the render product
- **render_var** – the name of the render_var
#### Returns
True if the given render var is currently in use by the activated syntheticData nodes for the given render product
### register_combine_rendervar_template
static
### register_combine_rendervar_template
Automatically register SdPostCompRenderVarTextures node template for the given template name.
#### Parameters
- **template_name** – name of the node template for which registering a SdPostCompRenderVarTextures template
### register_combine_rendervar_templates
Automatically register SdPostCompRenderVarTextures node template for all registerd nodes whose type is in the post display type list.
The function is called for every statically registered nodes during the interface initialization.
It may be called after having registered nodes whose type is in the post display type list.
### register_device_rendervar_tex_to_buff_templates
Automatically register SdPostRenderVarTextureToBuffer node templates for the given rendervars
#### Parameters
- **rendervars** – list of renderVar names to register the rendervar device texture to buffer copy node template
### register_device_rendervar_to_host_templates
Automatically register SdPostRenderVarToHost node templates for the given rendervars
#### Parameters
- **rendervars** – list of renderVar names to register the rendervar device to host copy node template
### register_display_rendervar_templates
Automatically register SdRenderVarDisplayTexture node template for all registerd nodes whose type is in the post display type.
The function is called for every statically registered nodes during the interface initialization.
It may be called after having registered nodes whose type is omni.syntheticdata.SdPostRenderVarDisplayTexture.
### register_export_rendervar_array_templates
### register_export_rendervar_array_templates
**Parameters**
- **rendervars** – list of renderVar names to register the export raw array node template
### register_export_rendervar_ptr_templates
**Parameters**
- **rendervars** – list of renderVar names to register the ptr node template
### register_host_rendervar_to_disk_templates
**Parameters**
- **rendervars** – list of renderVar names to register the rendervar dispatch to disk node template
### register_node_template
**Parameters**
- **node_template** : NodeTemplate
- **rendervars** : Optional[list] = None
- **template_name** : Optional[str] = None
### Register a node template.
Register a node template.
Add a node template in the node registry. After the template has been added it may be activated for being executed in its associated stage.
#### Parameters
- **node_template** – template to be added to the registry
- **rendervars** – list of renderVar the node is producing
- **template_name** – unique name id of the template
#### Returns
the unique name id of the registered template
### Return the root renderer template name.
Return the root renderer template name.
To be scheduled a post-render node must be downstream to the root renderer node.
### Return the template name of the node triggering the execution of the post host to disk.
### Request the execution of an activated node.
Request the execution of an activated node.
The function will schedule the execution of compute-on-request node
#### Parameters
- **template_name** – name of the activated node
- **render_product_path** – if the activated node is associated to a render product, provide its path
#### Returns
True if the request has been successfull
### Reset
Reset
#### Parameters
- **usd** – default: True
- **remove_activated_render_vars** – default: False
## omni.syntheticdata.SyntheticData.reset
- **Description**: Reset the SyntheticData instance
- **Parameters**:
- `usd` – if true reset the graph in the usd stage session layer
- `remove_activated_render_vars` – if True and usd is True remove the render vars activated by the node activation
- **Note**: If the stage is valid it will destroy every graph created.
## omni.syntheticdata.SyntheticData.reset_visualization_template_name_default_activation
- **Description**: Deactivate all visualization node template by default
## omni.syntheticdata.SyntheticData.set_default_semantic_filter
- **Description**: Set the default semantic filter predicate.
- **Parameters**:
- `predicate` – a semantic filter predicate.
- `hierarchical_labels` – option to propagate semantic labels within the hierarchy, from parent to childrens
- `matching_labels` – option to remove from the set of labels the one that do not match the predicate
- `examples` (predicate) – “typeA : labelA & !labelB | labelC , typeB: labelA ; typeC: labelD”, “typeA : * ; * : labelA”
## omni.syntheticdata.SyntheticData.set_instance_mapping_semantic_filter
- **Description**: Set the semantic filter predicate to be applied to the instance mapping. Contrary to the default semantic filter this filter affect the instance mapping. All semantic data filtered at this level is not available in the instance mapping.
- **Parameters**:
- `predicate` – a semantic filter predicate.
- `examples` (predicate) – “typeA : labelA & !labelB | labelC , typeB: labelA ; typeC: labelD”, “typeA : * ; * : labelA”
## omni.syntheticdata.SyntheticData.set_node_attributes
- **Description**: Set node attributes for a specific template.
- **Parameters**:
- `template_name` : str
- `attributes` : dict
<em class="sig-param">
<span class="n">
<span class="pre">
render_product_path
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
Optional
<span class="p">
<span class="pre">
[
<span class="pre">
str
<span class="p">
<span class="pre">
]
<span class="w">
<span class="o">
<span class="pre">
=
<span class="w">
<span class="default_value">
<span class="pre">
None
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
Set the value of an activated node attribute.
<p>
The function may be used to set the value of multiple activated node input attributes before the execution of its stage.
<dl class="field-list simple">
<dt class="field-odd">
Parameters
<dd class="field-odd">
<ul class="simple">
<li>
<p>
<strong>
template_name
– name of the activated node
<li>
<p>
<strong>
attributes
– dictionnary of attribute name/value to set
<li>
<p>
<strong>
render_product_path
– if the activated node is associated to a render product, provide its path
<dl class="py method">
<dt class="sig sig-object py" id="omni.syntheticdata.SyntheticData.set_semantic_filter">
<span class="sig-name descname">
<span class="pre">
set_semantic_filter
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
filter_name
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
str
,
<em class="sig-param">
<span class="n">
<span class="pre">
predicate
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
str
,
<em class="sig-param">
<span class="n">
<span class="pre">
hierarchical_labels
<span class="o">
<span class="pre">
=
<span class="default_value">
<span class="pre">
False
,
<em class="sig-param">
<span class="n">
<span class="pre">
matching_labels
<span class="o">
<span class="pre">
=
<span class="default_value">
<span class="pre">
True
<span class="sig-paren">
)
<dd>
<dl class="simple">
<dt>
Set a semantic filter predicate.
<dd>
<p>
If no semantic filter with the given name exists it will be created.
If the predicate is empty the filter will be removed
<dl class="field-list simple">
<dt class="field-odd">
Parameters
<dd class="field-odd">
<ul class="simple">
<li>
<p>
<strong>
filter_name
–
<li>
<p>
<strong>
predicate
– a semantic filter predicate. (if empty the filter will be removed)
<li>
<p>
<strong>
hierarchical_labels
– option to propagate semantic labels within the hiearchy, from parent to childrens
<li>
<p>
<strong>
matching_labels
– option to remove from the set of labels the one that do not match the predicate
<li>
<p>
<strong>
examples
(
<em>
predicate
) – “typeA : labelA & !labelB | labelC , typeB: labelA ; typeC: labelD”
“typeA : * ; * : labelA”
<dl class="py method">
<dt class="sig sig-object py" id="omni.syntheticdata.SyntheticData.set_visualization_template_name_default_activation">
<em class="property">
<span class="pre">
static
<span class="w">
<span class="sig-name descname">
<span class="pre">
set_visualization_template_name_default_activation
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
template_name
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
str
,
<em class="sig-param">
<span class="n">
<span class="pre">
activation
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
bool
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
bool
<dd>
Set the default activation status of visualization node template
### Parameters
- **template_name** – the name of the visualization node template to activate/deactivate by default
- **activation** – True if the visualization node template should be activated/deactivated by default
### Returns
True if the template name is an activated visualization template name after the call, False otherwise
### unregister_node_template
```python
static unregister_node_template(template_name: str) -> None
```
Unregister a node template.
Remove a node template from the registry and all its dependencies. After removing a template, it cannot be activated anymore, nor its dependent templates.
``` | 27,112 |
omni.syntheticdata.SyntheticDataException.md | # SyntheticDataException
## SyntheticDataException
```python
class omni.syntheticdata.SyntheticDataException(message='error')
```
Bases: `Exception`
```python
def __init__(message='error'):
```
``` | 199 |
omni.syntheticdata.SyntheticDataStage.md | # SyntheticDataStage
## SyntheticDataStage
```
class omni.syntheticdata.SyntheticDataStage
```
Bases: `object`
### Methods
### Attributes
| Attribute | Description |
|-----------|-------------|
| `AUTO` | |
| `ON_DEMAND` | |
| `POST_RENDER` | |
| `PRE_RENDER` | |
| `SIMULATION` | |
```python
__init__()
```
``` | 323 |
omni.ui.AbstractField.md | # AbstractField
## Summary
The abstract widget that is base for any field, which is a one-line text editor. A field allows the user to enter and edit a single line of plain text. It’s implemented using the model-view pattern and uses AbstractValueModel as the central component of the system.
### Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
### Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Details
### `__init__(*args, **kwargs)`
### `focus_keyboard(self[, focus])`
Puts cursor to this field or removes focus if focus
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
```markdown
## Methods
| Method Name | Description |
|-------------|-------------|
| `__init__(*args, **kwargs)` | |
| `focus_keyboard(self[, focus])` | Puts cursor to this field or removes focus if focus |
```
```markdown
## Attributes
| Attribute Name | Description |
|----------------|-------------|
```
## omni.ui.AbstractField.focus_keyboard
### Parameters
- **self**: omni.ui._ui.AbstractField
- **focus**: bool = True
### Returns
- None
### Description
Puts cursor to this field or removes focus if focus | 15,506 |
omni.ui.AbstractItem.md | # AbstractItem
## AbstractItem
```python
class omni.ui.AbstractItem(pybind11_object)
```
The object that is associated with the data entity of the AbstractItemModel.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self)` | |
```python
def __init__(self):
pass
```
``` | 303 |
omni.ui.AbstractItemDelegate.md | # AbstractItemDelegate
## AbstractItemDelegate
AbstractItemDelegate is used to generate widgets that display and edit data items from a model.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self)` | Constructs AbstractItemDelegate. |
| `build_branch(self, model[, item, column_id, ...])` | This pure abstract method must be reimplemented to generate custom collapse/expand button. |
| `build_header(self[, column_id])` | This pure abstract method must be reimplemented to generate custom widgets for the header table. |
| `build_widget(self, model[, item, index, ...])` | This pure abstract method must be reimplemented to generate custom widgets for specific item in the model. |
### omni.ui.AbstractItemDelegate.__init__
Constructs AbstractItemDelegate.
#### Keyword Arguments:
- `kwargs`: dict
- See below
### omni.ui.AbstractItemDelegate.build_branch
This pure abstract method must be reimplemented to generate custom collapse/expand button.
#### Parameters:
- `self`: omni.ui._ui.AbstractItemDelegate
- `model`: omni.ui._ui.AbstractItemModel
- `item`: omni.ui._ui.AbstractItem = None
- `column_id`: int = 0
- `level`: int = 0
- `expanded`: bool = False
### omni.ui.AbstractItemDelegate.build_header
This pure abstract method must be reimplemented to generate custom widgets for the header table.
#### Parameters:
- `self`: omni.ui._ui.AbstractItemDelegate
- `column_id`: int = 0
### build_widget
```python
build_widget(self: omni.ui._ui.AbstractItemDelegate, model: omni.ui._ui.AbstractItemModel, item: omni.ui._ui.AbstractItem = None, index: int = 0, level: int = 0, expanded: bool = False) -> None
```
This pure abstract method must be reimplemented to generate custom widgets for specific item in the model.
``` | 1,757 |
omni.ui.AbstractItemModel.md | # AbstractItemModel
## AbstractItemModel
The central component of the item widget. It is the application’s dynamic data structure, independent of the user interface, and it directly manages the nested data. It follows closely model-view pattern. It’s abstract, and it defines the standard interface to be able to interoperate with the components of the model-view architecture. It is not supposed to be instantiated directly. Instead, the user should subclass it to create a new model.
The item model doesn’t return the data itself. Instead, it returns the value model that can contain any data type and supports callbacks. Thus the client of the model can track the changes in both the item model and any value it holds.
From any item, the item model can get both the value model and the nested items. Therefore, the model is flexible to represent anything from color to complicated tree-table construction.
### Methods
- **__init__(self)**
- Constructs AbstractItemModel.
- **add_begin_edit_fn(self, arg0)**
- Adds the function that will be called every time the user starts the editing.
- **add_end_edit_fn(self, arg0)**
- Adds the function that will be called every time the user finishes the editing.
- **add_item_changed_fn(self, arg0)**
- Adds the function that will be called every time the value changes.
- `append_child_item(self, parentItem, model)`
- Creates a new item from the value model and appends it to the list of the children of the given item.
- `begin_edit(self, item)`
- Called when the user starts the editing.
- `can_item_have_children(self[, parentItem])`
- Returns true if the item can have children.
- `drop(*args, **kwargs)`
- Overloaded function.
- `drop_accepted(*args, **kwargs)`
- Overloaded function.
- `end_edit(self, item)`
- Called when the user finishes the editing.
- `get_drag_mime_data(self[, item])`
- Returns Multipurpose Internet Mail Extensions (MIME) for drag and drop.
- `get_item_children(self[, parentItem])`
- Returns the vector of items that are nested to the given parent item.
- `get_item_value_model(self[, item, column_id])`
- Get the value model associated with this item.
- `get_item_value_model_count(self[, item])`
- Returns the number of columns this model item contains.
- `remove_begin_edit_fn(self, arg0)`
- Remove the callback by its id.
- `remove_end_edit_fn(self, arg0)`
- Remove the callback by its id.
- `remove_item(self, item)`
- Removes the item from the model.
- `remove_item_changed_fn(self, arg0)`
- Remove the callback by its id.
- `subscribe_begin_edit_fn(self, arg0)`
- Adds the function that will be called every time the user starts the editing.
- `subscribe_end_edit_fn(self, arg0)`
- Adds the function that will be called every time the user finishes the editing.
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
subscribe_end_edit_fn
(self, arg0)
<td>
<p>
Adds the function that will be called every time the user finishes the editing.
<tr class="row-odd">
<td>
<p>
<a class="reference internal" href="#omni.ui.AbstractItemModel.subscribe_item_changed_fn" title="omni.ui.AbstractItemModel.subscribe_item_changed_fn">
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
subscribe_item_changed_fn
(self, arg0)
<td>
<p>
Adds the function that will be called every time the value changes.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.AbstractItemModel.__init__">
<span class="sig-name descname">
<span class="pre">
__init__
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<a class="reference internal" href="#omni.ui.AbstractItemModel" title="omni.ui._ui.AbstractItemModel">
<span class="pre">
omni.ui._ui.AbstractItemModel
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<a class="headerlink" href="#omni.ui.AbstractItemModel.__init__" title="Permalink to this definition">
<dd>
<p>
Constructs AbstractItemModel.
<blockquote>
<div>
<dl class="simple">
<dt>
`kwargs
<span class="classifier">
dict`
<dd>
<p>
See below
<p>
### Keyword Arguments:
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.AbstractItemModel.add_begin_edit_fn">
<span class="sig-name descname">
<span class="pre">
add_begin_edit_fn
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<a class="reference internal" href="#omni.ui.AbstractItemModel" title="omni.ui._ui.AbstractItemModel">
<span class="pre">
omni.ui._ui.AbstractItemModel
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg0
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
Callable
<span class="p">
<span class="pre">
[
<span class="p">
<span class="pre">
[
<a class="reference internal" href="#omni.ui.AbstractItemModel" title="omni.ui._ui.AbstractItemModel">
<span class="pre">
omni.ui._ui.AbstractItemModel
<span class="p">
<span class="pre">
,
<span class="w">
<a class="reference internal" href="omni.ui.AbstractItem.html#omni.ui.AbstractItem" title="omni.ui._ui.AbstractItem">
<span class="pre">
omni.ui._ui.AbstractItem
<span class="p">
<span class="pre">
]
<span class="p">
<span class="pre">
,
<span class="w">
<span class="pre">
None
<span class="p">
<span class="pre">
]
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
int
<a class="headerlink" href="#omni.ui.AbstractItemModel.add_begin_edit_fn" title="Permalink to this definition">
<dd>
<p>
Adds the function that will be called every time the user starts the editing.
The id of the callback that is used to remove the callback.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.AbstractItemModel.add_end_edit_fn">
<span class="sig-name descname">
<span class="pre">
add_end_edit_fn
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<a class="reference internal" href="#omni.ui.AbstractItemModel" title="omni.ui._ui.AbstractItemModel">
<span class="pre">
omni.ui._ui.AbstractItemModel
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg0
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
Callable
<span class="p">
<span class="pre">
[
<span class="p">
<span class="pre">
[
<a class="reference internal" href="#omni.ui.AbstractItemModel" title="omni.ui._ui.AbstractItemModel">
<span class="pre">
omni.ui._ui.AbstractItemModel
<span class="p">
<span class="pre">
,
<span class="w">
<a class="reference internal" href="omni.ui.AbstractItem.html#omni.ui.AbstractItem" title="omni.ui._ui.AbstractItem">
<span class="pre">
omni.ui._ui.AbstractItem
<span class="p">
<span class="pre">
]
<span class="p">
<span class="pre">
,
<span class="w">
<span class="pre">
None
<span class="p">
<span class="pre">
]
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
int
<a class="headerlink" href="#omni.ui.AbstractItemModel.add_end_edit_fn" title="Permalink to this definition">
<dd>
<p>
Adds the function that will be called every time the user starts the editing.
The id of the callback that is used to remove the callback.
### add_end_edit_fn
Adds the function that will be called every time the user finishes the editing.
The id of the callback that is used to remove the callback.
### add_item_changed_fn
Adds the function that will be called every time the value changes.
The id of the callback that is used to remove the callback.
### append_child_item
Creates a new item from the value model and appends it to the list of the children of the given item.
### begin_edit
### omni.ui.AbstractItemModel.begin_edit
- **Description:** 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.
### omni.ui.AbstractItemModel.can_item_have_children
- **Description:** Returns true if the item can have children. In this way the delegate usually draws +/- icon.
- **Arguments:**
- `id :` The item to request children from. If it’s null, the children of root will be returned.
### omni.ui.AbstractItemModel.drop
- **Description:** Overloaded function.
- 1. drop(self: omni.ui._ui.AbstractItemModel, item_tagget: omni.ui._ui.AbstractItem, item_source: omni.ui._ui.AbstractItem, drop_location: int = -1) -> None
- **Description:** Called when the user droped one item to another.
- 2. drop(self: omni.ui._ui.AbstractItemModel, item_tagget: omni.ui._ui.AbstractItem, source: str, drop_location: int = -1) -> None
- **Description:** Called when the user droped a string to the item.
### omni.ui.AbstractItemModel.drop_accepted
- **Description:** Overloaded function.
- 1. drop_accepted(self: omni.ui._ui.AbstractItemModel, item_tagget: omni.ui._ui.AbstractItem, item_source: omni.ui._ui.AbstractItem, drop_location: int = -1) -> bool
- **Description:** Called to determine if the model can perform drag and drop to the given item. If this method returns false, the widget shouldn’t highlight the visual element that represents this item.
- 2. drop_accepted(self: omni.ui._ui.AbstractItemModel, item_tagget: omni.ui._ui.AbstractItem, source: str, drop_location: int = -1) -> bool
- **Description:** Called to determine if the model can perform drag and drop of the given string to the given item. If this method returns false, the widget shouldn’t highlight the visual element that represents this item.
### omni.ui.AbstractItemModel.end_edit
- **Description:** (No description provided in the HTML source)
### omni.ui.AbstractItemModel.end_edit
- **Description**: 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.
### omni.ui.AbstractItemModel.get_drag_mime_data
- **Description**: Returns Multipurpose Internet Mail Extensions (MIME) for drag and drop.
### omni.ui.AbstractItemModel.get_item_children
- **Description**: Returns the vector of items that are nested to the given parent item.
- **Arguments**:
- `id :`
- **Description**: The item to request children from. If it’s null, the children of root will be returned.
### omni.ui.AbstractItemModel.get_item_value_model
- **Description**: (To be continued...)
<span class="pre">
None
,
<em class="sig-param">
<span class="n">
<span class="pre">
column_id
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
int
<span class="w">
<span class="o">
<span class="pre">
=
<span class="w">
<span class="default_value">
<span class="pre">
0
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
omni.ui._ui.AbstractValueModel
<dd>
<p>
Get the value model associated with this item.
<p>
### Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`item :`
<dd>
<p>
The item to request the value model from. If it’s null, the root value model will be returned.
<dt>
`index :`
<dd>
<p>
The column number to get the value model.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.AbstractItemModel.get_item_value_model_count">
<span class="sig-name descname">
<span class="pre">
get_item_value_model_count
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
omni.ui._ui.AbstractItemModel
,
<em class="sig-param">
<span class="n">
<span class="pre">
item
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
omni.ui._ui.AbstractItem
<span class="w">
<span class="o">
<span class="pre">
=
<span class="w">
<span class="default_value">
<span class="pre">
None
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
int
<dd>
<p>
Returns the number of columns this model item contains.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.AbstractItemModel.remove_begin_edit_fn">
<span class="sig-name descname">
<span class="pre">
remove_begin_edit_fn
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
omni.ui._ui.AbstractItemModel
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg0
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
int
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
Remove the callback by its id.
<p>
### Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`id :`
<dd>
<p>
The id that addBeginEditFn returns.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.AbstractItemModel.remove_end_edit_fn">
<span class="sig-name descname">
<span class="pre">
remove_end_edit_fn
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
omni.ui._ui.AbstractItemModel
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg0
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
int
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
Remove the callback by its id.
<p>
### Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`id :`
<dd>
<p>
The id that addEndEditFn returns.
<dd>
<p>
Remove the callback by its id.
<p>
### Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`id :`
<dd>
<p>
The id that addEndEditFn returns.
```
```markdown
<dd>
<p>
Removes the item from the model.
There is no parent here because we assume that the reimplemented model deals with its data and can figure out how to remove this item.
```
```markdown
<dd>
<p>
Remove the callback by its id.
<p>
### Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`id :`
<dd>
<p>
The id that addValueChangedFn returns.
```
```markdown
<dd>
<p>
Adds the function that will be called every time the user starts the editing.
The id of the callback that is used to remove the callback.
```
```markdown
<dd>
<p>
Adds the function that will be called every time the user ends the editing.
The id of the callback that is used to remove the callback.
### Methods
#### subscribe_end_edit_fn
```python
subscribe_end_edit_fn(self: omni.ui._ui.AbstractItemModel, arg0: Callable[[omni.ui._ui.AbstractItemModel, omni.ui._ui.AbstractItem, None], None]) -> carb._carb.Subscription
```
Adds the function that will be called every time the user finishes the editing. The id of the callback that is used to remove the callback.
#### subscribe_item_changed_fn
```python
subscribe_item_changed_fn(self: omni.ui._ui.AbstractItemModel, arg0: Callable[[omni.ui._ui.AbstractItemModel, omni.ui._ui.AbstractItem, None], None]) -> carb._carb.Subscription
```
Adds the function that will be called every time the value changes. The id of the callback that is used to remove the callback.
```
### Description
Adds the function that will be called every time the user finishes the editing. The id of the callback that is used to remove the callback.
Adds the function that will be called every time the value changes. The id of the callback that is used to remove the callback. | 16,284 |
omni.ui.AbstractMultiField.md | # AbstractMultiField
AbstractMultiField is the abstract class that has everything to create a custom widget per model item. The class that wants to create multiple widgets per item needs to reimplement the method _createField.
## Methods
- `__init__(*args, **kwargs)`
## Attributes
- `column_count`
- The max number of fields in a line.
- `h_spacing`
- Sets a non-stretchable horizontal space in pixels between child fields.
- `v_spacing`
- Sets a non-stretchable vertical space in pixels between child fields.
*args, **kwargs)
### column_count
The max number of fields in a line.
### h_spacing
Sets a non-stretchable horizontal space in pixels between child fields.
### v_spacing
Sets a non-stretchable vertical space in pixels between child fields. | 764 |
omni.ui.AbstractSlider.md | # AbstractSlider
## AbstractSlider
The abstract widget that is base for drags and sliders.
### Methods
- `__init__(*args, **kwargs)`
### Attributes
- `__init__(*args, **kwargs)`
```
``` | 192 |
omni.ui.AbstractValueModel.md | # AbstractValueModel
## Methods
- `__init__(self)`
- Constructs AbstractValueModel.
- `add_begin_edit_fn(self, arg0)`
- Adds the function that will be called every time the user starts the editing.
- `add_end_edit_fn(self, arg0)`
- Adds the function that will be called every time the user finishes the editing.
- `add_value_changed_fn(self, arg0)`
- Adds the function that will be called every time the value changes.
- `begin_edit(self)`
- Called when the user starts the editing.
- `end_edit(self)`
- Called when the user finishes the editing.
| Method | Description |
|--------|-------------|
| `get_value_as_bool(self)` | Return the bool representation of the value. |
| `get_value_as_float(self)` | Return the float representation of the value. |
| `get_value_as_int(self)` | Return the int representation of the value. |
| `get_value_as_string(self)` | Return the string representation of the value. |
| `remove_begin_edit_fn(self, arg0)` | Remove the callback by its id. |
| `remove_end_edit_fn(self, arg0)` | Remove the callback by its id. |
| `remove_value_changed_fn(self, arg0)` | Remove the callback by its id. |
| `set_value(*args, **kwargs)` | Overloaded function. |
| `subscribe_begin_edit_fn(self, arg0)` | Adds the function that will be called every time the user starts the editing. |
| `subscribe_end_edit_fn(self, arg0)` | Adds the function that will be called every time the user finishes the editing. |
| `subscribe_item_changed_fn(self, arg0)` | |
| `subscribe_value_changed_fn(self, arg0)` | Adds the function that will be called every time the value changes. |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `as_bool` | Return the bool representation of the value. |
| `as_float` | Return the float representation of the value. |
| `as_int` | Return the int representation of the value. |
| Method | Description |
|--------|-------------|
| `as_int` | Return the int representation of the value. |
| `as_string` | Return the string representation of the value. |
### __init__
Constructs AbstractValueModel.
#### Keyword Arguments:
- `kwargs dict`
- See below
### add_begin_edit_fn
Adds the function that will be called every time the user starts the editing. The id of the callback that is used to remove the callback.
### add_end_edit_fn
Adds the function that will be called every time the user finishes the editing. The id of the callback that is used to remove the callback.
### add_value_changed_fn
### add_value_changed_fn
```python
add_value_changed_fn(self: omni.ui._ui.AbstractValueModel, arg0: Callable[[omni.ui._ui.AbstractValueModel], None]) -> int
```
Adds the function that will be called every time the value changes. The id of the callback that is used to remove the callback.
### begin_edit
```python
begin_edit(self: omni.ui._ui.AbstractValueModel) -> None
```
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.
### end_edit
```python
end_edit(self: omni.ui._ui.AbstractValueModel) -> 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. This method should be reimplemented.
### get_value_as_bool
```python
get_value_as_bool(self: omni.ui._ui.AbstractValueModel) -> bool
```
Return the bool representation of the value.
### get_value_as_float
```python
get_value_as_float(self: omni.ui._ui.AbstractValueModel) -> float
```
Return the float representation of the value.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.AbstractValueModel.get_value_as_float">
<span class="sig-name descname">
<span class="pre">
get_value_as_float
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
omni.ui._ui.AbstractValueModel
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
float
<dd>
<p>
Return the float representation of the value.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.AbstractValueModel.get_value_as_int">
<span class="sig-name descname">
<span class="pre">
get_value_as_int
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
omni.ui._ui.AbstractValueModel
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
int
<dd>
<p>
Return the int representation of the value.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.AbstractValueModel.get_value_as_string">
<span class="sig-name descname">
<span class="pre">
get_value_as_string
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
omni.ui._ui.AbstractValueModel
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
str
<dd>
<p>
Return the string representation of the value.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.AbstractValueModel.remove_begin_edit_fn">
<span class="sig-name descname">
<span class="pre">
remove_begin_edit_fn
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
omni.ui._ui.AbstractValueModel
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg0
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
int
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
Remove the callback by its id.
<p>
### Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`id :`
<dd>
<p>
The id that addBeginEditFn returns.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.AbstractValueModel.remove_end_edit_fn">
<span class="sig-name descname">
<span class="pre">
remove_end_edit_fn
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
omni.ui._ui.AbstractValueModel
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg0
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
int
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
Remove the callback by its id.
<p>
### Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`id :`
<dd>
<p>
The id that addEndEditFn returns.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.AbstractValueModel.remove_value_changed_fn">
<span class="sig-name descname">
<span class="pre">
remove_value_changed_fn
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
omni.ui._ui.AbstractValueModel
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg0
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
int
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
Remove the callback by its id.
<p>
### Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`id :`
<dd>
<p>
The id that addValueChangedFn returns.
### omni.ui.AbstractValueModel.remove_value_changed_fn
Remove the callback by its id.
#### Arguments:
> The id that addValueChangedFn returns.
### omni.ui.AbstractValueModel.set_value
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.ui.AbstractValueModel.subscribe_begin_edit_fn
Adds the function that will be called every time the user starts the editing. The id of the callback that is used to remove the callback.
### omni.ui.AbstractValueModel.subscribe_end_edit_fn
Adds the function that will be called every time the user ends the editing. The id of the callback that is used to remove the callback.
### omni.ui.AbstractValueModel.subscribe_end_edit_fn
```python
subscribe_end_edit_fn(self: omni.ui._ui.AbstractValueModel, arg0: Callable[[omni.ui._ui.AbstractValueModel], None]) -> carb._carb.Subscription
```
Adds the function that will be called every time the user finishes the editing.
The id of the callback that is used to remove the callback.
### omni.ui.AbstractValueModel.subscribe_item_changed_fn
```python
subscribe_item_changed_fn(self: omni.ui._ui.AbstractValueModel, arg0: Callable[[omni.ui._ui.AbstractValueModel, None]]) -> carb._carb.Subscription
```
### omni.ui.AbstractValueModel.subscribe_value_changed_fn
```python
subscribe_value_changed_fn(self: omni.ui._ui.AbstractValueModel, arg0: Callable[[omni.ui._ui.AbstractValueModel], None]) -> carb._carb.Subscription
```
Adds the function that will be called every time the value changes.
The id of the callback that is used to remove the callback.
### omni.ui.AbstractValueModel.as_bool
```
property as_bool
```
Return the bool representation of the value.
### omni.ui.AbstractValueModel.as_float
```
property as_float
```
Return the float representation of the value.
### omni.ui.AbstractValueModel.as_int
```
property as_int
```
Return the int representation of the value.
### omni.ui.AbstractValueModel.as_string
```
property as_string
```
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
as_string
<dd>
<p>
Return the string representation of the value.
| 13,058 |
omni.ui.abstract_shade.AbstractShade.md | # AbstractShade
## AbstractShade
```
```
class omni.ui.abstract_shade.AbstractShade
```
```
Bases: object
```
```
The implementation of shades for custom style parameter type.
The user has to reimplement methods _store and _find to set/get the value
in the specific store.
```
### Methods
| Method | Description |
|--------|-------------|
| `__init__()` | |
| `set_shade(name)` | Set the default shade. |
| `shade(default)` | Save the given shade, pick the color and apply it to ui.ColorStore. |
```
__init__()
```
```
set_shade(name)
```
```
Set the default shade.
```
```
shade(default)
```
```
Save the given shade, pick the color and apply it to ui.ColorStore.
```
## AbstractShade Methods
### set_shade
Set the default shade.
### shade
Save the given shade, pick the color and apply it to ui.ColorStore. | 823 |
omni.ui.abstract_shade.Classes.md | # omni.ui.abstract_shade Classes
## Classes Summary:
| Class Name | Description |
|------------|-------------|
| [AbstractShade](omni.ui.abstract_shade/omni.ui.abstract_shade.AbstractShade.html) | The implementation of shades for custom style parameter type. | | 262 |
omni.ui.add_to_namespace.md | # add_to_namespace
## add_to_namespace
<class 'omni.ui._ui.CollapsableFrame'>,
'ColorStore':
<class 'omni.ui._ui.ColorStore'>,
'ColorWidget':
<class 'omni.ui._ui.ColorWidget'>,
'ComboBox':
<class 'omni.ui._ui.ComboBox'>,
'Container':
<class 'omni.ui._ui.Container'>,
'CornerFlag':
<class 'omni.ui._ui.CornerFlag'>,
'Direction':
<class 'omni.ui._ui.Direction'>,
'DockPolicy':
<class 'omni.ui._ui.DockPolicy'>,
'DockPosition':
<class 'omni.ui._ui.DockPosition'>,
'DockPreference':
<class 'omni.ui._ui.DockPreference'>,
'DockSpace':
<class 'omni.ui._ui.DockSpace'>,
'DynamicTextureProvider':
<class 'omni.ui._ui.DynamicTextureProvider'>,
'Ellipse':
<class 'omni.ui._ui.Ellipse'>,
'FillPolicy':
<class 'omni.ui._ui.FillPolicy'>,
'FloatDrag':
<class 'omni.ui._ui.FloatDrag'>,
'FloatField':
<class 'omni.ui._ui.FloatField'>,
'FloatSlider':
<class 'omni.ui._ui.FloatSlider'>,
'FloatStore':
<class 'omni.ui._ui.FloatStore'>,
'FocusPolicy':
<class 'omni.ui._ui.FocusPolicy'>,
'FontStyle':
<class 'omni.ui._ui.FontStyle'>,
'Fraction':
<class 'omni.ui._ui.Fraction'>,
'Frame':
<class 'omni.ui._ui.Frame'>,
'FreeBezierCurve':
<class 'omni.ui._ui.FreeBezierCurve'>,
'FreeCircle':
<class 'omni.ui._ui.FreeCircle'>,
'FreeEllipse':
<class 'omni.ui._ui.FreeEllipse'>,
'FreeLine':
<class 'omni.ui._ui.FreeLine'>,
'FreeRectangle':
<class 'omni.ui._ui.FreeRectangle'>,
'FreeTriangle':
<class 'omni.ui._ui.FreeTriangle'>,
'Grid':
<class 'omni.ui._ui.Grid'>,
'HGrid':
<class 'omni.ui._ui.HGrid'>,
'HStack':
<class 'omni.ui._ui.HStack'>,
'Image':
<class 'omni.ui._ui.Image'>,
'ImageProvider':
<class 'omni.ui._ui.ImageProvider'>,
'ImageWithProvider':
<class 'omni.ui._ui.ImageWithProvider'>,
'Inspector':
<class 'omni.ui._ui.Inspector'>,
'IntDrag':
<class 'omni.ui._ui.IntDrag'>,
'IntField':
<class 'omni.ui._ui.IntField'>,
'IntSlider':
<class 'omni.ui._ui.IntSlider'>,
'InvisibleButton':
<class 'omni.ui._ui.InvisibleButton'>,
'ItemModelHelper':
<class 'omni.ui._ui.ItemModelHelper'>,
'IwpFillPolicy':
<class 'omni.ui._ui.IwpFillPolicy'>,
'Label':
<class 'omni.ui._ui.Label'>,
'Length':
<class 'omni.ui._ui.Length'>,
'Line':
<class 'omni.ui._ui.Line'>,
'MainWindow':
<class 'omni.ui._ui.MainWindow'>,
'Menu':
<class 'omni.ui._ui.Menu'>,
'MenuBar':
<class 'omni.ui._ui.MenuBar'>,
'MenuDelegate':
<class 'omni.ui._ui.MenuDelegate'>,
'MenuHelper':
<class 'omni.ui._ui.MenuHelper'>,
'MenuItem':
<class 'omni.ui._ui.MenuItem'>,
'MenuItemCollection':
<class 'omni.ui._ui.MenuItemCollection'>,
'MultiFloatDragField':
<class 'omni.ui._ui.MultiFloatDragField'>,
'MultiFloatField':
<class 'omni.ui._ui.MultiFloatField'>,
'MultiIntDragField':
<class 'omni.ui._ui.MultiIntDragField'>,
'MultiIntField':
<class 'omni.ui._ui.MultiIntField'>,
'MultiStringField':
<class 'omni.ui._ui.MultiStringField'>,
'OffsetLine':
<class 'omni.ui._ui.OffsetLine'>,
'Optional':
typing.Optional,
'Percent':
<class 'omni.ui._ui.Percent'>,
'Pixel':
<class 'omni.ui._ui.Pixel'>,
'Placer':
<class 'omni.ui._ui.Placer'>,
'Plot':
<class 'omni.ui._ui.Plot'>,
'ProgressBar':
<class 'omni.ui._ui.ProgressBar'>,
'RadioButton':
<class 'omni.ui._ui.RadioButton'>,
'RadioCollection':
<class 'omni.ui._ui.RadioCollection'>,
'RasterImageProvider':
<class 'omni.ui._ui.RasterImageProvider'>,
'RasterPolicy':
<class 'omni.ui._ui.RasterPolicy'>,
'Rectangle':
<class 'omni.ui._ui.Rectangle'>,
'ScrollBarPolicy':
<class 'omni.ui._ui.ScrollBarPolicy'>,
'ScrollingFrame':
<class 'omni.ui._ui.ScrollingFrame'>,
'Separator':
<class 'omni.ui._ui.Separator'>,
'ShadowFlag':
<class 'omni.ui._ui.ShadowFlag'>,
'Shape':
<class 'omni.ui._ui.Shape'>,
'ShapeAnchorHelper':
<class 'omni.ui._ui.ShapeAnchorHelper'>,
'SimpleBoolModel':
<class 'omni.ui._ui.SimpleBoolModel'>,
'SimpleFloatModel':
<class 'omni.ui._ui.SimpleFloatModel'>,
'SimpleIntModel':
<class 'omni.ui._ui.SimpleIntModel'>,
'SimpleStringModel':
<class 'omni.ui._ui.SimpleStringModel'>,
'SliderDrawMode':
<class 'omni.ui._ui.SliderDrawMode'>,
'Spacer':
<class 'omni.ui._ui.Spacer'>,
'Stack':
<class 'omni.ui._ui.Stack'>,
'StringField':
<class 'omni.ui._ui.StringField'>,
'omni.ui._ui.StringField'>,
'StringStore':
<class 'omni.ui._ui.StringStore'>,
'Style':
<class 'omni.ui._ui.Style'>,
'TextureFormat':
<class 'omni.gpu_foundation_factory._gpu_foundation_factory.TextureFormat'>,
'ToolBar':
<class 'omni.ui._ui.ToolBar'>,
'ToolBarAxis':
<class 'omni.ui._ui.ToolBarAxis'>,
'ToolButton':
<class 'omni.ui._ui.ToolButton'>,
'TreeView':
<class 'omni.ui._ui.TreeView'>,
'Triangle':
<class 'omni.ui._ui.Triangle'>,
'Type':
<class 'omni.ui._ui.Type'>,
'UIPreferencesExtension':
<class 'omni.ui.extension.UIPreferencesExtension'>,
'UIntDrag':
<class 'omni.ui._ui.UIntDrag'>,
'UIntSlider':
<class 'omni.ui._ui.UIntSlider'>,
'UnitType':
<class 'omni.ui._ui.UnitType'>,
'VGrid':
<class 'omni.ui._ui.VGrid'>,
'VStack':
<class 'omni.ui._ui.VStack'>,
'ValueModelHelper':
<class 'omni.ui._ui.ValueModelHelper'>,
'VectorImageProvider':
<class 'omni.ui._ui.VectorImageProvider'>,
'WINDOW_FLAGS_FORCE_HORIZONTAL_SCROLLBAR': 32768,
'WINDOW_FLAGS_FORCE_VERTICAL_SCROLLBAR': 16384,
'WINDOW_FLAGS_MENU_BAR': 1024,
'WINDOW_FLAGS_MODAL': 134217728,
'WINDOW_FLAGS_NONE': 0,
'WINDOW_FLAGS_NO_BACKGROUND': 128,
'WINDOW_FLAGS_NO_CLOSE': 2147483648,
'WINDOW_FLAGS_NO_COLLAPSE': 32,
'WINDOW_FLAGS_NO_DOCKING': 2097152,
'WINDOW_FLAGS_NO_FOCUS_ON_APPEARING': 4096,
'WINDOW_FLAGS_NO_MOUSE_INPUTS': 512,
'WINDOW_FLAGS_NO_MOVE': 4,
'WINDOW_FLAGS_NO_RESIZE': 2,
'WINDOW_FLAGS_NO_SAVED_SETTINGS': 256,
'WINDOW_FLAGS_NO_SCROLLBAR': 8,
'WINDOW_FLAGS_NO_SCROLL_WITH_MOUSE': 16,
'WINDOW_FLAGS_NO_TITLE_BAR': 1,
'WINDOW_FLAGS_POPUP': 67108864,
'WINDOW_FLAGS_SHOW_HORIZONTAL_SCROLLBAR': 2048,
'Widget':
<class 'omni.ui._ui.Widget'>,
'WidgetMouseDropEvent':
<class 'omni.ui._ui.WidgetMouseDropEvent'>,
'Window':
<class 'omni.ui._ui.Window'>,
'WindowHandle':
<class 'omni.ui._ui.WindowHandle'>,
'Workspace':
<class 'omni.ui._ui.Workspace'>,
'ZStack':
<class 'omni.ui._ui.ZStack'>,
'__builtins__':
{'ArithmeticError':
<class 'ArithmeticError'>,
'AssertionError':
<class 'AssertionError'>,
'AttributeError':
<class 'AttributeError'>,
'BaseException':
<class 'BaseException'>,
'BlockingIOError':
'BlockingIOError': <class 'BlockingIOError'>,
'BrokenPipeError': <class 'BrokenPipeError'>,
'BufferError': <class 'BufferError'>,
'BytesWarning': <class 'BytesWarning'>,
'ChildProcessError': <class 'ChildProcessError'>,
'ConnectionAbortedError': <class 'ConnectionAbortedError'>,
'ConnectionError': <class 'ConnectionError'>,
'ConnectionRefusedError': <class 'ConnectionRefusedError'>,
'ConnectionResetError': <class 'ConnectionResetError'>,
'DeprecationWarning': <class 'DeprecationWarning'>,
'EOFError': <class 'EOFError'>,
'Ellipsis': Ellipsis,
'EncodingWarning': <class 'EncodingWarning'>,
'EnvironmentError': <class 'OSError'>,
'Exception': <class 'Exception'>,
'False': False,
'FileExistsError': <class 'FileExistsError'>,
'FileNotFoundError': <class 'FileNotFoundError'>,
'FloatingPointError': <class 'FloatingPointError'>,
'FutureWarning': <class 'FutureWarning'>,
'GeneratorExit': <class 'GeneratorExit'>,
'IOError': <class 'OSError'>,
'ImportError': <class 'ImportError'>,
'ImportWarning': <class 'ImportWarning'>,
'IndentationError': <class 'IndentationError'>,
'IndexError': <class 'IndexError'>,
'InterruptedError': <class 'InterruptedError'>,
'IsADirectoryError': <class 'IsADirectoryError'>,
'KeyError': <class 'KeyError'>,
'KeyboardInterrupt': <class 'KeyboardInterrupt'>,
'LookupError': <class 'LookupError'>,
'MemoryError': <class 'MemoryError'>,
'ModuleNotFoundError': <class 'ModuleNotFoundError'>,
'NameError': <class 'NameError'>,
'None': None,
'NotADirectoryError': <class 'NotADirectoryError'>,
'NotImplemented': NotImplemented,
'NotImplementedError': <class 'NotImplementedError'>,
'OSError': <class 'OSError'>,
'OverflowError': <class 'OverflowError'>,
'PendingDeprecationWarning': <class 'PendingDeprecationWarning'>,
'PermissionError': <class 'PermissionError'>,
'ProcessLookupError': <class 'ProcessLookupError'>,
'RecursionError': <class 'RecursionError'>,
'ReferenceError': <class 'ReferenceError'>,
'ResourceWarning': <class 'ResourceWarning'>,
'RuntimeError': <class 'RuntimeError'>,
'RuntimeWarning': <class 'RuntimeWarning'>,
'StopAsyncIteration': <class 'StopAsyncIteration'>,
'StopIteration': <class 'StopIteration'>,
'SyntaxError': <class 'SyntaxError'>,
'SyntaxWarning': <class 'SyntaxWarning'>,
'SystemError': <class 'SystemError'>,
'SystemExit': <class 'SystemExit'>,
'TabError': <class 'TabError'>,
'TimeoutError': <class 'TimeoutError'>,
'True': True,
'TypeError': <class 'TypeError'>,
'UnboundLocalError': <class 'UnboundLocalError'>,
'UnicodeDecodeError': <class 'UnicodeDecodeError'>,
'UnicodeEncodeError': <class 'UnicodeEncodeError'>,
'UnicodeError': <class 'UnicodeError'>,
'UnicodeTranslateError': <class 'UnicodeTranslateError'>,
'UnicodeWarning': <class 'UnicodeWarning'>,
'UserWarning': <class 'UserWarning'>,
'ValueError': <class 'ValueError'>,
'Warning': <class 'Warning'>,
'ZeroDivisionError': <class 'ZeroDivisionError'>,
'__build_class__': <built-in function __build_class__>,
'__debug__': True,
'__doc__': "Built-in functions, exceptions, and other objects.\n\nNoteworthy: None is the `nil' object; Ellipsis represents `...' in slices.",
'__import__': <built-in function __import__>,
'__loader__': <class '_frozen_importlib.BuiltinImporter'>,
'__name__': 'builtins',
'__package__': '',
'__pybind11_internals_v4_gcc_libstdcpp_cxxabi1011__': <capsule object NULL>,
'__spec__': ModuleSpec(name='builtins', loader=<class '_frozen_importlib.BuiltinImporter'>, origin='built-in'),
'abs': <built-in function abs>,
'aiter': <built-in function aiter>,
'all': <built-in function all>,
function
all>,
'anext':
<built-in
function
anext>,
'any':
<built-in
function
any>,
'ascii':
<built-in
function
ascii>,
'bin':
<built-in
function
bin>,
'bool':
<class
'bool'>,
'breakpoint':
<built-in
function
breakpoint>,
'bytearray':
<class
'bytearray'>,
'bytes':
<class
'bytes'>,
'callable':
<built-in
function
callable>,
'chr':
<built-in
function
chr>,
'classmethod':
<class
'classmethod'>,
'compile':
<built-in
function
compile>,
'complex':
<class
'complex'>,
'copyright':
Copyright (c) 2001-2022 Python Software Foundation. All Rights Reserved.
Copyright (c) 2000 BeOpen.com. All Rights Reserved.
Copyright (c) 1995-2001 Corporation for National Research Initiatives. All Rights Reserved.
Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam. All Rights Reserved.,
'credits':
Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands for supporting Python development. See www.python.org for more information.,
'delattr':
<built-in function delattr>,
'dict':
<class 'dict'>,
'dir':
<built-in function dir>,
'divmod':
<built-in function divmod>,
'enumerate':
<class 'enumerate'>,
'eval':
<built-in function eval>,
'exec':
<built-in function exec>,
'exit':
Use
exit()
or
Ctrl-D
(i.e.
EOF)
to
exit,
'filter':
<class
'filter'>,
'float':
<class
'float'>,
'format':
<built-in
function
format>,
'frozenset':
<class
'frozenset'>,
'getattr':
<built-in
function
getattr>,
'globals':
<built-in
function
globals>,
'hasattr':
<built-in
function
hasattr>,
'hash':
<built-in
function
hash>,
'help':
Type
help()
for
interactive
help,
or
help(object)
for
help
about
object.,
'hex':
<built-in
function
hex>,
'id':
<built-in
function
id>,
'input':
<built-in
function
input>,
'int':
<class
'int'>,
'isinstance':
<built-in
function
isinstance>,
'issubclass':
<built-in
function
issubclass>,
'iter':
<built-in
function
iter>,
'len':
<built-in
function
len>,
'license':
Type
license()
to
see
the
full
license
text,
'list':
<class
'list'>,
'locals':
<built-in
function
locals>,
'map':
<class
'map'>,
'max':
<built-in
function
max>,
'memoryview':
<class
'memoryview'>,
'min':
<built-in
function
min>,
'next':
<built-in
function
next>,
'object':
<class
'object'>,
'oct':
<built-in
function
oct>,
'open':
<built-in
function
open>,
'ord':
<built-in
function
ord>,
'pow':
<built-in
function
pow>,
'print':
<built-in
function
print>
print>,
'property':
<class 'property'>,
'quit':
Use
quit()
or
Ctrl-D
(i.e. EOF)
to
exit,
'range':
<class 'range'>,
'repr':
<built-in function repr>,
'reversed':
<class 'reversed'>,
'round':
<built-in function round>,
'set':
<class 'set'>,
'setattr':
<built-in function setattr>,
'slice':
<class 'slice'>,
'sorted':
<built-in function sorted>,
'staticmethod':
<class 'staticmethod'>,
'str':
<class 'str'>,
'sum':
<built-in function sum>,
'super':
<class 'super'>,
'tuple':
<class 'tuple'>,
'type':
<class 'type'>,
'vars':
<built-in function vars>,
'zip':
<class 'zip'>},
'__cached__':
'/builds/omniverse/kit/kit/_build/linux-x86_64/release/exts/omni.ui/omni/ui/__pycache__/__init__.cpython-310.pyc',
'__doc__':
'\nOmni::UI\n--------\n\nOmni::UI is Omniverse's UI toolkit for creating beautiful and flexible graphical user interfaces\nin the Kit extensions. Omni::UI provides the basic types necessary to create rich extensions with\na fluid and dynamic user interface in Omniverse Kit. It gives a layout system and includes\nwidgets for creating visual components, receiving user input, and creating data models. It allows\nuser interface components to be built around their behavior and enables a'
declarative
flavor
of\ndescribing
the
layout
of
the
application.
Omni::UI
gives
a
very
flexible
styling
system
that\nallows
deep
customizing
the
final
look
of
the
application.
Typical Example
---------------
Typical example to create a window with two buttons:
```code-block
import omni.ui as ui
_window_example = ui.Window("Example Window", width=300, height=300)
with _window_example.frame:
with ui.VStack():
ui.Button("click me")
def move_me(window):
window.setPosition(200, 200)
def size_me(window):
window.width = 300
window.height = 300
ui.Button("Move to (200,200)", clicked_fn=lambda w=self._window_example: move_me(w))
ui.Button("Set size (300,300)", clicked_fn=lambda w=self._window_example: size_me(w))
Detailed Documentation
----------------------
Omni::UI is shipped with the developer documentation that is written with Omni::UI. For detailed documentation, please see `omni.example.ui` extension. It has detailed descriptions of all the classes, best practices, and real-world usage examples.
Layout
------
* Arrangement of elements
* :class:`omni.ui.CollapsableFrame`
* :class:`omni.ui.Frame`
* :class:`omni.ui.HStack`
* :class:`omni.ui.Placer`
* :class:`omni.ui.ScrollingFrame`
* :class:`omni.ui.Spacer`
* :class:`omni.ui.VStack`
* :class:`omni.ui.ZStack`
* Lengths
* :class:`omni.ui.Fraction`
* :class:`omni.ui.Percent`
* :class:`omni.ui.Pixel`
Widgets
-------
* Base Widgets
```
* :class:`omni.ui.Button`
* :class:`omni.ui.Image`
* :class:`omni.ui.Label`
* Shapes
* :class:`omni.ui.Circle`
* :class:`omni.ui.Line`
* :class:`omni.ui.Rectangle`
* :class:`omni.ui.Triangle`
* Menu
* :class:`omni.ui.Menu`
* :class:`omni.ui.MenuItem`
* Model-View Widgets
* :class:`omni.ui.AbstractItemModel`
* :class:`omni.ui.AbstractValueModel`
* :class:`omni.ui.CheckBox`
* :class:`omni.ui.ColorWidget`
* :class:`omni.ui.ComboBox`
* :class:`omni.ui.RadioButton`
* :class:`omni.ui.RadioCollection`
* :class:`omni.ui.TreeView`
* Model-View Fields
* :class:`omni.ui.FloatField`
* :class:`omni.ui.IntField`
* :class:`omni.ui.MultiField`
* :class:`omni.ui.StringField`
* Model-View Drags and Sliders
* :class:`omni.ui.FloatDrag`
* :class:`omni.ui.FloatSlider`
* :class:`omni.ui.IntDrag`
* :class:`omni.ui.IntSlider`
* Model-View ProgressBar
* :class:`omni.ui.ProgressBar`
* Windows
* :class:`omni.ui.ToolBar`
* :class:`omni.ui.Window`
* :class:`omni.ui.Workspace`
* Web
* :class:`omni.ui.WebViewWidget`
<em>
{
'constant_utils':
<module
'omni.ui.constant_utils'
from
'/builds/omniverse/kit/kit/_build/linux-x86_64/release/exts/omni.ui/omni/ui/constant_utils.py'>,
'dock_window_in_window':
<built-in
method
dock_window_in_window
of
PyCapsule
object>,
'extension':
<module
'omni.ui.extension'
from
'/builds/omniverse/kit/kit/_build/linux-x86_64/release/exts/omni.ui/omni/ui/extension.py'>,
'get_custom_glyph_code':
<built-in
method
get_custom_glyph_code
of
PyCapsule
object>,
'get_main_window_height':
<built-in
method
get_main_window_height
of
PyCapsule
object>,
'get_main_window_width':
<built-in
method
get_main_window_width
of
PyCapsule
object>,
'omni':
<module
'omni'
(<_frozen_importlib_external._NamespaceLoader
object>)>,
'set_menu_delegate':
<function
set_menu_delegate>,
'set_shade':
<function
set_shade>,
'singleton':
<module
'omni.ui.singleton'
from
'/builds/omniverse/kit/kit/_build/linux-x86_64/release/exts/omni.ui/omni/ui/singleton.py'>,
'style':
<omni.ui._ui.Style
object>,
'style_utils':
<module
'omni.ui.style_utils'
from
'/builds/omniverse/kit/kit/_build/linux-x86_64/release/exts/omni.ui/omni/ui/style_utils.py'>,
'url':
<omni.ui.url_utils.StringShade
object>,
'url_utils':
<module
'omni.ui.url_utils'
from
'/builds/omniverse/kit/kit/_build/linux-x86_64/release/exts/omni.ui/omni/ui/url_utils.py'>,
'workspace_utils':
<module
'omni.ui.workspace_utils'
from
'/builds/omniverse/kit/kit/_build/linux-x86_64/release/exts/omni.ui/omni/ui/workspace_utils.py'>
}
| 17,846 |
omni.ui.Alignment.md | # Alignment
## Class omni.ui.Alignment
Bases: `pybind11_object`
Members:
- UNDEFINED
- LEFT_TOP
- LEFT_CENTER
- LEFT_BOTTOM
- CENTER_TOP
- CENTER
- CENTER_BOTTOM
- RIGHT_TOP
- RIGHT_CENTER
- RIGHT_BOTTOM
- LEFT
- RIGHT
- H_CENTER
- TOP
- BOTTOM
- V_CENTER
### Methods
- `__init__(self, value)`
### Attributes
- `BOTTOM`
- `CENTER`
- `CENTER_BOTTOM`
- `CENTER_TOP`
- `H_CENTER`
- `LEFT`
- `LEFT_BOTTOM`
- `LEFT_CENTER`
- `LEFT_TOP`
- `RIGHT`
- `RIGHT_BOTTOM`
- `RIGHT_CENTER`
- `RIGHT_TOP`
- `TOP`
- `UNDEFINED`
- `V_CENTER`
<p>
LEFT
<p>
LEFT_BOTTOM
<p>
LEFT_CENTER
<p>
LEFT_TOP
<p>
RIGHT
<p>
RIGHT_BOTTOM
<p>
RIGHT_CENTER
<p>
RIGHT_TOP
<p>
TOP
<p>
UNDEFINED
<p>
V_CENTER
<p>
name
<p>
value
<dl>
<dt>
__init__(self: omni.ui._ui.Alignment, value: int) -> None
<dl>
<dt>
property name
| 816 |
omni.ui.ArrowHelper.md | # ArrowHelper
## Class: omni.ui.ArrowHelper
The ArrowHelper widget provides a colored rectangle to display.
### Methods
- `__init__(*args, **kwargs)`
### Attributes
- `begin_arrow_height`
- This property holds the height of the begin arrow.
- `begin_arrow_type`
- This property holds the type of the begin arrow can only be eNone or eRrrow.
- `begin_arrow_width`
- This property holds the width of the begin arrow.
- `end_arrow_height`
- This property holds the height of the end arrow.
- `end_arrow_type`
- This property holds the type of the end arrow can only be eNone or eRrrow.
<p>
This property holds the type of the end arrow can only be eNone or eRrrow.
<p>
<code>end_arrow_width
<p>
This property holds the width of the end arrow.
<dl>
<dt>
<code>__init__(*args, **kwargs)
<dd>
<dl>
<dt>
<em>property
<code>begin_arrow_height
<dd>
<p>
This property holds the height of the begin arrow.
<dl>
<dt>
<em>property
<code>begin_arrow_type
<dd>
<p>
This property holds the type of the begin arrow can only be eNone or eRrrow. By default, the arrow type is eNone.
<dl>
<dt>
<em>property
<code>begin_arrow_width
<dd>
<p>
This property holds the width of the begin arrow.
<dl>
<dt>
<em>property
<code>end_arrow_height
<dd>
<p>
This property holds the height of the end arrow.
<dl>
<dt>
<em>property
<code>end_arrow_type
<dd>
<p>
This property holds the type of the end arrow can only be eNone or eRrrow. By default, the arrow type is eNone.
<dl>
<dt>
<em>property
<code>end_arrow_width
<dd>
<p>
This property holds the width of the end arrow.
| 1,594 |
omni.ui.ArrowType.md | # ArrowType
## Overview
The `ArrowType` class is a part of the `omni.ui` module, inheriting from `pybind11_object`. It defines two main members: `NONE` and `ARROW`.
### Members
- **NONE**
- **ARROW**
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, value)` | Initializes the `ArrowType` object. |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `ARROW` | |
| `NONE` | |
| `name` | |
| `value` | |
### `__init__` Method
- **Parameters**:
- `self`: The instance of the `ArrowType` class.
- `value`: The value to initialize the `ArrowType` object.
:
int
)
→ None
property
name | 644 |
omni.ui.Axis.md | # Axis
## Axis
- Bases: `pybind11_object`
### Members:
- None
- X
- Y
- XY
### Methods
| Method | Description |
| --- | --- |
| `__init__(self, value)` | |
### Attributes
| Attribute | Description |
| --- | --- |
| `None` | |
| `X` | |
| `XY` | |
| `Y` | |
| `name` | |
| `value` | |
## __init__
`__init__(self, value)`
**omni.ui._ui.Axis**(self, value: int) -> None
property name | 397 |
omni.ui.BezierCurve.md | # BezierCurve
## BezierCurve
```python
class omni.ui.BezierCurve
```
Smooth curve that can be scaled infinitely.
### Methods
```python
__init__(self, **kwargs)
```
Initialize the curve.
```python
call_mouse_hovered_fn(self, arg0)
```
Sets the function that will be called when the user uses mouse enter/leave on the line.
```python
has_mouse_hovered_fn(self)
```
Sets the function that will be called when the user uses mouse enter/leave on the line.
```python
set_mouse_hovered_fn(self, fn)
```
Sets the function that will be called when the user uses mouse enter/leave on the line.
### Attributes
```
<p>
end_tangent_height
<p>
This property holds the Y coordinate of the end of the curve relative to the width bound of the curve.
<p>
end_tangent_width
<p>
This property holds the X coordinate of the end of the curve relative to the width bound of the curve.
<p>
start_tangent_height
<p>
This property holds the Y coordinate of the start of the curve relative to the width bound of the curve.
<p>
start_tangent_width
<p>
This property holds the X coordinate of the start of the curve relative to the width bound of the curve.
<dl>
<dt>
__init__
(
<em>
self
:
omni.ui._ui.BezierCurve
,
<em>
**kwargs
)
<span>
→
None
<dd>
<p>
Initialize the curve.
<blockquote>
<div>
<dl>
<dt>
kwargs
dict
<dd>
<p>
See below
<p>
### Keyword Arguments:
<p>
start_tangent_width: This property holds the X coordinate of the start of the curve relative to the width bound of the curve.
<p>
start_tangent_height: This property holds the Y coordinate of the start of the curve relative to the width bound of the curve.
<p>
end_tangent_width: This property holds the X coordinate of the end of the curve relative to the width bound of the curve.
<p>
end_tangent_height: This property holds the Y coordinate of the end of the curve relative to the width bound of the curve.
<p>
set_mouse_hovered_fn: Sets the function that will be called when the user use mouse enter/leave on the line. It’s the override to prevent Widget from the bounding box logic. The function specification is: void onMouseHovered(bool hovered)
<blockquote>
<div>
<dl>
<dt>
width
ui.Length
<dd>
<p>
This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
<dt>
height
ui.Length
<dd>
<p>
This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
<dt>
name
str
<dd>
<p>
The name of the widget that user can set.
<dt>
style_type_name_override
str
<dd>
<p>
By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
<dt>
identifier
str
<dd>
<p>
An optional identifier of the widget we can use to refer to it in queries.
<dt>
visible
bool
<dd>
<p>
This property holds whether the widget is visible.
<dt>
visibleMin
float
<dd>
<p>
If the current zoom factor and DPI is less than this value, the widget is not visible.
<dt>
visibleMax
float
<dd>
<p>
If the current zoom factor and DPI is bigger than this value, the widget is not visible.
<dt>
tooltip
str
<dd>
<p>
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
<dt>
tooltip_fn
Callable
<dd>
<p>
Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
### Properties
- **tooltip_offset_x** *(float)*
- Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
- **tooltip_offset_y** *(float)*
- Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
- **enabled** *(bool)*
- This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
- **selected** *(bool)*
- This property holds a flag that specifies the widget has to use eSelected state of the style.
- **checked** *(bool)*
- This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
- **dragging** *(bool)*
- This property holds if the widget is being dragged.
- **opaque_for_mouse_events** *(bool)*
- If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
- **skip_draw_when_clipped** *(bool)*
- The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
- **mouse_moved_fn** *(Callable)*
- Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
- **mouse_pressed_fn** *(Callable)*
- Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
- **mouse_released_fn** *(Callable)*
- Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
- **mouse_double_clicked_fn** *(Callable)*
- Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
- **mouse_wheel_fn** *(Callable)*
- Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
- **mouse_hovered_fn** *(Callable)*
- Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
- **drag_fn** *(Callable)*
- Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
- **accept_drop_fn** *(Callable)*
- Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
- **drop_fn** *(Callable)*
- Specify that this Widget accepts drops and set the callback to the drop operation.
- **computed_content_size_changed_fn** *(Callable)*
- Called when the size of the widget is changed.
- **anchor_position**
- This property holds the parametric value of the curve anchor.
- **anchor_alignment**
- This property holds the Alignment of the curve anchor.
- **set_anchor_fn** *(Callable)*
- Sets the function that will be called for the curve anchor.
- **invalidate_anchor**
- Function that causes the anchor frame to be redrawn.
- **get_closest_parametric_position**
- Function that returns the closest parametric T value to a given x,y position.
```
### Methods
- **call_mouse_hovered_fn**
- Description of the method.
### omni.ui.BezierCurve.call_mouse_hovered_fn
```python
def call_mouse_hovered_fn(self: omni.ui._ui.BezierCurve, arg0: bool) -> None
```
Sets the function that will be called when the user use mouse enter/leave on the line. It’s the override to prevent Widget from the bounding box logic. The function specification is: void onMouseHovered(bool hovered)
### omni.ui.BezierCurve.has_mouse_hovered_fn
```python
def has_mouse_hovered_fn(self: omni.ui._ui.BezierCurve) -> bool
```
Sets the function that will be called when the user use mouse enter/leave on the line. It’s the override to prevent Widget from the bounding box logic. The function specification is: void onMouseHovered(bool hovered)
### omni.ui.BezierCurve.set_mouse_hovered_fn
```python
def set_mouse_hovered_fn(self: omni.ui._ui.BezierCurve, fn: Callable[[bool], None]) -> None
```
Sets the function that will be called when the user use mouse enter/leave on the line. It’s the override to prevent Widget from the bounding box logic. The function specification is: void onMouseHovered(bool hovered)
### omni.ui.BezierCurve.end_tangent_height
```
property end_tangent_height
```
This property holds the Y coordinate of the end of the curve relative to the width bound of the curve.
### omni.ui.BezierCurve.end_tangent_width
```
property end_tangent_width
```
This property holds the X coordinate of the end of the curve relative to the width bound of the curve.
### omni.ui.BezierCurve.start_tangent_height
```
property start_tangent_height
```
This property holds the Y coordinate of the start of the curve relative to the width bound of the curve.
### omni.ui.BezierCurve.start_tangent_width
```
property start_tangent_width
```
This property holds the X coordinate of the start of the curve relative to the width bound of the curve.
<section>
<div>
<div>
<section>
<dl class="class">
<dt>
<em>
<span class="pre">
start_tangent_width
<dd>
<p>
This property holds the X coordinate of the start of the curve relative to the width bound of the curve.
<footer>
<hr/>
| 10,291 |
omni.ui.Button.md | # Button
## Button
The Button widget provides a command button. The command button, is perhaps the most commonly used widget in any graphical user interface. Click a button to execute a command. It is rectangular and typically displays a text label describing its action.
### Methods
- **__init__(self[, text])**
- Construct a button with a text on it.
### Attributes
- **image_height**
- This property holds the height of the image widget.
- **image_url**
- This property holds the button's optional image URL.
- **image_width**
- This property holds the width of the image widget.
- **spacing**
- Sets a non-stretchable space in points between image and text.
- **text**
- The text displayed on the button.
__init__(self: omni.ui._ui.Button, text: str = '', **kwargs) -> None
Construct a button with a text on it.
### Arguments:
- `text :`
- The text for the button to use.
- `kwargs`
- See below
### Keyword Arguments:
- `text`
- This property holds the button’s text.
- `image_url`
- This property holds the button’s optional image URL.
- `image_width`
- This property holds the width of the image widget. Do not use this function to find the width of the image.
- `image_height`
- This property holds the height of the image widget. Do not use this function to find the height of the image.
- `spacing`
- Sets a non-stretchable space in points between image and text.
- `clicked_fn`
- Sets the function that will be called when when the button is activated (i.e., pressed down then released while the mouse cursor is inside the button).
- `width`
- This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
- `height`
- This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
- `name`
- The name of the widget that user can set.
- `style_type_name_override`
- By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
- `identifier`
- An optional identifier of the widget we can use to refer to it in queries.
- `visible`
- This property holds whether the widget is visible.
- `visibleMin`
- If the current zoom factor and DPI is less than this value, the widget is not visible.
- `visibleMax`
- If the current zoom factor and DPI is bigger than this value, the widget is not visible.
- `tooltip`
- Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
- `tooltip_fn`
- Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
- `tooltip_offset_x`
<dl>
<dt>
`tooltip_offset_x
<span class="classifier">
float`
<dd>
<p>
Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`tooltip_offset_y
<span class="classifier">
float`
<dd>
<p>
Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`enabled
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
<dt>
`selected
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eSelected state of the style.
<dt>
`checked
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
<dt>
`dragging
<span class="classifier">
bool`
<dd>
<p>
This property holds if the widget is being dragged.
<dt>
`opaque_for_mouse_events
<span class="classifier">
bool`
<dd>
<p>
If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
<dt>
`skip_draw_when_clipped
<span class="classifier">
bool`
<dd>
<p>
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
<dt>
`mouse_moved_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
<dt>
`mouse_pressed_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
<dt>
`mouse_released_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_double_clicked_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_wheel_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_hovered_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>
`drag_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>
`accept_drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>
`drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
`computed_content_size_changed_fn
<span class="classifier">
Callable`
<dd>
<p>
Called when the size of the widget is changed.
### image_width
This property holds the width of the image widget. Do not use this function to find the width of the image.
### spacing
Sets a non-stretchable space in points between image and text.
### text
This property holds the button’s text. | 9,230 |
omni.ui.ByteImageProvider.md | # ByteImageProvider
## ByteImageProvider
```python
class omni.ui.ByteImageProvider
```
Bases:
```python
ImageProvider
```
doc
### Methods
| Method | Description |
|--------|-------------|
| `__init__(*args, **kwargs)` | Overloaded function. |
| `set_bytes_data(self, bytes, sizes, format, ...)` | Sets Python sequence as byte data. |
| `set_bytes_data_from_gpu(self, gpu_bytes, ...)` | Sets byte data from a copy of gpu memory at gpuBytes. |
| `set_data(self, arg0, arg1)` | [DEPRECATED FUNCTION] |
| `set_data_array(self, arg0, arg1)` | |
| `set_raw_bytes_data(self, raw_bytes, sizes, ...)` | |
<p>
Sets byte data that the image provider will turn raw pointer array into an image.
<p class="rubric">
Attributes
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.ByteImageProvider.__init__">
<span class="sig-name descname">
<span class="pre">
__init__
<span class="sig-paren">
(
<em class="sig-param">
<span class="o">
<span class="pre">
*
<span class="n">
<span class="pre">
args
,
<em class="sig-param">
<span class="o">
<span class="pre">
**
<span class="n">
<span class="pre">
kwargs
<span class="sig-paren">
)
<dd>
<p>
Overloaded function.
<ol class="arabic simple">
<li>
<p>
__init__(self: omni.ui._ui.ByteImageProvider) -> None
<p>
doc
<ol class="arabic simple" start="2">
<li>
<p>
__init__(self: omni.ui._ui.ByteImageProvider, bytes: sequence, sizes: List[int], format: omni.gpu_foundation_factory._gpu_foundation_factory.TextureFormat = <TextureFormat.???: 0>, stride: int = -1) -> None
<p>
doc
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.ByteImageProvider.set_bytes_data">
<span class="sig-name descname">
<span class="pre">
set_bytes_data
<span class="sig-paren">
(
<em class="sig-param">
<span class="pre">
self:
<span class="pre">
omni.ui._ui.ByteImageProvider,
<span class="pre">
bytes:
<span class="pre">
sequence,
<span class="pre">
sizes:
<span class="pre">
List[int],
<span class="pre">
format:
<span class="pre">
omni.gpu_foundation_factory._gpu_foundation_factory.TextureFormat
<span class="pre">
=
<span class="pre">
<TextureFormat.???:
<span class="pre">
0>,
<span class="pre">
stride:
<span class="pre">
int
<span class="pre">
=
<span class="pre">
-1
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
Sets Python sequence as byte data. The image provider will recognize flattened color values, or sequence within sequence and convert it into an image.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.ByteImageProvider.set_bytes_data_from_gpu">
<span class="sig-name descname">
<span class="pre">
set_bytes_data_from_gpu
<span class="sig-paren">
(
<em class="sig-param">
<span class="pre">
self:
<span class="pre">
omni.ui._ui.ByteImageProvider,
<span class="pre">
gpu_bytes:
<span class="pre">
int,
<span class="pre">
sizes:
<span class="pre">
List[int],
<span class="pre">
format:
<span class="pre">
omni.gpu_foundation_factory._gpu_foundation_factory.TextureFormat
<span class="pre">
=
<span class="pre">
<TextureFormat.RGBA8_UNORM:
<span class="pre">
11>,
<span class="pre">
stride:
<span class="pre">
int
<span class="pre">
=
<span class="pre">
-1
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
Sets byte data from a copy of gpu memory at gpuBytes.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.ByteImageProvider.set_data">
<span class="sig-name descname">
<span class="pre">
set_data
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<a class="reference internal" href="#omni.ui.ByteImageProvider" title="omni.ui._ui.ByteImageProvider">
<span class="pre">
omni.ui._ui.ByteImageProvider
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg0
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
List
<span class="p">
<span class="pre">
[
<span class="pre">
int
<span class="p">
<span class="pre">
]
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg1
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
List
<span class="p">
<span class="pre">
[
<span class="pre">
int
<span class="p">
<dd>
### omni.ui.ByteImageProvider.set_data
- [DEPRECATED FUNCTION]
### omni.ui.ByteImageProvider.set_data_array
- `set_data_array(self: omni.ui._ui.ByteImageProvider, arg0: numpy.ndarray[numpy.uint8], arg1: List[int]) -> None`
### omni.ui.ByteImageProvider.set_raw_bytes_data
- `set_raw_bytes_data(self: omni.ui._ui.ByteImageProvider, raw_bytes: capsule, sizes: List[int], format: omni.gpu_foundation_factory._gpu_foundation_factory.TextureFormat = <TextureFormat.RGBA8_UNORM: 11>, stride: int = -1) -> None`
- Sets byte data that the image provider will turn raw pointer array into an image. | 5,162 |
omni.ui.CanvasFrame.md | # CanvasFrame
## CanvasFrame
```
```markdown
Bases: [omni.ui.Frame](omni.ui.Frame.html#omni.ui.Frame)
CanvasFrame is the widget that allows the user to pan and zoom its children with a mouse. It has the layout that can be infinitely moved in any direction.
### Methods
- **__init__(self, **kwargs)**
- Constructs CanvasFrame.
- **screen_to_canvas(self, x, y)**
- Transforms screen-space coordinates to canvas-space
- **screen_to_canvas_x(self, x)**
- Transforms screen-space X to canvas-space X.
- **screen_to_canvas_y(self, y)**
- Transforms screen-space Y to canvas-space Y.
- **set_pan_key_shortcut(self, mouse_button, ...)**
- Specify the mouse button and key to pan the canvas.
- **set_pan_x_changed_fn(self, ...)**
- (Function details not provided in the HTML snippet)
| Method | Description |
| --- | --- |
| `set_pan_x_changed_fn(self, fn)` | The horizontal offset of the child item. |
| `set_pan_y_changed_fn(self, fn)` | The vertical offset of the child item. |
| `set_zoom_changed_fn(self, fn)` | The zoom level of the child item. |
| `set_zoom_key_shortcut(self, mouse_button, ...)` | Specify the mouse button and key to zoom the canvas. |
### Attributes
| Attribute | Description |
| --- | --- |
| `compatibility` | This boolean property controls the behavior of CanvasFrame. |
| `draggable` | Provides a convenient way to make the content draggable and zoomable. |
| `pan_x` | The horizontal offset of the child item. |
| `pan_y` | The vertical offset of the child item. |
| `smooth_zoom` | When true, zoom is smooth like in Bifrost even if the user is using mouse wheen that doesn't provide smooth scrolling. |
| `zoom` | The zoom level of the child item. |
| `zoom_max` | The zoom maximum of the child item. |
| `zoom_min` | The zoom minimum of the child item. |
### omni.ui.CanvasFrame.__init__
`__init__(self, **kwargs) -> None`
Constructs CanvasFrame.
#### Keyword Arguments:
- `kwargs` dict: See below
- `pan_x`
- The horizontal offset of the child item.
- `pan_y`
- The vertical offset of the child item.
- `zoom`
- The zoom minimum of the child item.
- `zoom_min`
- The zoom maximum of the child item.
- `zoom_max`
- The zoom level of the child item.
- `compatibility`
- This boolean property controls the behavior of CanvasFrame. When set to true, the widget will function in the old way. When set to false, the widget will use a newer and faster implementation. This variable is included as a transition period to ensure that the update does not break any existing functionality. Please be aware that the old behavior may be deprecated in the future, so it is recommended to set this variable to false once you have thoroughly tested the new implementation.
- `pan_x_changed_fn`
- The horizontal offset of the child item.
- `pan_y_changed_fn`
- The vertical offset of the child item.
- `zoom_changed_fn`
- The zoom level of the child item.
- `draggable`
- Provides a convenient way to make the content draggable and zoomable.
- `horizontal_clipping`
- When the content of the frame is bigger than the frame the exceeding part is not drawn if the clipping is on. It only works for horizontal direction.
- `vertical_clipping`
- When the content of the frame is bigger than the frame the exceeding part is not drawn if the clipping is on. It only works for vertical direction.
- `separate_window`
- A special mode where the child is placed to the transparent borderless window. We need it to be able to place the UI to the exact stacking order between other windows.
- `raster_policy`
- Determine how the content of the frame should be rasterized.
- `build_fn`
- Set the callback that will be called once the frame is visible and the content of the callback will override the frame child. It’s useful for lazy load.
- `width` (ui.Length)
- This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
- `height` (ui.Length)
- This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
- `name` (str)
- The name of the widget that user can set.
- `style_type_name_override` (str)
- By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
- `identifier` (str)
- An optional identifier of the widget we can use to refer to it in queries.
- `visible` (bool)
- This property holds whether the widget is visible.
- `visibleMin` (float)
- If the current zoom factor and DPI is less than this value, the widget is not visible.
- `visibleMax` (float)
- If the current zoom factor and DPI is bigger than this value, the widget is not visible.
- `tooltip` (str)
- Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
- `tooltip_fn` (Callable)
- Set dynamic tooltip that will be created dynamically the first time it is needed. The function is called inside a ui.Frame scope that the widget will be parented correctly.
- `tooltip_offset_x` (float)
- Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non-zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
- `tooltip_offset_y` (float)
- Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non-zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dl>
<dt>`tooltip_offset_y`
<span class="classifier">
float`
<dd>
<p>
Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>`enabled`
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
<dt>`selected`
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eSelected state of the style.
<dt>`checked`
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
<dt>`dragging`
<span class="classifier">
bool`
<dd>
<p>
This property holds if the widget is being dragged.
<dt>`opaque_for_mouse_events`
<span class="classifier">
bool`
<dd>
<p>
If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
<dt>`skip_draw_when_clipped`
<span class="classifier">
bool`
<dd>
<p>
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
<dt>`mouse_moved_fn`
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
<dt>`mouse_pressed_fn`
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
<dt>`mouse_released_fn`
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>`mouse_double_clicked_fn`
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>`mouse_wheel_fn`
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>`mouse_hovered_fn`
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>`drag_fn`
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>`accept_drop_fn`
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>`drop_fn`
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>`computed_content_size_changed_fn`
<span class="classifier">
Callable`
<dd>
<p>
Called when the size of the widget is changed.
Tuple
[
float
,
float
]
Transforms screen-space coordinates to canvas-space
screen_to_canvas_x(self: omni.ui._ui.CanvasFrame, x: float) -> float
Transforms screen-space X to canvas-space X.
screen_to_canvas_y(self: omni.ui._ui.CanvasFrame, y: float) -> float
Transforms screen-space Y to canvas-space Y.
set_pan_key_shortcut(self: omni.ui._ui.CanvasFrame, mouse_button: int, key_flag: int) -> None
Specify the mouse button and key to pan the canvas.
set_pan_x_changed_fn(self: omni.ui._ui.CanvasFrame, fn: Callable[[float]])
The horizontal offset of the child item.
The vertical offset of the child item.
The zoom level of the child item.
The zoom level of the child item.
Specify the mouse button and key to zoom the canvas.
This boolean property controls the behavior of CanvasFrame. When set to true, the widget will function in the old way. When set to false, the widget will use a newer and faster implementation. This variable is included as a transition period to ensure that the update does not break any existing functionality. Please be aware that the old behavior may be deprecated in the future, so it is recommended to set this variable to false once you have thoroughly tested the new implementation.
Provides a convenient way to make the content draggable and zoomable.
The horizontal offset of the child item.
The vertical offset of the child item.
When true, zoom is smooth like in Bifrost even if the user is using mouse wheen that doesn’t provide smooth scrolling.
The zoom level of the child item.
The zoom maximum of the child item.
The zoom minimum of the child item. | 12,249 |
omni.ui.CheckBox.md | # CheckBox
## CheckBox
A CheckBox is an option button that can be switched on (checked) or off (unchecked). Checkboxes are typically used to represent features in an application that can be enabled or disabled without affecting others.
The checkbox is implemented using the model-view pattern. The model is the central component of this system. It is the application’s dynamic data structure independent of the widget. It directly manages the data, logic, and rules of the checkbox. If the model is not specified, the simple one is created automatically when the object is constructed.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self[, model])` | CheckBox with specified model. |
### Attributes
| Attribute | Description |
|-----------|-------------|
## CheckBox.__init__
`__init__(self: omni.ui._ui.CheckBox, model: omni.ui._ui.AbstractValueModel = None)`
### CheckBox with specified model. If model is not specified, it’s using the default one.
**kwargs (dict)
- See below
### Keyword Arguments:
- `width (ui.Length)`
- This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
- `height (ui.Length)`
- This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
- `name (str)`
- The name of the widget that user can set.
- `style_type_name_override (str)`
- By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
- `identifier (str)`
- An optional identifier of the widget we can use to refer to it in queries.
- `visible (bool)`
- This property holds whether the widget is visible.
- `visibleMin (float)`
- If the current zoom factor and DPI is less than this value, the widget is not visible.
- `visibleMax (float)`
- If the current zoom factor and DPI is bigger than this value, the widget is not visible.
- `tooltip (str)`
- Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
- `tooltip_fn (Callable)`
- Set dynamic tooltip that will be created dynamically the first time it is needed. The function is called inside a ui.Frame scope that the widget will be parented correctly.
- `tooltip_offset_x (float)`
- Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non-zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
- `tooltip_offset_y (float)`
- Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non-zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
- `enabled (bool)`
- This property holds whether the widget is enabled. In general, an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
- `selected (bool)`
- This property holds a flag that specifies the widget has to use eSelected state of the style.
- `checked (bool)`
- This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
- `dragging (bool)`
- This property holds if the widget is being dragged.
- `opaque_for_mouse_events (bool)`
- If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
- `skip_draw_when_clipped (bool)`
- The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
- `mouse_moved_fn (Callable)`
- Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
- `mouse_pressed_fn (Callable)`
- Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
<dl>
<dt>
`mouse_released_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_double_clicked_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_wheel_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_hovered_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>
`drag_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>
`accept_drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>
`drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
`computed_content_size_changed_fn
<span class="classifier">
Callable`
<dd>
<p>
Called when the size of the widget is changed.
| 7,006 |
omni.ui.Circle.md | # Circle
## Circle
The Circle widget provides a colored circle to display.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, **kwargs)` | Constructs Circle. |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `alignment` | This property holds the alignment of the circle when the fill policy is ePreserveAspectFit or ePreserveAspectCrop. |
| `arc` | This property is the way to draw a half or a quarter of the circle. |
| `radius` | This property holds the radius of the circle when the fill policy is eFixed or eFixedCrop. |
| `size_policy` | Define what happens when the source image has a different size than the item. |
<em class="sig-param">
<span class="n">
<span class="pre">
self
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
omni.ui._ui.Circle
,
<em class="sig-param">
<span class="o">
<span class="pre">
**
<span class="n">
<span class="pre">
kwargs
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
Constructs Circle.
<blockquote>
<div>
<dl class="simple">
<dt>
`kwargs
<span class="classifier">
dict`
<dd>
<p>
See below
<p>
### Keyword Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`alignment :`
<dd>
<p>
This property holds the alignment of the circle when the fill policy is ePreserveAspectFit or ePreserveAspectCrop. By default, the circle is centered.
<dt>
`radius :`
<dd>
<p>
This property holds the radius of the circle when the fill policy is eFixed or eFixedCrop. By default, the circle radius is 0.
<dt>
`arc :`
<dd>
<p>
This property is the way to draw a half or a quarter of the circle. When it’s eLeft, only left side of the circle is rendered. When it’s eLeftTop, only left top quarter is rendered.
<dt>
`size_policy :`
<dd>
<p>
Define what happens when the source image has a different size than the item.
<dt>
`width
<span class="classifier">
ui.Length`
<dd>
<p>
This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
<dt>
`height
<span class="classifier">
ui.Length`
<dd>
<p>
This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
<dt>
`name
<span class="classifier">
str`
<dd>
<p>
The name of the widget that user can set.
<dt>
`style_type_name_override
<span class="classifier">
str`
<dd>
<p>
By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
<dt>
`identifier
<span class="classifier">
str`
<dd>
<p>
An optional identifier of the widget we can use to refer to it in queries.
<dt>
`visible
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is visible.
<dt>
`visibleMin
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is less than this value, the widget is not visible.
<dt>
`visibleMax
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is bigger than this value, the widget is not visible.
<dt>
`tooltip
<span class="classifier">
str`
<dd>
<p>
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
<dt>
`tooltip_fn
<span class="classifier">
Callable`
<dd>
<p>
Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
<dt>
`tooltip_offset_x
<span class="classifier">
float`
<dd>
<p>
Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`tooltip_offset_y
<span class="classifier">
float`
<dd>
<p>
Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`enabled
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
<dt>
`selected
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eSelected state of the style.
<dt>
`checked
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
<dt>
`dragging
<span class="classifier">
bool`
<dd>
<p>
This property holds if the widget is being dragged.
<dt>
`opaque_for_mouse_events
bool
If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
skip_draw_when_clipped
bool
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
mouse_moved_fn
Callable
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
mouse_pressed_fn
Callable
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
mouse_released_fn
Callable
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
mouse_double_clicked_fn
Callable
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
mouse_wheel_fn
Callable
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
mouse_hovered_fn
Callable
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
drag_fn
Callable
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
accept_drop_fn
Callable
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
drop_fn
Callable
Specify that this Widget accepts drops and set the callback to the drop operation.
computed_content_size_changed_fn
Callable
Called when the size of the widget is changed.
alignment
This property holds the alignment of the circle when the fill policy is ePreserveAspectFit or ePreserveAspectCrop. By default, the circle is centered.
arc
This property is the way to draw a half or a quarter of the circle. When it’s eLeft, only left side of the circle is rendered. When it’s eLeftTop, only left top quarter is rendered.
radius
This property holds the radius of the circle when the fill policy is eFixed or eFixedCrop. By default, the circle radius is 0.
size_policy
Define what happens when the source image has a different size than the item. | 9,590 |
omni.ui.CircleSizePolicy.md | # CircleSizePolicy
## CircleSizePolicy
- **Bases:** `pybind11_object`
- **Description:** Define what happens when the source image has a different size than the item.
- **Members:**
- STRETCH
- FIXED
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, value)` | |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `FIXED` | |
| `STRETCH` | |
| `name` | |
| `value` | |
### `__init__` Method
- **Parameters:**
- `self`: `omni.ui._ui.CircleSizePolicy`
```
<em class="sig-param">
<span class="n">
<span class="pre">
value
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
int
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
name
| 1,066 |
omni.ui.Classes.md | # omni.ui Classes
## Classes Summary:
| Class | Description |
|-------|-------------|
| [AbstractField](omni.ui/omni.ui.AbstractField.html) | The abstract widget that is base for any field, which is a one-line text editor. |
| [AbstractItem](omni.ui/omni.ui.AbstractItem.html) | The object that is associated with the data entity of the AbstractItemModel. |
| [AbstractItemDelegate](omni.ui/omni.ui.AbstractItemDelegate.html) | AbstractItemDelegate is used to generate widgets that display and edit data items from a model. |
| [AbstractItemModel](omni.ui/omni.ui.AbstractItemModel.html) | The central component of the item widget. It is the application’s dynamic data structure, independent of the user interface, and it directly manages the nested data. It follows closely model-view pattern. It’s abstract, and it defines the standard interface to be able to interoperate with the components of the model-view architecture. It is not supposed to be instantiated directly. Instead, the user should subclass it to create a new model. |
| [AbstractMultiField](omni.ui/omni.ui.AbstractMultiField.html) | AbstractMultiField is the abstract class that has everything to create a custom widget per model item. |
| [AbstractSlider](omni.ui/omni.ui.AbstractSlider.html) | The abstract widget that is base for drags and sliders. |
| [AbstractValueModel](omni.ui/omni.ui.AbstractValueModel.html) | |
| [Alignment](omni.ui/omni.ui.Alignment.html) | Members: |
| [ArrowHelper](omni.ui/omni.ui.ArrowHelper.html) | The ArrowHelper widget provides a colored rectangle to display. |
| [ArrowType](omni.ui/omni.ui.ArrowType.html) | Members: |
| Widget Name | Description |
|-------------|-------------|
| Axis | Members: |
| BezierCurve | Smooth curve that can be scaled infinitely. |
| Button | The Button widget provides a command button. |
| ByteImageProvider | doc |
| CanvasFrame | CanvasFrame is the widget that allows the user to pan and zoom its children with a mouse. It has the layout that can be infinitely moved in any direction. |
| CheckBox | A CheckBox is an option button that can be switched on (checked) or off (unchecked). Checkboxes are typically used to represent features in an application that can be enabled or disabled without affecting others. |
| Circle | The Circle widget provides a colored circle to display. |
| CircleSizePolicy | Define what happens when the source image has a different size than the item. |
| CollapsableFrame | CollapsableFrame is a frame widget that can hide or show its content. It has two states expanded and collapsed. When it’s collapsed, it looks like a button. If it’s expanded, it looks like a button and a frame with the content. It’s handy to group properties, and temporarily hide them to get more space for something else. |
| ColorStore | A singleton that stores all the UI Style color properties of omni.ui. |
| ColorWidget | The ColorWidget widget is a button that displays the color from the item model and can open a picker window to change the color. |
| ComboBox | The ComboBox widget is a combined button and a drop-down list. |
| Container | Base class for all UI containers. Container can hold one or many other :class:`omni.ui.Widget` s |
| CornerFlag | Members: |
| Direction | Members: |
| DockPolicy | Members: |
| DockPosition | Members: |
| DockPreference | Members: |
| DockSpace | The DockSpace class represents Dock Space for the OS Window. |
| DynamicTextureProvider | doc |
| Ellipse | Constructs Ellipse. |
| FillPolicy | Members: |
| FloatDrag | |
- FloatDrag
- The drag widget that looks like a field but it’s possible to change the value with dragging.
- FloatField
- The FloatField widget is a one-line text editor with a string model.
- FloatSlider
- The slider is the classic widget for controlling a bounded value. It lets the user move a slider handle along a horizontal groove and translates the handle’s position into a float value within the legal range.
- FloatStore
- A singleton that stores all the UI Style float properties of omni.ui.
- FocusPolicy
- Members:
- FontStyle
- Supported font styles.
- Fraction
- Fraction length is made to take the space of the parent widget, divides it up into a row of boxes, and makes each child widget fill one box.
- Frame
- The Frame is a widget that can hold one child widget.
- FreeBezierCurve
- Smooth curve that can be scaled infinitely.
- FreeCircle
- The Circle widget provides a colored circle to display.
- FreeEllipse
- The Ellipse widget provides a colored ellipse to display.
- FreeLine
- The Line widget provides a colored line to display.
- FreeRectangle
- The Rectangle widget provides a colored rectangle to display.
- FreeTriangle
- The Triangle widget provides a colored triangle to display.
- Grid
- Grid is a container that arranges its child views in a grid. The grid vertical/horizontal direction is the direction the grid size growing with creating more children.
- HGrid
- Shortcut for Grid{eLeftToRight}. The grid grows from left to right with the widgets placed.
- HStack
- Shortcut for Stack{eLeftToRight}. The widgets are placed in a row, with suitable sizes.
- Image
- The Image widget displays an image.
- ImageProvider
- ImageProvider class, the goal of this class is to provide ImGui reference for the image to be rendered.
- ImageWithProvider
- The Image widget displays an image.
- Inspector
- Inspector is the helper to check the internal state of the widget. It’s not recommended to use it for the routine UI.
- IntDrag
- The drag widget that looks like a field but it’s possible to change the value with dragging.
IntField
========
The IntField widget is a one-line text editor with a string model.
IntSlider
---------
The slider is the classic widget for controlling a bounded value. It lets the user move a slider handle along a horizontal groove and translates the handle’s position into an integer value within the legal range.
InvisibleButton
---------------
The InvisibleButton widget provides a transparent command button.
ItemModelHelper
---------------
The ItemModelHelper class provides the basic functionality for item widget classes.
IwpFillPolicy
--------------
Members:
Label
-----
The Label widget provides a text to display.
Length
------
OMNI.UI has several different units for expressing a length.
Line
----
The Line widget provides a colored line to display.
MainWindow
----------
The MainWindow class represents Main Window for the Application, draw optional MainMenuBar and StatusBar.
Menu
----
The Menu class provides a menu widget for use in menu bars, context menus, and other popup menus.
MenuBar
-------
The MenuBar class provides a MenuBar at the top of the Window, could also be the MainMenuBar of the MainWindow.
MenuDelegate
------------
MenuDelegate is used to generate widgets that represent the menu item.
MenuHelper
----------
The helper class for the menu that draws the menu line.
MenuItem
--------
A MenuItem represents the items the Menu consists of.
MenuItemCollection
-------------------
The MenuItemCollection is the menu that unchecks children when one of them is checked.
MultiFloatDragField
--------------------
MultiFloatDragField is the widget that has a sub widget (FloatDrag) per model item.
MultiFloatField
----------------
MultiFloatField is the widget that has a sub widget (FloatField) per model item.
MultiIntDragField
------------------
MultiIntDragField is the widget that has a sub widget (IntDrag) per model item.
MultiIntField
--------------
MultiIntField is the widget that has a sub widget (IntField) per model item.
MultiStringField
-----------------
MultiStringField is the widget that has a sub widget (StringField) per model item.
OffsetLine
----------
The free widget is the widget that is independent of the layout. It draws the line stuck to the bounds of other widgets.
- **Percent** - Percent is the length in percents from the parent widget.
- **Pixel** - Pixel length is exact length in pixels.
- **Placer** - The Placer class place a single widget to a particular position based on the offet.
- **Plot** - The Plot widget provides a line/histogram to display.
- **ProgressBar** - A progressbar is a classic widget for showing the progress of an operation.
- **RadioButton** - RadioButton is the widget that allows the user to choose only one of a predefined set of mutually exclusive options.
- **RadioCollection** - Radio Collection is a class that groups RadioButtons and coordinates their state.
- **RasterImageProvider** - doc
- **RasterPolicy** - Used to set the rasterization behaviour.
- **Rectangle** - The Rectangle widget provides a colored rectangle to display.
- **ScrollBarPolicy** - Members:
- **ScrollingFrame** - The ScrollingFrame class provides the ability to scroll onto another widget.
- **Separator** - The Separator class provides blank space.
- **ShadowFlag** - Members:
- **Shape** - The Shape widget provides a base class for all the Shape Widget. Currently implemented are Rectangle, Circle, Triangle, Line, Ellipse and BezierCurve.
- **ShapeAnchorHelper** - The ShapeAnchorHelper provides common functionality for Shape Anchors.
- **SimpleBoolModel** - A very simple bool model.
- **SimpleFloatModel** - A very simple double model.
- **SimpleIntModel** - A very simple Int model.
- **SimpleStringModel** - A very simple value model that holds a single string.
- **SliderDrawMode** - Members:
- **Spacer** - The Spacer class provides blank space.
- **Stack** -
| Widget Name | Description |
|-------------|-------------|
| Stack | The Stack class lines up child widgets horizontally, vertically or sorted in a Z-order. |
| StringField | The StringField widget is a one-line text editor with a string model. |
| StringStore | A singleton that stores all the UI Style string properties of omni.ui. |
| Style | A singleton that controls the global style of the session. |
| TextureFormat | Members: |
| ToolBar | The ToolBar class represents a window in the underlying windowing system that as some fixed size property. |
| ToolBarAxis | Members: |
| ToolButton | ToolButton is functionally similar to Button, but provides a model that determines if the button is checked. This button toggles between checked (on) and unchecked (off) when the user clicks it. |
| TreeView | TreeView is a widget that presents a hierarchical view of information. Each item can have a number of subitems. An indentation often visualizes this in a list. An item can be expanded to reveal subitems, if any exist, and collapsed to hide subitems. |
| Triangle | The Triangle widget provides a colored triangle to display. |
| Type | Members: |
| UIPreferencesExtension | |
| UIntDrag | |
| UIntSlider | The slider is the classic widget for controlling a bounded value. It lets the user move a slider handle along a horizontal groove and translates the handle’s position into an integer value within the legal range. |
| UnitType | Unit types. |
| VGrid | Shortcut for Grid{eTopToBottom}. The grid grows from top to bottom with the widgets placed. |
| VStack | Shortcut for Stack{eTopToBottom}. The widgets are placed in a column, with suitable sizes. |
| ValueModelHelper | The ValueModelHelper class provides the basic functionality for value widget classes. ValueModelHelper class is the base class for every standard widget that uses a AbstractValueModel. ValueModelHelper is an abstract class and itself cannot be instantiated. It provides a standard interface for interoperating with models. |
| VectorImageProvider | doc |
| Widget | The Widget class is the base class of all user interface objects. |
| WidgetMouseDropEvent | Holds the data which is sent when a drag and drop action is completed. |
| Window | |
The Window class represents a window in the underlying windowing system.
WindowHandle is a handle object to control any of the windows in Kit. It can be created any time, and if it’s destroyed, the source window doesn’t disappear.
Workspace object provides access to the windows in Kit.
Shortcut for Stack{eBackToFront}. The widgets are placed sorted in a Z-order in top right corner with suitable sizes. | 12,147 |
omni.ui.CollapsableFrame.md | # CollapsableFrame
CollapsableFrame is a frame widget that can hide or show its content. It has two states expanded and collapsed. When it’s collapsed, it looks like a button. If it’s expanded, it looks like a button and a frame with the content. It’s handy to group properties, and temporarily hide them to get more space for something else.
## Methods
- `__init__(self[, title])`
- Constructs CollapsableFrame.
- `call_build_header_fn(self, arg0, arg1)`
- Set dynamic header that will be created dynamically when it is needed.
- `has_build_header_fn(self)`
- Set dynamic header that will be created dynamically when it is needed.
- `set_build_header_fn(self, fn)`
- Set dynamic header that will be created dynamically when it is needed.
- `set_collapsed_changed_fn(self, fn)`
- The state of the CollapsableFrame.
## Attributes
| | |
| ------ | --------------------------------------------------------------- |
| alignment | This property holds the alignment of the label in the default header. |
| collapsed | The state of the CollapsableFrame. |
| title | The header text. |
## omni.ui.CollapsableFrame.\_\_init\_\_
Constructs CollapsableFrame.
### Arguments:
- `text :` The text for the caption of the frame.
- `kwargs dict` See below
### Keyword Arguments:
- `collapsed` The state of the CollapsableFrame.
- `title` The header text.
- `alignment` This property holds the alignment of the label in the default header. By default, the contents of the label are left-aligned and vertically-centered.
- `build_header_fn` Set dynamic header that will be created dynamically when it is needed. The function is called inside a ui.Frame scope that the widget will be parented correctly.
- `collapsed_changed_fn` The state of the CollapsableFrame.
- `horizontal_clipping` When the content of the frame is bigger than the frame the exceeding part is not drawn if the clipping is on. It only works for horizontal direction.
- `vertical_clipping` When the content of the frame is bigger than the frame the exceeding part is not drawn if the clipping is on. It only works for vertical direction.
- `separate_window` A special mode where the child is placed to the transparent borderless window. We need it to be able to place the UI to the exact stacking order between other windows.
- `raster_policy` Determine how the content of the frame should be rasterized.
- `build_fn` Set the callback that will be called once the frame is visible and the content of the callback will override the frame child. It’s useful for lazy load.
- `width ui.Length` This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
- `height`
<span class="classifier">
ui.Length`
<dd>
<p>
This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
<dt>
`name
<span class="classifier">
str`
<dd>
<p>
The name of the widget that user can set.
<dt>
`style_type_name_override
<span class="classifier">
str`
<dd>
<p>
By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
<dt>
`identifier
<span class="classifier">
str`
<dd>
<p>
An optional identifier of the widget we can use to refer to it in queries.
<dt>
`visible
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is visible.
<dt>
`visibleMin
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is less than this value, the widget is not visible.
<dt>
`visibleMax
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is bigger than this value, the widget is not visible.
<dt>
`tooltip
<span class="classifier">
str`
<dd>
<p>
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
<dt>
`tooltip_fn
<span class="classifier">
Callable`
<dd>
<p>
Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
<dt>
`tooltip_offset_x
<span class="classifier">
float`
<dd>
<p>
Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`tooltip_offset_y
<span class="classifier">
float`
<dd>
<p>
Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`enabled
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
<dt>
`selected
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eSelected state of the style.
<dt>
`checked
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
<dt>
`dragging
<span class="classifier">
bool`
<dd>
<p>
This property holds if the widget is being dragged.
<dt>
`opaque_for_mouse_events
<span class="classifier">
bool`
<dd>
<p>
If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
<dt>
`skip_draw_when_clipped
<span class="classifier">
bool`
<dd>
<p>
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
<dt>
`mouse_moved_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
<dt>
`mouse_pressed_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
<dt>
`mouse_released_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_double_clicked_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_wheel_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_hovered_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dl>
<dt>
`drag_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>
`accept_drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>
`drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
`computed_content_size_changed_fn
<span class="classifier">
Callable`
<dd>
<p>
Called when the size of the widget is changed.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.CollapsableFrame.call_build_header_fn">
<span class="sig-name descname">
<span class="pre">
call_build_header_fn
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<a class="reference internal" href="#omni.ui.CollapsableFrame" title="omni.ui._ui.CollapsableFrame">
<span class="pre">
omni.ui._ui.CollapsableFrame
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg0
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
bool
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg1
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
str
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
Set dynamic header that will be created dynamiclly when it is needed. The function is called inside a ui.Frame scope that the widget will be parented correctly.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.CollapsableFrame.has_build_header_fn">
<span class="sig-name descname">
<span class="pre">
has_build_header_fn
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<a class="reference internal" href="#omni.ui.CollapsableFrame" title="omni.ui._ui.CollapsableFrame">
<span class="pre">
omni.ui._ui.CollapsableFrame
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
bool
<dd>
<p>
Set dynamic header that will be created dynamiclly when it is needed. The function is called inside a ui.Frame scope that the widget will be parented correctly.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.CollapsableFrame.set_build_header_fn">
<span class="sig-name descname">
<span class="pre">
set_build_header_fn
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<a class="reference internal" href="#omni.ui.CollapsableFrame" title="omni.ui._ui.CollapsableFrame">
<span class="pre">
omni.ui._ui.CollapsableFrame
,
<em class="sig-param">
<span class="n">
<span class="pre">
fn
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
Callable
<span class="p">
<span class="pre">
[
<span class="p">
<span class="pre">
[
<span class="pre">
bool
<span class="p">
<span class="pre">
,
<span class="w">
<span class="pre">
str
<span class="p">
<span class="pre">
]
<span class="p">
<span class="pre">
,
<span class="w">
<span class="pre">
None
<span class="p">
<span class="pre">
]
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
Set dynamic header that will be created dynamiclly when it is needed. The function is called inside a ui.Frame scope that the widget will be parented correctly.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.CollapsableFrame.set_collapsed_changed_fn">
<span class="sig-name descname">
<span class="pre">
set_collapsed_changed_fn
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<a class="reference internal" href="#omni.ui.CollapsableFrame" title="omni.ui._ui.CollapsableFrame">
<span class="pre">
omni.ui._ui.CollapsableFrame
,
<em class="sig-param">
<span class="n">
<span class="pre">
fn
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
Callable
<span class="p">
<span class="pre">
[
<span class="p">
<span class="pre">
[
<span class="pre">
bool
<span class="p">
<span class="pre">
,
<span class="w">
<span class="pre">
str
<span class="p">
<span class="pre">
]
<span class="p">
<span class="pre">
,
<span class="w">
<span class="pre">
None
<span class="p">
<span class="pre">
]
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
Set dynamic header that will be created dynamiclly when it is needed. The function is called inside a ui.Frame scope that the widget will be parented correctly.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.CollapsableFrame.set_collapsed_changed_fn">
<span class="sig-name descname">
<span class="pre">
set_collapsed_changed_fn
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
omni.ui._ui.CollapsableFrame
,
<em class="sig-param">
<span class="n">
<span class="pre">
fn
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
Callable
<span class="p">
<span class="pre">
[
<span class="p">
<span class="pre">
[
<span class="pre">
bool
<span class="p">
<span class="pre">
]
<span class="p">
<span class="pre">
,
<span class="w">
<span class="pre">
None
<span class="p">
<span class="pre">
]
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
The state of the CollapsableFrame.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.CollapsableFrame.alignment">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
alignment
<dd>
<p>
This property holds the alignment of the label in the default header. By default, the contents of the label are left-aligned and vertically-centered.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.CollapsableFrame.collapsed">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
collapsed
<dd>
<p>
The state of the CollapsableFrame.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.CollapsableFrame.title">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
title
<dd>
<p>
The header text.
| 18,742 |
omni.ui.ColorStore.md | # ColorStore
## Methods
- `__init__(*args, **kwargs)`
- `find(name)`
- Return the index of the color with specific name.
- `store(name, color)`
- Save the color by name.
## omni.ui.ColorStore.find
Return the index of the color with specific name.
## omni.ui.ColorStore.store
Save the color by name. | 307 |
omni.ui.ColorWidget.md | # ColorWidget
The ColorWidget widget is a button that displays the color from the item model and can open a picker window to change the color.
## Methods
- `__init__(*args, **kwargs)`
- Overloaded function.
## Attributes
## __init__
- `__init__(*args, **kwargs)`
- Overloaded function.
- `__init__(self: omni.ui._ui.ColorWidget, **kwargs) -> None`
- `__init__(self: omni.ui._ui.ColorWidget, arg0: omni.ui._ui.AbstractItemModel, **kwargs) -> None`
- `__init__(self: omni.ui._ui.ColorWidget, arg0: float, arg1: float, arg2: float, **kwargs) -> None`
- `__init__(self: omni.ui._ui.ColorWidget, arg0: float, arg1: float, arg2: float, arg3: float, **kwargs) -> None`
- Construct ColorWidget.
### Keyword Arguments:
- `width` (ui.Length): This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
- `height` (ui.Length): This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
- `name` (str): The name of the widget that user can set.
- `style_type_name_override` (str): By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
- `identifier` (str): An optional identifier of the widget we can use to refer to it in queries.
- `visible` (bool): This property holds whether the widget is visible.
- `visibleMin` (float): If the current zoom factor and DPI is less than this value, the widget is not visible.
- `visibleMax` (float): If the current zoom factor and DPI is bigger than this value, the widget is not visible.
- `tooltip` (str): Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style.
- `tooltip_fn` (Callable): Set dynamic tooltip that will be created dynamically the first time it is needed. The function is called inside a ui.Frame scope that the widget will be parented correctly.
- `tooltip_offset_x` (float): Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non-zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
- `tooltip_offset_y` (float): Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non-zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
- `enabled` (bool): This property holds whether the widget is enabled. In general, an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
- `selected` (bool): This property holds a flag that specifies the widget has to use eSelected state of the style.
- `checked` (bool): This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
- `dragging` (bool): This property holds if the widget is being dragged.
- `opaque_for_mouse_events` (bool): If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either.
- `skip_draw_when_clipped` (bool): The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
- `mouse_moved_fn` (Callable): Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier).
- `mouse_pressed_fn` (Callable): Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
- `mouse_released_fn` (Callable): Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier).
- `mouse_double_clicked_fn` (Callable): Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier).
<dl>
<dt>
`mouse_wheel_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_hovered_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>
`drag_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>
`accept_drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>
`drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
`computed_content_size_changed_fn
<span class="classifier">
Callable`
<dd>
<p>
Called when the size of the widget is changed.
| 6,496 |
omni.ui.color_utils.AbstractShade.md | # AbstractShade
## AbstractShade
```python
class omni.ui.color_utils.AbstractShade
```
The implementation of shades for custom style parameter type.
The user has to reimplement methods _store and _find to set/get the value in the specific store.
### Methods
| Method | Description |
|--------|-------------|
| `__init__()` | |
| `set_shade(name=None)` | Set the default shade. |
| `shade(default=None)` | Save the given shade, pick the color and apply it to ui.ColorStore. |
```python
def __init__():
pass
```
```python
def set_shade(name=None):
"""Set the default shade."""
pass
```
```python
def shade(default=None):
"""Save the given shade, pick the color and apply it to ui.ColorStore."""
pass
```
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.color_utils.AbstractShade.set_shade">
<span class="sig-name descname">
<span class="pre">
set_shade
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
shade
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
Optional
<span class="p">
<span class="pre">
[
<span class="pre">
str
<span class="p">
<span class="pre">
]
<span class="w">
<span class="o">
<span class="pre">
=
<span class="w">
<span class="default_value">
<span class="pre">
None
<span class="sig-paren">
)
<dd>
<p>
Set the default shade.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.color_utils.AbstractShade.shade">
<span class="sig-name descname">
<span class="pre">
shade
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
default
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
Optional
<span class="p">
<span class="pre">
[
<span class="pre">
Any
<span class="p">
<span class="pre">
]
<span class="w">
<span class="o">
<span class="pre">
=
<span class="w">
<span class="default_value">
<span class="pre">
None
,
<em class="sig-param">
<span class="o">
<span class="pre">
**
<span class="n">
<span class="pre">
kwargs
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
str
<dd>
<p>
Save the given shade, pick the color and apply it to ui.ColorStore.
| 3,359 |
omni.ui.color_utils.Classes.md | # omni.ui.color_utils Classes
## Classes Summary:
| Class Name | Description |
|------------|-------------|
| [AbstractShade](omni.ui.color_utils/omni.ui.color_utils.AbstractShade.html) | The implementation of shades for custom style parameter type. |
| [ColorShade](omni.ui.color_utils/omni.ui.color_utils.ColorShade.html) | | | 330 |
omni.ui.color_utils.Functions.md | # omni.ui.color_utils Functions
## Functions Summary:
| Function | Description |
|----------|-------------|
| [Singleton](omni.ui.color_utils/omni.ui.color_utils.Singleton.html) | A singleton decorator | | 205 |
omni.ui.color_utils.md | # omni.ui.color_utils
## Classes Summary
- **AbstractShade**
- The implementation of shades for custom style parameter type.
- **ColorShade**
## Functions Summary
- **Singleton**
- A singleton decorator | 210 |
omni.ui.ComboBox.md | # ComboBox
## ComboBox
The ComboBox widget is a combined button and a drop-down list.
A combo box is a selection widget that displays the current item and can pop up a list of selectable items.
The ComboBox is implemented using the model-view pattern. The model is the central component of this system. The root of the item model should contain the index of currently selected items, and the children of the root include all the items of the combo box.
### Methods
- **__init__(self, *args, **kwargs)**
- Construct ComboBox.
### Attributes
```
Construct ComboBox.
### Arguments:
> - `model :`
> - The model that determines if the button is checked.
> - `kwargs`
> - See below
### Keyword Arguments:
> - `arrow_only : bool`
> - Determines if it’s necessary to hide the text of the ComboBox.
> - `width : ui.Length`
> - This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
> - `height : ui.Length`
> - This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
> - `name : str`
> - The name of the widget that user can set.
> - `style_type_name_override : str`
> - By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
> - `identifier : str`
> - An optional identifier of the widget we can use to refer to it in queries.
> - `visible : bool`
> - This property holds whether the widget is visible.
> - `visibleMin : float`
> - If the current zoom factor and DPI is less than this value, the widget is not visible.
> - `visibleMax : float`
> - If the current zoom factor and DPI is bigger than this value, the widget is not visible.
> - `tooltip : str`
> - Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
> - `tooltip_fn : Callable`
> - Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
> - `tooltip_offset_x : float`
> - Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
> - `tooltip_offset_y : float`
> - Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
> - `enabled : bool`
> - This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
> - `selected : bool`
> - This property holds a flag that specifies the widget has to use eSelected state of the style.
> - `checked : bool`
> - This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
> - `dragging : bool`
> - This property holds if the widget is being dragged.
> - `opaque_for_mouse_events : bool`
> - If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
> - `skip_draw_when_clipped : bool`
> - The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
> - `mouse_moved_fn : Callable`
> - Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
> - `mouse_pressed_fn : Callable`
> - Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
> - `mouse_released_fn : Callable`
> - Sets the function that will be called when the user releases the mouse button inside the widget. The function should be like this: void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
<dl>
<dt>
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_double_clicked_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_wheel_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_hovered_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>
`drag_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>
`accept_drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>
`drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
`computed_content_size_changed_fn
<span class="classifier">
Callable`
<dd>
<p>
Called when the size of the widget is changed.
| 7,162 |
omni.ui.constant_utils.AbstractShade.md | # AbstractShade
## AbstractShade
```python
class omni.ui.constant_utils.AbstractShade(object)
```
The implementation of shades for custom style parameter type.
The user has to reimplement methods _store and _find to set/get the value in the specific store.
### Methods
| Method | Description |
|-----------------------|-----------------------------------------------------------------------------|
| `__init__()` | |
| `set_shade(name)` | Set the default shade. |
| `shade(default)` | Save the given shade, pick the color and apply it to ui.ColorStore. |
```python
def __init__(self):
pass
```
```python
def set_shade(self, name):
Set the default shade.
```
```python
def shade(self, default):
Save the given shade, pick the color and apply it to ui.ColorStore.
```
## AbstractShade Methods
### set_shade
```python
def set_shade(default: Optional[str] = None)
```
Set the default shade.
### shade
```python
def shade(default: Optional[Any] = None, **kwargs) -> str
```
Save the given shade, pick the color and apply it to ui.ColorStore.
``` | 1,295 |
omni.ui.constant_utils.Classes.md | # omni.ui.constant_utils Classes
## Classes Summary:
| Class | Description |
| --- | --- |
| [AbstractShade](#) | The implementation of shades for custom style parameter type. |
| [FloatShade](#) | | | 202 |
omni.ui.constant_utils.Functions.md | # omni.ui.constant_utils Functions
## Functions Summary:
| Function | Description |
|----------|-------------|
| [Singleton](omni.ui.constant_utils/omni.ui.constant_utils.Singleton.html) | A singleton decorator | | 214 |
omni.ui.constant_utils.md | # omni.ui.constant_utils
## Classes Summary
- **AbstractShade**
- The implementation of shades for custom style parameter type.
- **FloatShade**
- (No description provided)
## Functions Summary
- **Singleton**
- A singleton decorator | 243 |
omni.ui.Container.md | # Container
## Class: omni.ui.Container
Base class for all UI containers. Container can hold one or many other `omni.ui.Widget`s.
### Methods
- `__init__(*args, **kwargs)`
- `add_child(self, arg0)`
- Adds widget to this container in a manner specific to the container.
- `clear(self)`
- Removes the container items from the container.
### Attributes
None listed.
### omni.ui.Container.add_child
- **Method**: add_child
- **Parameters**:
- self: omni.ui._ui.Container
- arg0: omni.ui._ui.Widget
- **Returns**: None
- **Description**: Adds widget to this container in a manner specific to the container. If it’s allowed to have one sub-widget only, it will be overwriten.
### omni.ui.Container.clear
- **Method**: clear
- **Parameters**:
- self: omni.ui._ui.Container
- **Returns**: None
- **Description**: Removes the container items from the container. | 868 |
omni.ui.CornerFlag.md | # CornerFlag
## CornerFlag
```
class omni.ui.CornerFlag
```
Bases:
```
pybind11_object
```
Members:
- NONE
- TOP_LEFT
- TOP_RIGHT
- BOTTOM_LEFT
- BOTTOM_RIGHT
- TOP
- BOTTOM
- LEFT
- RIGHT
- ALL
### Methods
- `__init__(self, value)`
### Attributes
- `ALL`
- `BOTTOM`
- `BOTTOM_LEFT`
- `BOTTOM_RIGHT`
- `LEFT`
- `NONE`
- `RIGHT`
- `TOP`
- `TOP_LEFT`
- `TOP_RIGHT`
<p>
RIGHT
<p>
TOP
<p>
TOP_LEFT
<p>
TOP_RIGHT
<p>
name
<p>
value
<dl>
<dt>
__init__
(
self
:
omni.ui._ui.CornerFlag
,
value
:
int
)
→
None
<dl>
<dt>
property
name
| 613 |
omni.ui.Direction.md | # Direction
## omni.ui.Direction
- Bases: `pybind11_object`
### Members
- LEFT_TO_RIGHT
- RIGHT_TO_LEFT
- TOP_TO_BOTTOM
- BOTTOM_TO_TOP
- BACK_TO_FRONT
- FRONT_TO_BACK
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, value)` | |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `BACK_TO_FRONT` | |
| `BOTTOM_TO_TOP` | |
| `FRONT_TO_BACK` | |
| `LEFT_TO_RIGHT` | |
| `RIGHT_TO_LEFT` | |
| `TOP_TO_BOTTOM` | |
| name | value |
| ---- | ----- |
| value | |
__init__(self: omni.ui._ui.Direction, value: int) -> None
property name | 599 |
omni.ui.DockPolicy.md | # DockPolicy
## Class
```python
class omni.ui.DockPolicy
```
### Members
```
DO_NOTHING
CURRENT_WINDOW_IS_ACTIVE
TARGET_WINDOW_IS_ACTIVE
```
### Methods
```
__init__(self, value)
```
### Attributes
```
CURRENT_WINDOW_IS_ACTIVE
DO_NOTHING
TARGET_WINDOW_IS_ACTIVE
name
value
omni.ui._ui.DockPolicy
,
value : int
)
→ None
property
name | 337 |
omni.ui.DockPosition.md | # DockPosition
## omni.ui.DockPosition
- **Bases:** `pybind11_object`
### Members
- RIGHT
- LEFT
- TOP
- BOTTOM
- SAME
### Methods
- `__init__(self, value)`
### Attributes
- `BOTTOM`
- `LEFT`
- `RIGHT`
- `SAME`
- `TOP`
- `name`
- `value`
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.DockPosition.__init__">
<span class="sig-name descname">
<span class="pre">
__init__
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
omni.ui._ui.DockPosition
,
<em class="sig-param">
<span class="n">
<span class="pre">
value
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
int
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<a class="headerlink" href="#omni.ui.DockPosition.__init__" title="Permalink to this definition">
<dd>
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.DockPosition.name">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
name
<a class="headerlink" href="#omni.ui.DockPosition.name" title="Permalink to this definition">
<dd>
| 1,614 |
omni.ui.DockPreference.md | # DockPreference
## Class omni.ui.DockPreference
Bases: `pybind11_object`
Members:
- DISABLED
- MAIN
- RIGHT
- LEFT
- RIGHT_TOP
- RIGHT_BOTTOM
- LEFT_BOTTOM
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, value)` | |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `DISABLED` | |
| `LEFT` | |
| `LEFT_BOTTOM` | |
| `MAIN` | |
| `RIGHT` | |
| `RIGHT_BOTTOM` | |
| `RIGHT_TOP` | |
| Column 1 | Column 2 |
|----------|----------|
| name | |
| value | |
### __init__
```python
__init__(self: omni.ui._ui.DockPreference, value: int) -> None
```
### name
```
property name
``` | 669 |
omni.ui.DockSpace.md | # DockSpace
## DockSpace
The DockSpace class represents Dock Space for the OS Window.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, arg0, **kwargs)` | Construct the main window, add it to the underlying windowing system, and makes it appear. |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `dock_frame` | This represents Styling opportunity for the Window background. |
#### `__init__(self, arg0, **kwargs)`
Construct the main window, add it to the underlying windowing system, and makes it appear.
<p>
Construct the main window, add it to the underlying windowing system, and makes it appear.
<blockquote>
<div>
<dl class="simple">
<dt>
`kwargs
<span class="classifier">
dict`
<dd>
<p>
See below
<p>
### Keyword Arguments:
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.DockSpace.dock_frame">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
dock_frame
<dd>
<p>
This represents Styling opportunity for the Window background.
| 1,102 |
omni.ui.dock_window_in_window.md | # dock_window_in_window
## dock_window_in_window
```
```python
omni.ui.dock_window_in_window(arg0: str, arg1: str, arg2: omni.ui._ui.DockPosition, arg3: float) -> bool
```
place a named window in a specific docking position based on a target window name. We will find the target window dock node and insert this named window in it, either by splitting on ratio or on top if the window is not found false is returned, otherwise true. | 435 |
omni.ui.DynamicTextureProvider.md | # DynamicTextureProvider
## DynamicTextureProvider
```python
class omni.ui.DynamicTextureProvider
```
Bases: `ByteImageProvider`
doc
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, arg0)` | doc |
### Attributes
| Attribute | Description |
|-----------|-------------|
```python
def __init__(self, arg0: str) -> None:
# doc
```
``` | 374 |
omni.ui.Ellipse.md | # Ellipse
## Ellipse
### omni.ui.Ellipse
**Bases:** [Shape](omni.ui.Shape.html#omni.ui.Shape)
Constructs Ellipse.
#### Keyword Arguments:
- `width (ui.Length)`: This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
- `height (ui.Length)`: This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
- `name (str)`: The name of the widget that user can set.
- `style_type_name_override (str)`: By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
- `identifier (str)`: An optional identifier of the widget we can use to refer to it in queries.
- `visible (bool)`: This property holds whether the widget is visible.
- `visibleMin (float)`: If the current zoom factor and DPI is less than this value, the widget is not visible.
- `visibleMax (float)`: If the current zoom factor and DPI is bigger than this value, the widget is not visible.
- `tooltip (str)`: Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style.
- `tooltip_fn (Callable)`: Set dynamic tooltip that will be created dynamically the first time it is needed. The function is called inside a ui.Frame scope that the widget will be parented correctly.
### Properties
- `tooltip_offset_x`
- float
- Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
- `tooltip_offset_y`
- float
- Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
- `enabled`
- bool
- This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
- `selected`
- bool
- This property holds a flag that specifies the widget has to use eSelected state of the style.
- `checked`
- bool
- This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
- `dragging`
- bool
- This property holds if the widget is being dragged.
- `opaque_for_mouse_events`
- bool
- If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
- `skip_draw_when_clipped`
- bool
- The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
- `mouse_moved_fn`
- Callable
- Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
- `mouse_pressed_fn`
- Callable
- Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
- `mouse_released_fn`
- Callable
- Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
- `mouse_double_clicked_fn`
- Callable
- Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
- `mouse_wheel_fn`
- Callable
- Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
- `mouse_hovered_fn`
- Callable
- Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
- `drag_fn`
- Callable
- Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
- `accept_drop_fn`
- Callable
- Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
- `drop_fn`
- Callable
- Specify that this Widget accepts drops and set the callback to the drop operation.
- `computed_content_size_changed_fn`
- Callable
- Called when the size of the widget is changed.
```
### Methods
- `__init__(self, **kwargs)`
-
### Attributes
omni.ui._ui.Ellipse(**kwargs) → None | 5,656 |
omni.ui.extension.UIPreferencesExtension.md | # UIPreferencesExtension
## UIPreferencesExtension
```python
class omni.ui.extension.UIPreferencesExtension
```
**Bases:** `IExt`
**Methods**
| Method | Description |
|--------------|-------------|
| `on_shutdown()` | |
| `on_startup(ext_id)` | |
```python
def __init__(self: omni.ext._extensions.IExt) -> None:
``` | 348 |
omni.ui.FillPolicy.md | # FillPolicy
## Overview
FillPolicy is a class that inherits from `pybind11_object`. It includes the following members:
- **STRETCH**
- **PRESERVE_ASPECT_FIT**
- **PRESERVE_ASPECT_CROP**
### Methods
- **`__init__`**(self, value)
### Attributes
- **`PRESERVE_ASPECT_CROP`**
- **`PRESERVE_ASPECT_FIT`**
- **`STRETCH`**
- **`name`**
- **`value`**
omni.ui._ui.FillPolicy(
value : int
) -> None
property name | 412 |
omni.ui.FloatDrag.md | # FloatDrag
## FloatDrag
The drag widget that looks like a field but it’s possible to change the value with dragging.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self[, model])` | Construct FloatDrag. |
### Attributes
| Attribute | Description |
|-----------|-------------|
Construct FloatDrag.
> `kwargs
> dict`
See below
### Keyword Arguments:
> `min
> float`
This property holds the slider’s minimum value.
> `max
> float`
This property holds the slider’s maximum value.
> `step
> float`
This property controls the stepping speed on the drag.
> `format
> str`
This property overrides automatic formatting if needed.
> `precision
> uint32_t`
This property holds the slider value’s float precision.
> `width
> ui.Length`
This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
> `height
> ui.Length`
This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
> `name
> str`
The name of the widget that user can set.
> `style_type_name_override
> str`
By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
> `identifier
> str`
An optional identifier of the widget we can use to refer to it in queries.
> `visible
> bool`
This property holds whether the widget is visible.
> `visibleMin
> float`
If the current zoom factor and DPI is less than this value, the widget is not visible.
> `visibleMax
> float`
If the current zoom factor and DPI is bigger than this value, the widget is not visible.
> `tooltip
> str`
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
> `tooltip_fn
> Callable`
Set dynamic tooltip that will be created dynamically the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
> `tooltip_offset_x
> float`
Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
> `tooltip_offset_y
> float`
Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
> `enabled
> bool`
This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
> `selected
> bool`
This property holds a flag that specifies the widget has to use eSelected state of the style.
> `checked
> bool`
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
> `dragging
> bool`
This property holds if the widget is being dragged.
> `opaque_for_mouse_events
> bool`
If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
> `skip_draw_when_clipped
> bool`
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
> `mouse_moved_fn
> Callable`
<dl>
<dt>
`mouse_moved_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
<dt>
`mouse_pressed_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
<dt>
`mouse_released_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_double_clicked_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_wheel_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_hovered_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>
`drag_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>
`accept_drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>
`drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
`computed_content_size_changed_fn
<span class="classifier">
Callable`
<dd>
<p>
Called when the size of the widget is changed.
| 6,842 |
omni.ui.FloatSlider.md | # FloatSlider
## Class: omni.ui.FloatSlider
**Bases:** [AbstractSlider](omni.ui.AbstractSlider.html#omni.ui.AbstractSlider)
The slider is the classic widget for controlling a bounded value. It lets the user move a slider handle along a horizontal groove and translates the handle’s position into a float value within the legal range.
### Methods
- **__init__(self[, model])**
- Construct FloatSlider.
### Attributes
- **format**
- This property overrides automatic formatting if needed.
- **max**
- This property holds the slider's maximum value.
- **min**
- This property holds the slider's minimum value.
- **precision**
- This property holds the slider value's float precision.
- **step**
- This property holds the slider's step size.
| Property | Type | Description |
|----------|------|-------------|
| `step` | float | This property controls the stepping speed on the drag. |
### __init__
```python
__init__(self: omni.ui._ui.FloatSlider, model: omni.ui._ui.AbstractValueModel = None, **kwargs) -> None
```
Construct FloatSlider.
#### Keyword Arguments:
```markdown
| Argument | Type | Description |
|----------|------|-------------|
| `min` | float | This property holds the slider’s minimum value. |
| `max` | float | This property holds the slider’s maximum value. |
| `step` | float | This property controls the stepping speed on the drag. |
| `format` | str | This property overrides automatic formatting if needed. |
| `precision` | uint32_t | This property holds the slider value’s float precision. |
| `width` | ui.Length | This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen. |
| `height` | ui.Length | This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen. |
| `name` | str | The name of the widget that user can set. |
| `style_type_name_override` | str | By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style. |
| `identifier` | str | An optional identifier of the widget we can use to refer to it in queries. |
| `visible` | bool | This property holds whether the widget is visible. |
| `visibleMin` | float | If the current zoom factor and DPI is less than this value, the widget is not visible. |
| `visibleMax` | float | If the current zoom factor and DPI is bigger than this value, the widget is not visible. |
| `tooltip` | str | Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style |
| `tooltip_fn` | Callable | Set dynamic tooltip that will be created dynamically the first time it is needed. The function is called inside a ui.Frame scope that the widget will be parented correctly. |
| `tooltip_offset_x` | float | Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non-zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown. |
| `tooltip_offset_y` | float | Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non-zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown. |
```
### Properties
#### `tooltip_y_offset`
- **Type:** `float`
- **Description:** Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
#### `enabled`
- **Type:** `bool`
- **Description:** This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
#### `selected`
- **Type:** `bool`
- **Description:** This property holds a flag that specifies the widget has to use eSelected state of the style.
#### `checked`
- **Type:** `bool`
- **Description:** This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
#### `dragging`
- **Type:** `bool`
- **Description:** This property holds if the widget is being dragged.
#### `opaque_for_mouse_events`
- **Type:** `bool`
- **Description:** If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
#### `skip_draw_when_clipped`
- **Type:** `bool`
- **Description:** The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
#### `mouse_moved_fn`
- **Type:** `Callable`
- **Description:** Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
#### `mouse_pressed_fn`
- **Type:** `Callable`
- **Description:** Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
#### `mouse_released_fn`
- **Type:** `Callable`
- **Description:** Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
#### `mouse_double_clicked_fn`
- **Type:** `Callable`
- **Description:** Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
#### `mouse_wheel_fn`
- **Type:** `Callable`
- **Description:** Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
#### `mouse_hovered_fn`
- **Type:** `Callable`
- **Description:** Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
#### `drag_fn`
- **Type:** `Callable`
- **Description:** Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
#### `accept_drop_fn`
- **Type:** `Callable`
- **Description:** Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
#### `drop_fn`
- **Type:** `Callable`
- **Description:** Specify that this Widget accepts drops and set the callback to the drop operation.
#### `computed_content_size_changed_fn`
- **Type:** `Callable`
- **Description:** Called when the size of the widget is changed.
### `format`
- **Description:** This property overrides automatic formatting if needed.
### `max`
- **Description:** This property holds the slider’s maximum value.
### `min`
- **Description:** This property holds the slider’s minimum value.
### precision
This property holds the slider value’s float precision.
### step
This property controls the stepping speed on the drag. | 8,164 |
omni.ui.FloatStore.md | # FloatStore
## FloatStore
- **Bases:** `pybind11_object`
- **Description:** A singleton that stores all the UI Style float properties of omni.ui.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(*args, **kwargs)` | |
| `find(name)` | Return the index of the color with specific name. |
| `store(name, value)` | Save the color by name. |
#### `__init__(*args, **kwargs)`
#### `find(name)`
- **Description:** Return the index of the color with specific name.
#### `store(name, value)`
- **Description:** Save the color by name.
## omni.ui.FloatStore.find
**static** `find(name: str) -> float`
Return the index of the color with specific name.
## omni.ui.FloatStore.store
**static** `store(name: str, value: float) -> None`
Save the color by name. | 780 |
omni.ui.FocusPolicy.md | # FocusPolicy
## FocusPolicy
Bases: `pybind11_object`
Members:
- DEFAULT
- FOCUS_ON_LEFT_MOUSE_DOWN
- FOCUS_ON_ANY_MOUSE_DOWN
- FOCUS_ON_HOVER
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, value)` | |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `DEFAULT` | |
| `FOCUS_ON_ANY_MOUSE_DOWN` | |
| `FOCUS_ON_HOVER` | |
| `FOCUS_ON_LEFT_MOUSE_DOWN` | |
| `name` | |
| `value` | |
(
**self** :
omni.ui._ui.FocusPolicy
,
**value** :
int
)
→
None
**property**
**name** | 537 |
omni.ui.FontStyle.md | # FontStyle
## FontStyle
Supported font styles.
Members:
- NONE
- NORMAL
- LARGE
- SMALL
- EXTRA_LARGE
- XXL
- XXXL
- EXTRA_SMALL
- XXS
- XXXS
- ULTRA
### Methods
- `__init__(self, value)`
### Attributes
- `EXTRA_LARGE`
- `EXTRA_SMALL`
- `LARGE`
- `NONE`
- `NORMAL`
- `SMALL`
| ULTRA |
| --- |
| XXL |
| XXS |
| XXXL |
| XXXS |
| name |
| value |
__init__(self: omni.ui._ui.FontStyle, value: int) -> None
property name | 425 |
omni.ui.Fraction.md | # Fraction
## Fraction
```python
class omni.ui.Fraction
```
Bases: `omni.ui.Length`
Fraction length is made to take the space of the parent widget, divides it up into a row of boxes, and makes each child widget fill one box.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, value)` | Construct Fraction. |
### Attributes
| Attribute | Description |
|-----------|-------------|
```python
def __init__(self, value: float) -> None:
Construct Fraction.
```
### Keyword Arguments:
- `kwargs dict`: See below
``` | 552 |
omni.ui.Frame.md | # Frame
## Frame
The Frame is a widget that can hold one child widget. Frame is used to crop the contents of a child widget or to draw small widget in a big view. The child widget must be specified with addChild().
### Methods
- **__init__(self, **kwargs)**
- Constructs Frame.
- **call_build_fn(self)**
- Set the callback that will be called once the frame is visible and the content of the callback will override the frame child.
- **has_build_fn(self)**
- Set the callback that will be called once the frame is visible and the content of the callback will override the frame child.
- **invalidate_raster(self)**
- This method regenerates the raster image of the widget, even if the widget's content has not changed.
- **rebuild(self)**
- After this method is called, the next drawing cycle build_fn will be called again to rebuild everything.
| Method | Description |
|--------|-------------|
| `set_build_fn(self, fn)` | Set the callback that will be called once the frame is visible and the content of the callback will override the frame child. |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `frozen` | A special mode where the child is placed to the transparent borderless window. |
| `horizontal_clipping` | When the content of the frame is bigger than the frame the exceeding part is not drawn if the clipping is on. |
| `raster_policy` | Determine how the content of the frame should be rasterized. |
| `separate_window` | A special mode where the child is placed to the transparent borderless window. |
| `vertical_clipping` | When the content of the frame is bigger than the frame the exceeding part is not drawn if the clipping is on. |
### `__init__(self, **kwargs)`
Constructs Frame.
#### Keyword Arguments:
- `horizontal_clipping`: When the content of the frame is bigger than the frame the exceeding part is not drawn if the clipping is on. It only works for horizontal direction.
- `vertical_clipping`: When the content of the frame is bigger than the frame the exceeding part is not drawn if the clipping is on. It only works for vertical direction.
- `separate_window`: A special mode where the child is placed to the transparent borderless window. We need it to be able to place the UI to the exact stacking order between other windows.
- `raster_policy`: Determine how the content of the frame should be rasterized.
- `build_fn`: Set the callback that will be called once the frame is visible and the content of the callback will override the frame child. It’s useful for lazy load.
- `width`: This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
- `height`: This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
- `name`: The name of the widget that user can set.
- `style_type_name_override`: By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
### identifier
An optional identifier of the widget we can use to refer to it in queries.
### visible
This property holds whether the widget is visible.
### visibleMin
If the current zoom factor and DPI is less than this value, the widget is not visible.
### visibleMax
If the current zoom factor and DPI is bigger than this value, the widget is not visible.
### tooltip
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
### tooltip_fn
Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
### tooltip_offset_x
Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
### tooltip_offset_y
Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
### enabled
This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
### selected
This property holds a flag that specifies the widget has to use eSelected state of the style.
### checked
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
### dragging
This property holds if the widget is being dragged.
### opaque_for_mouse_events
If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
### skip_draw_when_clipped
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
### mouse_moved_fn
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
### mouse_pressed_fn
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
### mouse_released_fn
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
### mouse_double_clicked_fn
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
### mouse_wheel_fn
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
### mouse_hovered_fn
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
### drag_fn
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
### accept_drop_fn
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
### drop_fn
Specify that this Widget can accept specific drops and set the callback that is called to handle the drop operation.
<dl>
<dt>
`drop_callback
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
`computed_content_size_changed_fn
<span class="classifier">
Callable`
<dd>
<p>
Called when the size of the widget is changed.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.Frame.call_build_fn">
<span class="sig-name descname">
<span class="pre">
call_build_fn
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
omni.ui._ui.Frame
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
Set the callback that will be called once the frame is visible and the content of the callback will override the frame child. It’s useful for lazy load.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.Frame.has_build_fn">
<span class="sig-name descname">
<span class="pre">
has_build_fn
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
omni.ui._ui.Frame
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
bool
<dd>
<p>
Set the callback that will be called once the frame is visible and the content of the callback will override the frame child. It’s useful for lazy load.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.Frame.invalidate_raster">
<span class="sig-name descname">
<span class="pre">
invalidate_raster
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
omni.ui._ui.Frame
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
This method regenerates the raster image of the widget, even if the widget’s content has not changed. This can be used with both the eOnDemand and eAuto raster policies, and is used to update the content displayed in the widget. Note that this operation may be resource-intensive, and should be used sparingly.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.Frame.rebuild">
<span class="sig-name descname">
<span class="pre">
rebuild
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
omni.ui._ui.Frame
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
After this method is called, the next drawing cycle build_fn will be called again to rebuild everything.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.Frame.set_build_fn">
<span class="sig-name descname">
<span class="pre">
set_build_fn
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
omni.ui._ui.Frame
,
<em class="sig-param">
<span class="n">
<span class="pre">
fn
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
Callable
<span class="p">
<span class="pre">
[
<span class="p">
<span class="pre">
[
<span class="p">
<span class="pre">
]
<span class="p">
<span class="pre">
,
<span class="w">
<span class="pre">
None
<span class="p">
<span class="pre">
]
)
<dd>
<p>
Set the callback that will be called once the frame is visible and the content of the callback will override the frame child. It’s useful for lazy load.
## omni.ui.Frame.set_build_fn
Set the callback that will be called once the frame is visible and the content of the callback will override the frame child. It’s useful for lazy load.
## omni.ui.Frame.frozen
A special mode where the child is placed to the transparent borderless window. We need it to be able to place the UI to the exact stacking order between other windows.
## omni.ui.Frame.horizontal_clipping
When the content of the frame is bigger than the frame the exceeding part is not drawn if the clipping is on. It only works for horizontal direction.
## omni.ui.Frame.raster_policy
Determine how the content of the frame should be rasterized.
## omni.ui.Frame.separate_window
A special mode where the child is placed to the transparent borderless window. We need it to be able to place the UI to the exact stacking order between other windows.
## omni.ui.Frame.vertical_clipping
When the content of the frame is bigger than the frame the exceeding part is not drawn if the clipping is on. It only works for vertical direction. | 14,103 |
omni.ui.FreeBezierCurve.md | # FreeBezierCurve
## FreeBezierCurve
```python
class omni.ui.FreeBezierCurve
```
Bases: `omni.ui._ui.BezierCurve`
Smooth curve that can be scaled infinitely.
The free widget is the widget that is independent of the layout. It means it is stuck to other widgets. When initializing, it’s necessary to provide two widgets, and the shape is drawn from one widget position to the another.
### Methods
```python
__init__(self, arg0, arg1, **kwargs)
```
Initialize the shape with bounds limited to the positions of the given widgets.
### Attributes
```python
__init__(self, arg0: omni.ui._ui.Widget, arg1: omni.ui._ui.Widget)
## omni.ui.FreeBezierCurve.__init__(start, end, **kwargs)
### Returns:
- `None`
### Description:
Initialize the shape with bounds limited to the positions of the given widgets.
### Arguments:
#### start :
- The bound corner is in the center of this given widget.
#### end :
- The bound corner is in the center of this given widget.
#### kwargs
- dict
- See below
### Keyword Arguments:
#### start_tangent_width:
- This property holds the X coordinate of the start of the curve relative to the width bound of the curve.
#### start_tangent_height:
- This property holds the Y coordinate of the start of the curve relative to the width bound of the curve.
#### end_tangent_width:
- This property holds the X coordinate of the end of the curve relative to the width bound of the curve.
#### end_tangent_height:
- This property holds the Y coordinate of the end of the curve relative to the width bound of the curve.
#### set_mouse_hovered_fn:
- Sets the function that will be called when the user uses mouse enter/leave on the line. It’s the override to prevent Widget from the bounding box logic. The function specification is: void onMouseHovered(bool hovered)
### Additional Properties:
#### width
- ui.Length
- This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
#### height
- ui.Length
- This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
#### name
- str
- The name of the widget that user can set.
#### style_type_name_override
- str
- By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
#### identifier
- str
- An optional identifier of the widget we can use to refer to it in queries.
#### visible
- bool
- This property holds whether the widget is visible.
#### visibleMin
- float
- If the current zoom factor and DPI is less than this value, the widget is not visible.
#### visibleMax
- float
- If the current zoom factor and DPI is bigger than this value, the widget is not visible.
#### tooltip
- str
- Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
#### tooltip_fn
- Callable
- Set dynamic tooltip that will be created dynamically the first time it is needed. The function is called inside a ui.Frame scope that the widget will be parented correctly.
#### tooltip_offset_x
- float
- Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non-zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
#### tooltip_offset_y
- float
- Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non-zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
#### enabled
- bool
- This property holds whether the widget is enabled. In general, an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
#### selected
- bool
- This property holds a flag that specifies the widget has to use eSelected state of the style.
#### checked
- bool
- This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
#### dragging
- bool
- This property holds if the widget is being dragged.
#### opaque_for_mouse_events
- bool
- If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either.
<dl>
<dt>
`skip_draw_when_clipped
<span class="classifier">
bool`
<dd>
<p>
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
<dt>
`mouse_moved_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
<dt>
`mouse_pressed_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
<dt>
`mouse_released_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_double_clicked_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_wheel_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_hovered_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>
`drag_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>
`accept_drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>
`drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
`computed_content_size_changed_fn
<span class="classifier">
Callable`
<dd>
<p>
Called when the size of the widget is changed.
<dt>
`anchor_position: `
<dd>
<p>
This property holds the parametric value of the curve anchor.
<dt>
`anchor_alignment: `
<dd>
<p>
This property holds the Alignment of the curve anchor.
<dt>
`set_anchor_fn: Callable`
<dd>
<p>
Sets the function that will be called for the curve anchor.
<dt>
`invalidate_anchor: `
<dd>
<p>
Function that causes the anchor frame to be redrawn.
<dt>
`get_closest_parametric_position: `
<dd>
<p>
Function that returns the closest parametric T value to a given x,y position.
| 8,652 |
omni.ui.FreeCircle.md | # FreeCircle
## FreeCircle
The Circle widget provides a colored circle to display.
The free widget is the widget that is independent of the layout. It means it is stuck to other widgets. When initializing, it’s necessary to provide two widgets, and the shape is drawn from one widget position to the another.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, arg0, arg1, **kwargs)` | Initialize the shape with bounds limited to the positions of the given widgets. |
### Attributes
| Attribute | Description |
|-----------|-------------|
<dt>
`start :`
<dd>
<p>
The bound corner is in the center of this given widget.
<dt>
`end :`
<dd>
<p>
The bound corner is in the center of this given widget.
<dt>
`kwargs
<span class="classifier">
dict`
<dd>
<p>
See below
<p>
### Keyword Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`alignment :`
<dd>
<p>
This property holds the alignment of the circle when the fill policy is ePreserveAspectFit or ePreserveAspectCrop. By default, the circle is centered.
<dt>
`radius :`
<dd>
<p>
This property holds the radius of the circle when the fill policy is eFixed or eFixedCrop. By default, the circle radius is 0.
<dt>
`arc :`
<dd>
<p>
This property is the way to draw a half or a quarter of the circle. When it’s eLeft, only left side of the circle is rendered. When it’s eLeftTop, only left top quarter is rendered.
<dt>
`size_policy :`
<dd>
<p>
Define what happens when the source image has a different size than the item.
<dt>
`width
<span class="classifier">
ui.Length`
<dd>
<p>
This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
<dt>
`height
<span class="classifier">
ui.Length`
<dd>
<p>
This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
<dt>
`name
<span class="classifier">
str`
<dd>
<p>
The name of the widget that user can set.
<dt>
`style_type_name_override
<span class="classifier">
str`
<dd>
<p>
By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
<dt>
`identifier
<span class="classifier">
str`
<dd>
<p>
An optional identifier of the widget we can use to refer to it in queries.
<dt>
`visible
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is visible.
<dt>
`visibleMin
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is less than this value, the widget is not visible.
<dt>
`visibleMax
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is bigger than this value, the widget is not visible.
<dt>
`tooltip
<span class="classifier">
str`
<dd>
<p>
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
<dt>
`tooltip_fn
<span class="classifier">
Callable`
<dd>
<p>
Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
<dt>
`tooltip_offset_x
<span class="classifier">
float`
<dd>
<p>
Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`tooltip_offset_y
<span class="classifier">
float`
<dd>
<p>
Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`enabled
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
<dt>
`selected
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eSelected state of the style.
<dt>
`checked
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
<dt>
`dragging
<span class="classifier">
bool`
<dd>
<p>
This property holds if the widget is being dragged.
<dt>
`opaque_for_mouse_events
<span class="classifier">
bool`
<dd>
<p>
If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
<dl>
<dt>
`skip_draw_when_clipped
<span class="classifier">
bool`
<dd>
<p>
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
<dt>
`mouse_moved_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
<dt>
`mouse_pressed_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
<dt>
`mouse_released_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_double_clicked_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_wheel_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_hovered_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>
`drag_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>
`accept_drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>
`drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
`computed_content_size_changed_fn
<span class="classifier">
Callable`
<dd>
<p>
Called when the size of the widget is changed.
| 9,185 |
omni.ui.FreeEllipse.md | # FreeEllipse
## FreeEllipse
The Ellipse widget provides a colored ellipse to display.
The free widget is the widget that is independent of the layout. It means it is stuck to other widgets. When initializing, it’s necessary to provide two widgets, and the shape is drawn from one widget position to the another.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, arg0, arg1, **kwargs)` | Initialize the shape with bounds limited to the positions of the given widgets. |
### Attributes
| Attribute | Description |
|-----------|-------------|
### `__init__(self, arg0, arg1, **kwargs)`
Initialize the shape with bounds limited to the positions of the given widgets.
- `self` : [omni.ui._ui.FreeEllipse](omni.ui.FreeEllipse.html#omni.ui.FreeEllipse)
- `arg0` : [omni.ui._ui.Widget](omni.ui.Widget.html#omni.ui.Widget)
- `arg1` : [omni.ui._ui.Widget](omni.ui.Widget.html#omni.ui.Widget)
- `**kwargs` : Additional keyword arguments.
<dt>
`start :`
<dd>
<p>
The bound corner is in the center of this given widget.
<dt>
`end :`
<dd>
<p>
The bound corner is in the center of this given widget.
<dt>
`kwargs
<span class="classifier">
dict`
<dd>
<p>
See below
<p>
### Keyword Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`width
<span class="classifier">
ui.Length`
<dd>
<p>
This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
<dt>
`height
<span class="classifier">
ui.Length`
<dd>
<p>
This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
<dt>
`name
<span class="classifier">
str`
<dd>
<p>
The name of the widget that user can set.
<dt>
`style_type_name_override
<span class="classifier">
str`
<dd>
<p>
By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
<dt>
`identifier
<span class="classifier">
str`
<dd>
<p>
An optional identifier of the widget we can use to refer to it in queries.
<dt>
`visible
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is visible.
<dt>
`visibleMin
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is less than this value, the widget is not visible.
<dt>
`visibleMax
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is bigger than this value, the widget is not visible.
<dt>
`tooltip
<span class="classifier">
str`
<dd>
<p>
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
<dt>
`tooltip_fn
<span class="classifier">
Callable`
<dd>
<p>
Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
<dt>
`tooltip_offset_x
<span class="classifier">
float`
<dd>
<p>
Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`tooltip_offset_y
<span class="classifier">
float`
<dd>
<p>
Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`enabled
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
<dt>
`selected
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eSelected state of the style.
<dt>
`checked
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
<dt>
`dragging
<span class="classifier">
bool`
<dd>
<p>
This property holds if the widget is being dragged.
<dt>
`opaque_for_mouse_events
<span class="classifier">
bool`
<dd>
<p>
If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
<dt>
`skip_draw_when_clipped
<span class="classifier">
bool`
<dd>
<p>
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
<dt>
`mouse_moved_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
<dt>
`mouse_pressed_fn
<dl>
<dt>
`mouse_pressed_fn`
<span class="classifier">
Callable
<dd>
<p>
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
<dt>
`mouse_released_fn`
<span class="classifier">
Callable
<dd>
<p>
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_double_clicked_fn`
<span class="classifier">
Callable
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_wheel_fn`
<span class="classifier">
Callable
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_hovered_fn`
<span class="classifier">
Callable
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>
`drag_fn`
<span class="classifier">
Callable
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>
`accept_drop_fn`
<span class="classifier">
Callable
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>
`drop_fn`
<span class="classifier">
Callable
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
`computed_content_size_changed_fn`
<span class="classifier">
Callable
<dd>
<p>
Called when the size of the widget is changed.
| 8,858 |
omni.ui.FreeLine.md | # FreeLine
## FreeLine
The Line widget provides a colored line to display.
The free widget is the widget that is independent of the layout. It means it is stuck to other widgets. When initializing, it’s necessary to provide two widgets, and the shape is drawn from one widget position to the another.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, arg0, arg1, **kwargs)` | Initialize the shape with bounds limited to the positions of the given widgets. |
### Attributes
No attributes listed.
### `__init__` Method
```python
__init__(self, arg0: omni.ui._ui.Widget, arg1: omni.ui._ui.Widget, **kwargs)
```
Initialize the shape with bounds limited to the positions of the given widgets.
```
<span class="pre">
kwargs
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<a class="headerlink" href="#omni.ui.FreeLine.__init__" title="Permalink to this definition">
<dd>
<p>
Initialize the shape with bounds limited to the positions of the given widgets.
<p>
### Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`start :`
<dd>
<p>
The bound corner is in the center of this given widget.
<dt>
`end :`
<dd>
<p>
The bound corner is in the center of this given widget.
<dt>
`kwargs
<span class="classifier">
dict`
<dd>
<p>
See below
<p>
### Keyword Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`alignment
<span class="classifier">
`
<dd>
<p>
This property that holds the alignment of the Line can only be LEFT, RIGHT, V_CENTER, H_CENTER , BOTTOM, TOP. By default, the Line is H_Center.
<dt>
`width
<span class="classifier">
ui.Length`
<dd>
<p>
This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
<dt>
`height
<span class="classifier">
ui.Length`
<dd>
<p>
This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
<dt>
`name
<span class="classifier">
str`
<dd>
<p>
The name of the widget that user can set.
<dt>
`style_type_name_override
<span class="classifier">
str`
<dd>
<p>
By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
<dt>
`identifier
<span class="classifier">
str`
<dd>
<p>
An optional identifier of the widget we can use to refer to it in queries.
<dt>
`visible
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is visible.
<dt>
`visibleMin
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is less than this value, the widget is not visible.
<dt>
`visibleMax
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is bigger than this value, the widget is not visible.
<dt>
`tooltip
<span class="classifier">
str`
<dd>
<p>
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
<dt>
`tooltip_fn
<span class="classifier">
Callable`
<dd>
<p>
Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
<dt>
`tooltip_offset_x
<span class="classifier">
float`
<dd>
<p>
Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`tooltip_offset_y
<span class="classifier">
float`
<dd>
<p>
Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`enabled
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
<dt>
`selected
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eSelected state of the style.
<dt>
`checked
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
<dt>
`dragging
<span class="classifier">
bool`
<dd>
<p>
This property holds if the widget is being dragged.
<dt>
`opaque_for_mouse_events
<span class="classifier">
bool`
<dd>
<p>
If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
<dt>
`skip_draw_when_clipped
<span class="classifier">
bool`
<dd>
<p>
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
<dt>
`mouse_moved_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
`mouse_pressed_fn Callable`
<p>
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
`mouse_released_fn Callable`
<p>
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_double_clicked_fn Callable`
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_wheel_fn Callable`
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
`mouse_hovered_fn Callable`
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
`drag_fn Callable`
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
`accept_drop_fn Callable`
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
`drop_fn Callable`
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
`computed_content_size_changed_fn Callable`
<p>
Called when the size of the widget is changed.
`anchor_position:`
<p>
This property holds the parametric value of the curve anchor.
`anchor_alignment:`
<p>
This property holds the Alignment of the curve anchor.
`set_anchor_fn: Callable`
<p>
Sets the function that will be called for the curve anchor.
`invalidate_anchor:`
<p>
Function that causes the anchor frame to be redrawn.
`get_closest_parametric_position:`
<p>
Function that returns the closest parametric T value to a given x,y position.
| 8,164 |
omni.ui.Functions.md | # omni.ui Functions
## Functions Summary:
| Function | Description |
|----------|-------------|
| add_to_namespace | - |
| set_menu_delegate | Set the default delegate to use it when the item doesn’t have a |
| set_shade | - |
| dock_window_in_window | dock_window_in_window(arg0: str, arg1: str, arg2: omni.ui._ui.DockPosition, arg3: float) -> bool |
| get_custom_glyph_code | get_custom_glyph_code(file_path: str, font_style: omni.ui._ui.FontStyle = <FontStyle.NORMAL: 1>) -> str |
| get_main_window_height | get_main_window_height() -> float |
| get_main_window_width | get_main_window_width() -> float | | 608 |
omni.ui.get_custom_glyph_code.md | # get_custom_glyph_code
## get_custom_glyph_code
### get_custom_glyph_code
Get glyph code.
#### Parameters
- **file_path** (str) – Path to svg file
- **font_style** (FontStyle) – font style to use. | 201 |
omni.ui.get_main_window_height.md | # get_main_window_height
## get_main_window_height
### get_main_window_height
#### get_main_window_height
##### get_main_window_height
###### get_main_window_height
### omni.ui.get_main_window_height
```python
def get_main_window_height():
"""
Get the height in points of the current main window.
:return: float
"""
```
--- | 341 |
omni.ui.get_main_window_width.md | # get_main_window_width
## get_main_window_width
```python
omni.ui.get_main_window_width() -> float
```
Get the width in points of the current main window.
``` | 162 |
omni.ui.Grid.md | # Grid
## Grid
Grid is a container that arranges its child views in a grid. The grid vertical/horizontal direction is the direction the grid size growing with creating more children.
### Methods
- **`__init__`** (self, arg0, **kwargs)
- Constructor.
### Attributes
- **`column_count`**
- The number of columns.
- **`column_width`**
- The width of the column.
- **`row_count`**
- The number of rows.
- **`row_height`**
- The height of the row.
Constructor.
### Arguments:
- `direction :`
- Determines the direction the widget grows when adding more children.
- `kwargs`
- See below
### Keyword Arguments:
- `column_width`
- The width of the column. It’s only possible to set it if the grid is vertical. Once it’s set, the column count depends on the size of the widget.
- `row_height`
- The height of the row. It’s only possible to set it if the grid is horizontal. Once it’s set, the row count depends on the size of the widget.
- `column_count`
- The number of columns. It’s only possible to set it if the grid is vertical. Once it’s set, the column width depends on the widget size.
- `row_count`
- The number of rows. It’s only possible to set it if the grid is horizontal. Once it’s set, the row height depends on the widget size.
- `direction`
- This type is used to determine the direction of the layout. If the Stack’s orientation is eLeftToRight the widgets are placed in a horizontal row, from left to right. If the Stack’s orientation is eRightToLeft the widgets are placed in a horizontal row, from right to left. If the Stack’s orientation is eTopToBottom, the widgets are placed in a vertical column, from top to bottom. If the Stack’s orientation is eBottomToTop, the widgets are placed in a vertical column, from bottom to top. If the Stack’s orientation is eBackToFront, the widgets are placed sorted in a Z-order in top right corner. If the Stack’s orientation is eFrontToBack, the widgets are placed sorted in a Z-order in top right corner, the first widget goes to front.
- `content_clipping`
- Determines if the child widgets should be clipped by the rectangle of this Stack.
- `spacing`
- Sets a non-stretchable space in pixels between child items of this layout.
- `send_mouse_events_to_back`
- When children of a Z-based stack overlap mouse events are normally sent to the topmost one. Setting this property true will invert that behavior, sending mouse events to the bottom-most child.
- `width`
- This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
- `height`
- This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
- `name`
- The name of the widget that user can set.
- `style_type_name_override`
- By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
- `identifier`
- An optional identifier of the widget we can use to refer to it in queries.
- `visible`
- This property holds whether the widget is visible.
- `visibleMin`
- If the current zoom factor and DPI is less than this value, the widget is not visible.
- `visibleMax`
- If the current zoom factor and DPI is bigger than this value, the widget is not visible.
- `tooltip`
- Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
### tooltip_fn
**Callable**
Set dynamic tooltip that will be created dynamically the first time it is needed. The function is called inside a ui.Frame scope that the widget will be parented correctly.
### tooltip_offset_x
**float**
Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non-zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
### tooltip_offset_y
**float**
Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non-zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
### enabled
**bool**
This property holds whether the widget is enabled. In general, an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
### selected
**bool**
This property holds a flag that specifies the widget has to use eSelected state of the style.
### checked
**bool**
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
### dragging
**bool**
This property holds if the widget is being dragged.
### opaque_for_mouse_events
**bool**
If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
### skip_draw_when_clipped
**bool**
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
### mouse_moved_fn
**Callable**
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
### mouse_pressed_fn
**Callable**
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
### mouse_released_fn
**Callable**
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
### mouse_double_clicked_fn
**Callable**
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
### mouse_wheel_fn
**Callable**
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
### mouse_hovered_fn
**Callable**
Sets the function that will be called when the user uses mouse enter/leave on the focused window. function specification is the same as in setMouseHoveredFn. void onMouseHovered(bool hovered)
### drag_fn
**Callable**
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
### accept_drop_fn
**Callable**
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
### drop_fn
**Callable**
Specify that this Widget accepts drops and set the callback to the drop operation.
### computed_content_size_changed_fn
**Callable**
Called when the size of the widget is changed.
### column_count
**property**
The number of columns. It’s only possible to set it if the grid is vertical. Once it’s set, the column width depends on the widget size.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.Grid.column_width">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
column_width
<dd>
<p>
The width of the column. It’s only possible to set it if the grid is vertical. Once it’s set, the column count depends on the size of the widget.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.Grid.row_count">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
row_count
<dd>
<p>
The number of rows. It’s only possible to set it if the grid is horizontal. Once it’s set, the row height depends on the widget size.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.Grid.row_height">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
row_height
<dd>
<p>
The height of the row. It’s only possible to set it if the grid is horizontal. Once it’s set, the row count depends on the size of the widget.
| 9,309 |
omni.ui.HStack.md | # HStack
## HStack
### omni.ui.HStack
**Bases:** [omni.ui.Stack](omni.ui.Stack.html#omni.ui.Stack)
Shortcut for Stack{eLeftToRight}. The widgets are placed in a row, with suitable sizes.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, **kwargs)` | Construct a stack with the widgets placed in a row from left to right. |
### Attributes
No attributes listed.
### omni.ui.HStack.__init__
**Parameters:**
- `self`: Instance of `omni.ui._ui.HStack`
- `**kwargs`: See below
**Description:**
Construct a stack with the widgets placed in a row from left to right.
**Keyword Arguments:**
- `direction`: Determines the direction of the layout. Options include eLeftToRight, eRightToLeft, eTopToBottom, eBottomToTop, eBackToFront, and eFrontToBack.
- `content_clipping`
Determines if the child widgets should be clipped by the rectangle of this Stack.
- `spacing`
Sets a non-stretchable space in pixels between child items of this layout.
- `send_mouse_events_to_back`
When children of a Z-based stack overlap mouse events are normally sent to the topmost one. Setting this property true will invert that behavior, sending mouse events to the bottom-most child.
- `width`
This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
- `height`
This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
- `name`
The name of the widget that user can set.
- `style_type_name_override`
By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
- `identifier`
An optional identifier of the widget we can use to refer to it in queries.
- `visible`
This property holds whether the widget is visible.
- `visibleMin`
If the current zoom factor and DPI is less than this value, the widget is not visible.
- `visibleMax`
If the current zoom factor and DPI is bigger than this value, the widget is not visible.
- `tooltip`
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
- `tooltip_fn`
Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
- `tooltip_offset_x`
Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
- `tooltip_offset_y`
Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
- `enabled`
This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
- `selected`
This property holds a flag that specifies the widget has to use eSelected state of the style.
- `checked`
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
- `dragging`
This property holds if the widget is being dragged.
- `opaque_for_mouse_events`
If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
- `skip_draw_when_clipped`
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
- `mouse_moved_fn`
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
- `mouse_pressed_fn`
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
- `mouse_released_fn`
Sets the function that will be called when the user releases the mouse button inside the widget. The function should be like this: void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
<dd>
<p>
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_double_clicked_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_wheel_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_hovered_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>
`drag_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>
`accept_drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>
`drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
`computed_content_size_changed_fn
<span class="classifier">
Callable`
<dd>
<p>
Called when the size of the widget is changed.
| 7,044 |
omni.ui.Image.md | # Image
## Image
The Image widget displays an image. The source of the image is specified as a URL using the source property. By default, specifying the width and height of the item causes the image to be scaled to that size. This behavior can be changed by setting the fill_mode property, allowing the image to be stretched or scaled instead. The property alignment controls where to align the scaled image.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(*args, **kwargs)` | Overloaded function. |
| `set_progress_changed_fn(self, fn)` | The progress of the image loading. |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `alignment` | This property holds the alignment of the image when the fill policy is ePreserveAspectFit or ePreserveAspectCrop. |
| `fill_policy` | Define what happens when the source image has a different size than the item. |
| `pixel_aligned` | Prevents image blurring when it's placed to fractional position (like x=0.5, y=0.5) |
| Property | Description |
|----------|-------------|
| `source_url` | This property holds the image URL. |
```python
__init__(*args, **kwargs)
```
Overloaded function.
1. `__init__(self: omni.ui._ui.Image, arg0: str, **kwargs) -> None`
Construct image with given url. If the url is empty, it gets the image URL from styling.
### Keyword Arguments:
| Argument | Description |
|----------|-------------|
| `alignment` | This property holds the alignment of the image when the fill policy is ePreserveAspectFit or ePreserveAspectCrop. By default, the image is centered. |
| `fill_policy` | Define what happens when the source image has a different size than the item. |
| `pixel_aligned` | Prevents image blurring when it’s placed to fractional position (like x=0.5, y=0.5) |
| `progress_changed_fn` | The progress of the image loading. |
| `width` | This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen. |
| `height` | This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen. |
| `name` | The name of the widget that user can set. |
| `style_type_name_override` | By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style. |
| `identifier` | An optional identifier of the widget we can use to refer to it in queries. |
| `visible` | This property holds whether the widget is visible. |
| `visibleMin` | If the current zoom factor and DPI is less than this value, the widget is not visible. |
| `visibleMax` | If the current zoom factor and DPI is bigger than this value, the widget is not visible. |
| `tooltip` | Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style |
| `tooltip_fn` | Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly. |
| `tooltip_offset_x` | Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown. |
| `tooltip_offset_y` | Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown. |
| `enabled` | This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled. |
| `selected` | This property holds a flag that specifies the widget has to use eSelected state of the style. |
<dl class="simple">
<dt>`checked`
<span class="classifier">bool
<dd>
<p>This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
<dt>`dragging`
<span class="classifier">bool
<dd>
<p>This property holds if the widget is being dragged.
<dt>`opaque_for_mouse_events`
<span class="classifier">bool
<dd>
<p>If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
<dt>`skip_draw_when_clipped`
<span class="classifier">bool
<dd>
<p>The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
<dt>`mouse_moved_fn`
<span class="classifier">Callable
<dd>
<p>Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
<dt>`mouse_pressed_fn`
<span class="classifier">Callable
<dd>
<p>Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
<dt>`mouse_released_fn`
<span class="classifier">Callable
<dd>
<p>Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>`mouse_double_clicked_fn`
<span class="classifier">Callable
<dd>
<p>Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>`mouse_wheel_fn`
<span class="classifier">Callable
<dd>
<p>Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>`mouse_hovered_fn`
<span class="classifier">Callable
<dd>
<p>Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>`drag_fn`
<span class="classifier">Callable
<dd>
<p>Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>`accept_drop_fn`
<span class="classifier">Callable
<dd>
<p>Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>`drop_fn`
<span class="classifier">Callable
<dd>
<p>Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>`computed_content_size_changed_fn`
<span class="classifier">Callable
<dd>
<p>Called when the size of the widget is changed.
<ol start="2">
<li>
<p>__init__(self: omni.ui._ui.Image, **kwargs) -> None
<p>Construct image with given url. If the url is empty, it gets the image URL from styling.
<dl class="simple">
<dt>`kwargs`
<span class="classifier">dict
<dd>
<p>See below
### Keyword Arguments:
<dl class="simple">
<dt>`alignment`
<span class="classifier">
<dd>
<p>This property holds the alignment of the image when the fill policy is ePreserveAspectFit or ePreserveAspectCrop. By default, the image is centered.
<dt>`fill_policy`
<span class="classifier">
<dd>
<p>Define what happens when the source image has a different size than the item.
<dt>`pixel_aligned`
<span class="classifier">
<dd>
<p>Prevents image blurring when it’s placed to fractional position (like x=0.5, y=0.5)
<dt>`progress_changed_fn`
<span class="classifier">
<dd>
<p>The progress of the image loading.
<dt>`width`
<span class="classifier">ui.Length
<dd>
<p>This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
<dt>`height`
<span class="classifier">ui.Length
<dd>
<p>This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
<dt>`name`
<span class="classifier">str
<dd>
<p>The name of the widget that user can set.
<dt>`style_type_name_override`
<span class="classifier">
<dd>
<p>
<dt>
`typeName
<span class="classifier">
str`
<dd>
<p>
By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
<dt>
`identifier
<span class="classifier">
str`
<dd>
<p>
An optional identifier of the widget we can use to refer to it in queries.
<dt>
`visible
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is visible.
<dt>
`visibleMin
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is less than this value, the widget is not visible.
<dt>
`visibleMax
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is bigger than this value, the widget is not visible.
<dt>
`tooltip
<span class="classifier">
str`
<dd>
<p>
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
<dt>
`tooltip_fn
<span class="classifier">
Callable`
<dd>
<p>
Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
<dt>
`tooltip_offset_x
<span class="classifier">
float`
<dd>
<p>
Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`tooltip_offset_y
<span class="classifier">
float`
<dd>
<p>
Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`enabled
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
<dt>
`selected
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eSelected state of the style.
<dt>
`checked
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
<dt>
`dragging
<span class="classifier">
bool`
<dd>
<p>
This property holds if the widget is being dragged.
<dt>
`opaque_for_mouse_events
<span class="classifier">
bool`
<dd>
<p>
If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
<dt>
`skip_draw_when_clipped
<span class="classifier">
bool`
<dd>
<p>
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
<dt>
`mouse_moved_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
<dt>
`mouse_pressed_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
<dt>
`mouse_released_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_double_clicked_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_wheel_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_hovered_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>
`drag_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>
`accept_drop_fn
<span class="classifier">
Callable`
<dl>
<dt>
`drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
`computed_content_size_changed_fn
<span class="classifier">
Callable`
<dd>
<p>
Called when the size of the widget is changed.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.Image.set_progress_changed_fn">
<span class="sig-name descname">
<span class="pre">
set_progress_changed_fn
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
omni.ui._ui.Image
,
<em class="sig-param">
<span class="n">
<span class="pre">
fn
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
Callable
<span class="p">
<span class="pre">
[
<span class="p">
<span class="pre">
[
<span class="pre">
float
<span class="p">
<span class="pre">
]
<span class="p">
<span class="pre">
,
<span class="w">
<span class="pre">
None
<span class="p">
<span class="pre">
]
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
The progress of the image loading.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.Image.alignment">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
alignment
<dd>
<p>
This property holds the alignment of the image when the fill policy is ePreserveAspectFit or ePreserveAspectCrop. By default, the image is centered.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.Image.fill_policy">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
fill_policy
<dd>
<p>
Define what happens when the source image has a different size than the item.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.Image.pixel_aligned">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
pixel_aligned
<dd>
<p>
Prevents image blurring when it’s placed to fractional position (like x=0.5, y=0.5)
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.Image.source_url">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
source_url
<dd>
<p>
This property holds the image URL. It can be an omni: file:
| 18,385 |
omni.ui.ImageProvider.md | # ImageProvider
## ImageProvider
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, **kwargs)` | doc |
| `destroy(self)` | |
| `get_managed_resource(self)` | |
| `set_image_data(*args, **kwargs)` | Overloaded function. |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `height` | Gets image height. |
| `is_reference_valid` | Returns true if ImGui reference is valid, false otherwise. |
| width | Gets image width. |
|-------|-------------------|
| __init__ | doc |
|-----------|-----|
| destroy | |
| get_managed_resource | |
| set_image_data | Overloaded function. |
| height | Gets image height. |
| is_reference_valid | Returns true if ImGui reference is valid, false otherwise. |
| width | Gets image width. |
---
title: 文章标题
---
## 章节标题
### 子章节标题
#### 更小的子章节标题
这里是段落内容。
这里是另一个段落内容。
这里是代码块内容:
```
// 这里是代码
```
这里是列表:
- 列表项1
- 列表项2
这里是引用:
> 引用内容
这里是表格:
| 列1 | 列2 |
| --- | --- |
| 数据1 | 数据2 |
这里是水平线:
---
这里是页脚:
--- | 994 |
omni.ui.ImageWithProvider.md | # ImageWithProvider
## ImageWithProvider
```python
class omni.ui.ImageWithProvider
```
The Image widget displays an image. The source of the image is specified as a URL using the source property. By default, specifying the width and height of the item causes the image to be scaled to that size. This behavior can be changed by setting the fill_mode property, allowing the image to be stretched or scaled instead. The property alignment controls where to align the scaled image.
### Methods
```python
__init__(*args, **kwargs)
```
Overloaded function.
```python
prepare_draw(self, width, height)
```
Force call `ImageProvider::prepareDraw` to ensure the next draw call the image is loaded.
### Attributes
```python
alignment
```
This property holds the alignment of the image when the fill policy is ePreserveAspectFit or ePreserveAspectCrop.
```python
fill_policy
```
Define what happens when the source image has a different size than the item.
```python
pixel_aligned
```
| Description | Details |
|-------------|---------|
| Prevents image blurring when it's placed to fractional position (like x=0.5, y=0.5) | Prevents image blurring when it's placed to fractional position (like x=0.5, y=0.5) |
### omni.ui.ImageWithProvider.__init__
Overloaded function.
1. __init__(self: omni.ui._ui.ImageWithProvider, arg0: ImageProvider, **kwargs) -> None
2. __init__(self: omni.ui._ui.ImageWithProvider, arg0: str, **kwargs) -> None
3. __init__(self: omni.ui._ui.ImageWithProvider, **kwargs) -> None
Construct image with given ImageProvider. If the ImageProvider is nullptr, it gets the image URL from styling.
### Keyword Arguments:
- `alignment`: This property holds the alignment of the image when the fill policy is ePreserveAspectFit or ePreserveAspectCrop. By default, the image is centered.
- `fill_policy`: Define what happens when the source image has a different size than the item.
- `pixel_aligned`: Prevents image blurring when it’s placed to fractional position (like x=0.5, y=0.5)
- `width`: This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
- `height`: This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
- `name`: The name of the widget that user can set.
- `style_type_name_override`: By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
- `identifier`: An optional identifier of the widget we can use to refer to it in queries.
- `visible`: This property holds whether the widget is visible.
- `visibleMin`: If the current zoom factor and DPI is less than this value, the widget is not visible.
- `visibleMax`: If the current zoom factor and DPI is bigger than this value, the widget is not visible.
- `tooltip`: Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
- `tooltip_fn`: Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
- `tooltip_offset_x`: Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
- `tooltip_offset_y`: Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
- `enabled`: This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
- `selected`: This property holds a flag that specifies the widget has to use eSelected state of the style.
- `checked`: This property holds a flag that specifies the widget has to use eChecked state of the style.
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
`dragging bool`
This property holds if the widget is being dragged.
`opaque_for_mouse_events bool`
If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
`skip_draw_when_clipped bool`
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
`mouse_moved_fn Callable`
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
`mouse_pressed_fn Callable`
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
`mouse_released_fn Callable`
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_double_clicked_fn Callable`
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
`mouse_wheel_fn Callable`
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
`mouse_hovered_fn Callable`
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
`drag_fn Callable`
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
`accept_drop_fn Callable`
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
`drop_fn Callable`
Specify that this Widget accepts drops and set the callback to the drop operation.
`computed_content_size_changed_fn Callable`
Called when the size of the widget is changed.
`prepare_draw(self: omni.ui._ui.ImageWithProvider, width: float, height: float) → None`
Force call `ImageProvider::prepareDraw` to ensure the next draw call the image is loaded. It can be used to load the image for a hidden widget or to set the rasterization resolution.
`property alignment`
This property holds the alignment of the image when the fill policy is ePreserveAspectFit or ePreserveAspectCrop. By default, the image is centered.
### fill_policy
Define what happens when the source image has a different size than the item.
### pixel_aligned
Prevents image blurring when it’s placed to fractional position (like x=0.5, y=0.5) | 7,854 |
omni.ui.Inspector.md | # Inspector
## Class: omni.ui.Inspector
Bases: `pybind11_object`
Inspector is the helper to check the internal state of the widget. It’s not recommended to use it for the routine UI.
### Methods
- `__init__(*args, **kwargs)`
- `begin_computed_height_metric()`
- Start counting how many times Widget::setComputedHeight is called
- `begin_computed_width_metric()`
- Start counting how many times Widget::setComputedWidth is called
- `end_computed_height_metric()`
- Start counting how many times Widget::setComputedHeight is called and return the number
- `end_computed_width_metric()`
- Start counting how many times Widget::setComputedWidth is called and return the number
- `get_children(widget)`
- [Description]
| Description |
| --- |
| Get the children of the given Widget. |
| Function | Description |
| --- | --- |
| `get_resolved_style(widget)` | Get the resolved style of the given Widget. |
| `get_stored_font_atlases()` | Provides the information about font atlases |
| Method | Description |
| --- | --- |
| `__init__(*args, **kwargs)` | |
| `begin_computed_height_metric()` | Start counting how many times Widget::setComputedHeight is called |
| `begin_computed_width_metric()` | Start counting how many times Widget::setComputedWidth is called |
| `end_computed_height_metric()` | Start counting how many times Widget::setComputedHeight is called and return the number |
| `end_computed_width_metric()` | Start counting how many times Widget::setComputedWidth is called and return the number |
| `get_children(widget: omni.ui._ui.Widget)` | Returns a list of `omni.ui._ui.Widget` objects |
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.Inspector.get_children">
<em class="property">
<span class="pre">
static
<span class="w">
<span class="sig-name descname">
<span class="pre">
get_children
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
widget
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
omni.ui._ui.Widget
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
List
<span class="p">
<span class="pre">
[
<span class="pre">
omni.ui._ui.Widget
<span class="p">
<span class="pre">
]
<dd>
<p>
Get the children of the given Widget.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.Inspector.get_resolved_style">
<em class="property">
<span class="pre">
static
<span class="w">
<span class="sig-name descname">
<span class="pre">
get_resolved_style
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
widget
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
omni.ui._ui.Widget
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
omni::ui::StyleContainer
<dd>
<p>
Get the resolved style of the given Widget.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.Inspector.get_stored_font_atlases">
<em class="property">
<span class="pre">
static
<span class="w">
<span class="sig-name descname">
<span class="pre">
get_stored_font_atlases
<span class="sig-paren">
(
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
List
<span class="p">
<span class="pre">
[
<span class="pre">
Tuple
<span class="p">
<span class="pre">
[
<span class="pre">
str
<span class="p">
<span class="pre">
,
<span class="w">
<span class="pre">
int
<span class="p">
<span class="pre">
]
<span class="p">
<span class="pre">
]
<dd>
<p>
Provides the information about font atlases
| 5,103 |
omni.ui.IntDrag.md | # IntDrag
## IntDrag
Bases: [IntSlider](omni.ui.IntSlider.html#omni.ui.IntSlider)
The drag widget that looks like a field but it’s possible to change the value with dragging.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self[, model])` | Constructs IntDrag. |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `step` | This property controls the stepping speed on the drag, its float to enable slower speed, but of course the value on the Control are still integer. |
#### `__init__(self, model=None)`
Constructs IntDrag.
## IntDrag Constructor
Constructs IntDrag.
### Arguments:
- `model :`
- The widget’s model. If the model is not assigned, the default model is created.
- `kwargs`
- See below
### Keyword Arguments:
- `step`
- This property controls the stepping speed on the drag, its float to enable slower speed, but of course the value on the Control are still integer.
- `min`
- This property holds the slider’s minimum value.
- `max`
- This property holds the slider’s maximum value.
- `width`
- This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
- `height`
- This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
- `name`
- The name of the widget that user can set.
- `style_type_name_override`
- By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
- `identifier`
- An optional identifier of the widget we can use to refer to it in queries.
- `visible`
- This property holds whether the widget is visible.
- `visibleMin`
- If the current zoom factor and DPI is less than this value, the widget is not visible.
- `visibleMax`
- If the current zoom factor and DPI is bigger than this value, the widget is not visible.
- `tooltip`
- Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
- `tooltip_fn`
- Set dynamic tooltip that will be created dynamically the first time it is needed. The function is called inside a ui.Frame scope that the widget will be parented correctly.
- `tooltip_offset_x`
- Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non-zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
- `tooltip_offset_y`
- Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non-zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
- `enabled`
- This property holds whether the widget is enabled. In general, an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
- `selected`
- This property holds a flag that specifies the widget has to use eSelected state of the style.
- `checked`
- This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
- `dragging`
- This property holds if the widget is being dragged.
- `opaque_for_mouse_events`
- If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
- `skip_draw_when_clipped`
- This property controls whether the widget should skip drawing when it is clipped.
<dl>
<dt>
`bypass_clipping_box_flag`
<span class="classifier">
bool
<dd>
<p>
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
<dt>
`mouse_moved_fn`
<span class="classifier">
Callable
<dd>
<p>
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
<dt>
`mouse_pressed_fn`
<span class="classifier">
Callable
<dd>
<p>
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
<dt>
`mouse_released_fn`
<span class="classifier">
Callable
<dd>
<p>
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_double_clicked_fn`
<span class="classifier">
Callable
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_wheel_fn`
<span class="classifier">
Callable
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_hovered_fn`
<span class="classifier">
Callable
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>
`drag_fn`
<span class="classifier">
Callable
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>
`accept_drop_fn`
<span class="classifier">
Callable
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>
`drop_fn`
<span class="classifier">
Callable
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
`computed_content_size_changed_fn`
<span class="classifier">
Callable
<dd>
<p>
Called when the size of the widget is changed.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.IntDrag.step">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
step
<dd>
<p>
This property controls the stepping speed on the drag, its float to enable slower speed, but of course the value on the Control are still integer.
| 7,744 |
omni.ui.IntField.md | # IntField
## IntField
The IntField widget is a one-line text editor with a string model.
### Methods
| Method | Description |
| --- | --- |
| `__init__(self[, model])` | Construct IntField. |
### Attributes
| Attribute | Description |
| --- | --- |
```
```markdown
### `__init__(self, model=None, **kwargs)`
Construct IntField.
- **Parameters**:
- `self`: The instance of `omni.ui._ui.IntField`.
- `model`: An instance of `omni.ui._ui.AbstractValueModel` (default is `None`).
- `**kwargs`: Additional keyword arguments.
- **Returns**:
- `None`
```
```markdown
### Construct IntField.
#### Keyword Arguments:
- `width (ui.Length)`: This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
- `height (ui.Length)`: This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
- `name (str)`: The name of the widget that user can set.
- `style_type_name_override (str)`: By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
- `identifier (str)`: An optional identifier of the widget we can use to refer to it in queries.
- `visible (bool)`: This property holds whether the widget is visible.
- `visibleMin (float)`: If the current zoom factor and DPI is less than this value, the widget is not visible.
- `visibleMax (float)`: If the current zoom factor and DPI is bigger than this value, the widget is not visible.
- `tooltip (str)`: Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style.
- `tooltip_fn (Callable)`: Set dynamic tooltip that will be created dynamically the first time it is needed. The function is called inside a ui.Frame scope that the widget will be parented correctly.
- `tooltip_offset_x (float)`: Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non-zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
- `tooltip_offset_y (float)`: Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non-zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
- `enabled (bool)`: This property holds whether the widget is enabled. In general, an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
- `selected (bool)`: This property holds a flag that specifies the widget has to use eSelected state of the style.
- `checked (bool)`: This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
- `dragging (bool)`: This property holds if the widget is being dragged.
- `opaque_for_mouse_events (bool)`: If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either.
- `skip_draw_when_clipped (bool)`: The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
- `mouse_moved_fn (Callable)`: Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier).
- `mouse_pressed_fn (Callable)`: Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
- `mouse_released_fn (Callable)`: Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier).
- `mouse_double_clicked_fn (Callable)`:
<dl>
<dt>
`onMouseDoubleClicked`
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_wheel_fn`
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_hovered_fn`
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>
`drag_fn`
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>
`accept_drop_fn`
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>
`drop_fn`
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
`computed_content_size_changed_fn`
<span class="classifier">
Callable`
<dd>
<p>
Called when the size of the widget is changed.
| 6,461 |
omni.ui.IntSlider.md | # IntSlider
## IntSlider
The slider is the classic widget for controlling a bounded value. It lets the user move a slider handle along a horizontal groove and translates the handle’s position into an integer value within the legal range.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self[, model])` | Constructs IntSlider. |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `max` | This property holds the slider's maximum value. |
| `min` | This property holds the slider's minimum value. |
#### `__init__(self, model)`
- **Parameters**:
- `self`: The instance of the class.
- `model`: The model associated with the slider.
<span class="pre">
omni.ui._ui.AbstractValueModel
<span class="w">
<span class="o">
<span class="pre">
=
<span class="w">
<span class="default_value">
<span class="pre">
None
,
<em class="sig-param">
<span class="o">
<span class="pre">
**
<span class="n">
<span class="pre">
kwargs
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<a class="headerlink" href="#omni.ui.IntSlider.__init__" title="Permalink to this definition">
<dd>
<p>
Constructs IntSlider.
<p>
### Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`model :`
<dd>
<p>
The widget’s model. If the model is not assigned, the default model is created.
<dt>
`kwargs
<span class="classifier">
dict`
<dd>
<p>
See below
<p>
### Keyword Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`min
<span class="classifier">
`
<dd>
<p>
This property holds the slider’s minimum value.
<dt>
`max
<span class="classifier">
`
<dd>
<p>
This property holds the slider’s maximum value.
<dt>
`width
<span class="classifier">
ui.Length`
<dd>
<p>
This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
<dt>
`height
<span class="classifier">
ui.Length`
<dd>
<p>
This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
<dt>
`name
<span class="classifier">
str`
<dd>
<p>
The name of the widget that user can set.
<dt>
`style_type_name_override
<span class="classifier">
str`
<dd>
<p>
By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
<dt>
`identifier
<span class="classifier">
str`
<dd>
<p>
An optional identifier of the widget we can use to refer to it in queries.
<dt>
`visible
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is visible.
<dt>
`visibleMin
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is less than this value, the widget is not visible.
<dt>
`visibleMax
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is bigger than this value, the widget is not visible.
<dt>
`tooltip
<span class="classifier">
str`
<dd>
<p>
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
<dt>
`tooltip_fn
<span class="classifier">
Callable`
<dd>
<p>
Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
<dt>
`tooltip_offset_x
<span class="classifier">
float`
<dd>
<p>
Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`tooltip_offset_y
<span class="classifier">
float`
<dd>
<p>
Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`enabled
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
<dt>
`selected
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eSelected state of the style.
<dt>
`checked
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
<dt>
`dragging
<span class="classifier">
bool`
<dd>
<p>
This property holds if the widget is being dragged.
<dt>
`opaque_for_mouse_events
<span class="classifier">
bool`
<dd>
<p>
If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
<dl>
<dt>
`skip_draw_when_clipped
<span class="classifier">
bool`
<dd>
<p>
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
<dt>
`mouse_moved_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
<dt>
`mouse_pressed_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
<dt>
`mouse_released_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_double_clicked_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_wheel_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_hovered_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>
`drag_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>
`accept_drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>
`drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
`computed_content_size_changed_fn
<span class="classifier">
Callable`
<dd>
<p>
Called when the size of the widget is changed.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.IntSlider.max">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
max
<dd>
<p>
This property holds the slider’s maximum value.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.IntSlider.min">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
min
<dd>
<p>
This property holds the slider’s minimum value.
| 9,285 |
omni.ui.InvisibleButton.md | # InvisibleButton
## InvisibleButton
The InvisibleButton widget provides a transparent command button.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, **kwargs)` | Constructor. |
| `call_clicked_fn(self)` | Sets the function that will be called when the button is activated (i.e., pressed down then released while the mouse cursor is inside the button). |
| `has_clicked_fn(self)` | Sets the function that will be called when the button is activated (i.e., pressed down then released while the mouse cursor is inside the button). |
| `set_clicked_fn(self, fn)` | Sets the function that will be called when the button is activated (i.e., pressed down then released while the mouse cursor is inside the button). |
### Attributes
| Attribute | Description |
|-----------|-------------|
<dt>
omni.ui._ui.InvisibleButton(
**kwargs
)
→ None
<dd>
<p>
Constructor.
<blockquote>
<div>
<dl class="simple">
<dt>
`kwargs
dict`
<dd>
<p>
See below
<p>
### Keyword Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`clicked_fn
Callable[[], None]`
<dd>
<p>
Sets the function that will be called when when the button is activated (i.e., pressed down then released while the mouse cursor is inside the button).
<dt>
`width
ui.Length`
<dd>
<p>
This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
<dt>
`height
ui.Length`
<dd>
<p>
This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
<dt>
`name
str`
<dd>
<p>
The name of the widget that user can set.
<dt>
`style_type_name_override
str`
<dd>
<p>
By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
<dt>
`identifier
str`
<dd>
<p>
An optional identifier of the widget we can use to refer to it in queries.
<dt>
`visible
bool`
<dd>
<p>
This property holds whether the widget is visible.
<dt>
`visibleMin
float`
<dd>
<p>
If the current zoom factor and DPI is less than this value, the widget is not visible.
<dt>
`visibleMax
float`
<dd>
<p>
If the current zoom factor and DPI is bigger than this value, the widget is not visible.
<dt>
`tooltip
str`
<dd>
<p>
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
<dt>
`tooltip_fn
Callable`
<dd>
<p>
Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
<dt>
`tooltip_offset_x
float`
<dd>
<p>
Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`tooltip_offset_y
float`
<dd>
<p>
Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`enabled
bool`
<dd>
<p>
This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
<dt>
`selected
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eSelected state of the style.
<dt>
`checked
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
<dt>
`dragging
bool`
<dd>
<p>
This property holds if the widget is being dragged.
<dt>
`opaque_for_mouse_events
bool`
<dd>
<p>
If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
<dt>
`skip_draw_when_clipped
bool`
<dd>
<p>
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
<dt>
`mouse_moved_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
<dt>
`mouse_pressed_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
<dt>
`mouse_released_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_double_clicked_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_wheel_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_hovered_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>
`drag_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>
`accept_drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>
`drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
`computed_content_size_changed_fn
<span class="classifier">
Callable`
<dd>
<p>
Called when the size of the widget is changed.
<dl class="function">
<dt id="omni.ui.InvisibleButton.set_clicked_fn">
<em>
<span class="sig">
<span class="pre">
def
<span class="sig-name component">
set_clicked_fn
<span class="sig-paren">
(
<span class="sig-param">
<span class="sig-param-name">
self
<span class="sig-paren">
,
<span class="sig-param-name">
fn
<span class="sig-paren">
:
<span class="sig-param-typehint">
<span class="pre">
Callable[[omni.ui.InvisibleButton, Event], None]
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
Sets the function that will be called when when the button is activated (i.e., pressed down then released while the mouse cursor is inside the button).
<footer>
<hr/>
| 8,538 |
omni.ui.ItemModelHelper.md | # ItemModelHelper
## ItemModelHelper
The ItemModelHelper class provides the basic functionality for item widget classes.
### Methods
| Method | Description |
| --- | --- |
| `__init__(*args, **kwargs)` | |
### Attributes
| Attribute | Description |
| --- | --- |
| `model` | Returns the current model. |
#### `__init__(*args, **kwargs)`
#### `model`
Returns the current model. | 385 |
omni.ui.IwpFillPolicy.md | # IwpFillPolicy
## IwpFillPolicy
- Bases: `pybind11_object`
### Members
- IWP_STRETCH
- IWP_PRESERVE_ASPECT_FIT
- IWP_PRESERVE_ASPECT_CROP
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, value)` | |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `IWP_PRESERVE_ASPECT_CROP` | |
| `IWP_PRESERVE_ASPECT_FIT` | |
| `IWP_STRETCH` | |
| `name` | |
| `value` | |
<em class="sig-param">
<span class="n">
<a class="reference internal" href="#omni.ui.IwpFillPolicy" title="omni.ui._ui.IwpFillPolicy">
<span class="pre">
omni.ui._ui.IwpFillPolicy
,
<em class="sig-param">
<span class="n">
<span class="pre">
value
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
int
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.IwpFillPolicy.name">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
name
| 1,314 |
omni.ui.Label.md | # Label
## omni.ui.Label
Bases: [Widget](omni.ui.Widget.html#omni.ui.Widget)
The Label widget provides a text to display. Label is used for displaying text. No additional to Widget user interaction functionality is provided.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, arg0, **kwargs)` | Create a label with the given text. |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `alignment` | This property holds the alignment of the label's contents. |
| `elided_text` | When the text of a big length has to be displayed in a small area, it can be useful to give the user a visual hint that not all text is visible. |
| `elided_text_str` | Customized elidedText string when elidedText is True, default is .... |
| `exact_content_height` | Return the exact height of the content of this label. |
| `exact_content_width` | Return the exact width of the content of this label. |
| Property | Description |
|----------|-------------|
| `exact_content_width` | Return the exact width of the content of this label. |
| `hide_text_after_hash` | Hide anything after a '##' string or not |
| `text` | This property holds the label's text. |
| `word_wrap` | This property holds the label's word-wrapping policy. If this property is true then label text is wrapped where necessary at word-breaks; otherwise it is not wrapped at all. |
### `__init__(self, arg0: str, **kwargs) -> None`
Create a label with the given text.
#### Arguments:
- `text :` The text for the label.
- `kwargs : dict` See below
#### Keyword Arguments:
- `alignment :` This property holds the alignment of the label’s contents. By default, the contents of the label are left-aligned and vertically-centered.
- `word_wrap :` This property holds the label’s word-wrapping policy. If this property is true then label text is wrapped where necessary at word-breaks; otherwise it is not wrapped at all. By default, word wrap is disabled.
- `elided_text :` When the text of a big length has to be displayed in a small area, it can be useful to give the user a visual hint that not all text is visible. Label can elide text that doesn’t fit in the area. When this property is true, Label elides the middle of the last visible line and replaces it with “…”.
- `elided_text_str :` Customized elidedText string when elidedText is True, default is ….
- `hide_text_after_hash :` Hide anything after a ‘##’ string or not
- `width : ui.Length` This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
- `height : ui.Length` This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
- `name : str` The name of the widget that user can set.
- `style_type_name_override : str` By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
- `identifier : str` An optional identifier of the widget we can use to refer to it in queries.
- `visible : bool` This property holds whether the widget is visible.
<dl>
<dt>
`visibleMin
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is less than this value, the widget is not visible.
<dt>
`visibleMax
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is bigger than this value, the widget is not visible.
<dt>
`tooltip
<span class="classifier">
str`
<dd>
<p>
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
<dt>
`tooltip_fn
<span class="classifier">
Callable`
<dd>
<p>
Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
<dt>
`tooltip_offset_x
<span class="classifier">
float`
<dd>
<p>
Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`tooltip_offset_y
<span class="classifier">
float`
<dd>
<p>
Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`enabled
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
<dt>
`selected
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eSelected state of the style.
<dt>
`checked
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
<dt>
`dragging
<span class="classifier">
bool`
<dd>
<p>
This property holds if the widget is being dragged.
<dt>
`opaque_for_mouse_events
<span class="classifier">
bool`
<dd>
<p>
If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
<dt>
`skip_draw_when_clipped
<span class="classifier">
bool`
<dd>
<p>
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
<dt>
`mouse_moved_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
<dt>
`mouse_pressed_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
<dt>
`mouse_released_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_double_clicked_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_wheel_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_hovered_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>
`drag_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>
`accept_drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>
`drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
`computed_content_size_changed_fn
<span class="classifier">
Callable`
<dd>
<p>
Called when the size of the widget is changed.
### alignment
- **Description**: This property holds the alignment of the label’s contents. By default, the contents of the label are left-aligned and vertically-centered.
### elided_text
- **Description**: When the text of a big length has to be displayed in a small area, it can be useful to give the user a visual hint that not all text is visible. Label can elide text that doesn’t fit in the area. When this property is true, Label elides the middle of the last visible line and replaces it with “…”.
### elided_text_str
- **Description**: Customized elidedText string when elidedText is True, default is ….
### exact_content_height
- **Description**: Return the exact height of the content of this label. Computed content height is a size hint and may be bigger than the text in the label.
### exact_content_width
- **Description**: Return the exact width of the content of this label. Computed content width is a size hint and may be bigger than the text in the label.
### hide_text_after_hash
- **Description**: Hide anything after a ‘##’ string or not.
### text
- **Description**: This property holds the label’s text.
### word_wrap
- **Description**: This property holds the label’s word-wrapping policy. If this property is true then label text is wrapped where necessary at word-breaks; otherwise it is not wrapped at all. By default, word wrap is disabled. | 10,787 |
omni.ui.Length.md | # Length
## Overview
OMNI.UI has several different units for expressing a length. Many widget properties take “Length” values, such as width, height, minWidth, minHeight, etc. Pixel is the absolute length unit. Percent and Fraction are relative length units, and they specify a length relative to the parent length. Relative length units are scaled with the parent.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(*args, **kwargs)` | Overloaded function. |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `unit` | (UnitType) Unit. |
| `value` | (float) Value |
#### `__init__(*args, **kwargs)`
Overloaded function.
- `__init__(self: omni.ui._ui.Length, arg0: float, arg1: omni::ui::UnitType) -> None`
1. __init__(self: omni.ui._ui.Length, arg0: float) -> None
2. __init__(self: omni.ui._ui.Length, arg0: int) -> None
Construct Length.
> `kwargs
> dict`
See below
### Keyword Arguments:
* **unit** (UnitType) Unit.
* **value** (float) Value | 999 |
omni.ui.Line.md | # Line
## Line
```python
class omni.ui.Line
```
The Line widget provides a colored line to display.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, **kwargs)` | Constructs Line. |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `alignment` | This property that holds the alignment of the Line can only be LEFT, RIGHT, V_CENTER, H_CENTER , BOTTOM, TOP. |
```python
def __init__(self, **kwargs):
# Constructs Line.
## omni.ui.Line.__init__
### Constructs Line.
#### Keyword Arguments:
- `alignment` (str): This property that holds the alignment of the Line can only be LEFT, RIGHT, V_CENTER, H_CENTER , BOTTOM, TOP. By default, the Line is H_Center.
- `width` (ui.Length): This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
- `height` (ui.Length): This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
- `name` (str): The name of the widget that user can set.
- `style_type_name_override` (str): By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
- `identifier` (str): An optional identifier of the widget we can use to refer to it in queries.
- `visible` (bool): This property holds whether the widget is visible.
- `visibleMin` (float): If the current zoom factor and DPI is less than this value, the widget is not visible.
- `visibleMax` (float): If the current zoom factor and DPI is bigger than this value, the widget is not visible.
- `tooltip` (str): Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style.
- `tooltip_fn` (Callable): Set dynamic tooltip that will be created dynamically the first time it is needed. The function is called inside a ui.Frame scope that the widget will be parented correctly.
- `tooltip_offset_x` (float): Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non-zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
- `tooltip_offset_y` (float): Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non-zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
- `enabled` (bool): This property holds whether the widget is enabled. In general, an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
- `selected` (bool): This property holds a flag that specifies the widget has to use eSelected state of the style.
- `checked` (bool): This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
- `dragging` (bool): This property holds if the widget is being dragged.
- `opaque_for_mouse_events` (bool): If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either.
- `skip_draw_when_clipped` (bool): The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
- `mouse_moved_fn` (Callable): Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier).
- `mouse_pressed_fn` (Callable): Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
- `mouse_released_fn` (Callable): Sets the function that will be called when the user releases the mouse button inside the widget.
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_double_clicked_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_wheel_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_hovered_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>
`drag_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>
`accept_drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>
`drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
`computed_content_size_changed_fn
<span class="classifier">
Callable`
<dd>
<p>
Called when the size of the widget is changed.
<dt>
`anchor_position: `
<dd>
<p>
This property holds the parametric value of the curve anchor.
<dt>
`anchor_alignment: `
<dd>
<p>
This property holds the Alignment of the curve anchor.
<dt>
`set_anchor_fn: Callable`
<dd>
<p>
Sets the function that will be called for the curve anchor.
<dt>
`invalidate_anchor: `
<dd>
<p>
Function that causes the anchor frame to be redrawn.
<dt>
`get_closest_parametric_position: `
<dd>
<p>
Function that returns the closest parametric T value to a given x,y position.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.Line.alignment">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
alignment
<a class="headerlink" href="#omni.ui.Line.alignment" title="Permalink to this definition">
<dd>
<p>
This property that holds the alignment of the Line can only be LEFT, RIGHT, V_CENTER, H_CENTER , BOTTOM, TOP. By default, the Line is H_Center.
<footer>
<hr/>
| 7,443 |
omni.ui.MainWindow.md | # MainWindow
## MainWindow
The MainWindow class represents Main Window for the Application, draw optional MainMenuBar and StatusBar.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self[, show_foreground])` | Construct the main window, add it to the underlying windowing system, and makes it appear. |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `cpp_status_bar_enabled` | Workaround to reserve space for C++ status bar. |
| `main_frame` | This represents Styling opportunity for the Window background. |
| `main_menu_bar` | The main MenuBar for the application. |
| `show_foreground` | When show_foreground is True, MainWindow prevents other windows from showing. |
| `status_bar_frame` | |
| | |
|----|----|
| | |
| The StatusBar Frame is empty by default and is meant to be filled by other part of the system. |
| | |
### omni.ui.MainWindow.__init__
__init__(self: omni.ui._ui.MainWindow, show_foreground: bool = False, **kwargs) -> None
- Construct the main window, add it to the underlying windowing system, and makes it appear.
- **Keyword Arguments:**
- `kwargs dict`
- See below
### omni.ui.MainWindow.cpp_status_bar_enabled
- property cpp_status_bar_enabled
- Workaround to reserve space for C++ status bar.
### omni.ui.MainWindow.main_frame
- property main_frame
- This represents Styling opportunity for the Window background.
### omni.ui.MainWindow.main_menu_bar
- property main_menu_bar
- The main MenuBar for the application.
### omni.ui.MainWindow.show_foreground
- property show_foreground
- When show_foreground is True, MainWindow prevents other windows from showing.
### omni.ui.MainWindow.status_bar_frame
- property status_bar_frame
- The StatusBar Frame is empty by default and is meant to be filled by other part of the system. | 1,852 |
omni.ui.Menu.md | # Menu
## Menu
The Menu class provides a menu widget for use in menu bars, context menus, and other popup menus.
It can be either a pull-down menu in a menu bar or a standalone context menu. Pull-down menus are shown by the menu bar when the user clicks on the respective item. Context menus are usually invoked by some special keyboard key or by right-clicking.
### Methods
- `__init__(self[, text])`
- Construct Menu.
- `call_on_build_fn(self)`
- Called to re-create new children.
- `get_current()`
- Return the menu that is currently shown.
- `has_on_build_fn(self)`
- Called to re-create new children.
- `hide(self)`
- Close the menu window.
- `invalidate(self)`
- Invalidate the menu.
### Methods
- **invalidate** (self)
- Make Menu dirty so onBuild will be executed to replace the children.
- **set_on_build_fn** (self, fn)
- Called to re-create new children.
- **set_shown_changed_fn** (self, fn)
- If the pulldown menu is shown on the screen.
- **set_teared_changed_fn** (self, fn)
- If the window is teared off.
- **show** (self)
- Create a popup window and show the menu in it.
- **show_at** (self, arg0, arg1)
- Create a popup window and show the menu in it.
- **tear_at** (self, arg0, arg1)
- Create a popup window and show the menu in it.
### Attributes
- **shown**
- If the pulldown menu is shown on the screen.
- **tearable**
- The ability to tear the window off.
- **teared**
- If the window is teared off.
### omni.ui.Menu.__init__
- **Arguments:**
- `text : str = ''`
- The text for the menu.
- `**kwargs : dict`
- See below
- **Keyword Arguments:**
- `tearable : bool`
- If the window is teared off.
<dt>
The ability to tear the window off.
<dd>
If the pulldown menu is shown on the screen.
<dt>
If the window is teared off.
<dd>
Called to re-create new children.
<dt>
This property holds the menu’s text.
<dd>
This property holds the menu’s hotkey text.
<dt>
This property holds whether this menu item is checkable. A checkable item is one which has an on/off state.
<dd>
Hide or keep the window when the user clicked this item.
<dt>
The delegate that generates a widget per menu item.
<dd>
Sets the function that is called when an action is activated by the user; for example, when the user clicks a menu option, or presses an action’s shortcut key combination.
<dt>
This type is used to determine the direction of the layout. If the Stack’s orientation is eLeftToRight the widgets are placed in a horizontal row, from left to right. If the Stack’s orientation is eRightToLeft the widgets are placed in a horizontal row, from right to left. If the Stack’s orientation is eTopToBottom, the widgets are placed in a vertical column, from top to bottom. If the Stack’s orientation is eBottomToTop, the widgets are placed in a vertical column, from bottom to top. If the Stack’s orientation is eBackToFront, the widgets are placed sorted in a Z-order in top right corner. If the Stack’s orientation is eFrontToBack, the widgets are placed sorted in a Z-order in top right corner, the first widget goes to front.
<dd>
Determines if the child widgets should be clipped by the rectangle of this Stack.
<dt>
Sets a non-stretchable space in pixels between child items of this layout.
<dd>
When children of a Z-based stack overlap mouse events are normally sent to the topmost one. Setting this property true will invert that behavior, sending mouse events to the bottom-most child.
<dt>
This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
<dd>
This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
<dt>
The name of the widget that user can set.
<dd>
By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
<dt>
An optional identifier of the widget we can use to refer to it in queries.
<dd>
This property holds whether the widget is visible.
<dt>
If the current zoom factor and DPI is less than this value, the widget is not visible.
<dd>
If the current zoom factor and DPI is bigger than this value, the widget is not visible.
<dt>
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
<dd>
Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
<dt>
Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dd>
Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
### Properties
- **enabled** `bool`
- This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
- **selected** `bool`
- This property holds a flag that specifies the widget has to use eSelected state of the style.
- **checked** `bool`
- This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
- **dragging** `bool`
- This property holds if the widget is being dragged.
- **opaque_for_mouse_events** `bool`
- If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
- **skip_draw_when_clipped** `bool`
- The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
- **mouse_moved_fn** `Callable`
- Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
- **mouse_pressed_fn** `Callable`
- Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
- **mouse_released_fn** `Callable`
- Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
- **mouse_double_clicked_fn** `Callable`
- Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
- **mouse_wheel_fn** `Callable`
- Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
- **mouse_hovered_fn** `Callable`
- Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
- **drag_fn** `Callable`
- Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
- **accept_drop_fn** `Callable`
- Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
- **drop_fn** `Callable`
- Specify that this Widget accepts drops and set the callback to the drop operation.
- **computed_content_size_changed_fn** `Callable`
- Called when the size of the widget is changed.
### Methods
- **call_on_build_fn**
- Called to re-create new children.
- **get_current**
- Returns the current instance of `omni.ui._ui.Menu`.
### Return the menu that is currently shown.
### Called to re-create new children.
### Close the menu window. It only works for pop-up context menu and for teared off menu.
### Make Menu dirty so onBuild will be executed to replace the children.
### Called to re-create new children.
### Set the function to be called when the shown state of the menu changes.
### set_shown_changed_fn
```python
def set_shown_changed_fn(self: omni.ui._ui.Menu, fn: Callable[[bool], None]) -> None:
```
If the pulldown menu is shown on the screen.
### set_teared_changed_fn
```python
def set_teared_changed_fn(self: omni.ui._ui.Menu, fn: Callable[[bool], None]) -> None:
```
If the window is teared off.
### show
```python
def show(self: omni.ui._ui.Menu) -> None:
```
Create a popup window and show the menu in it. It’s usually used for context menus that are typically invoked by some special keyboard key or by right-clicking.
### show_at
```python
def show_at(self: omni.ui._ui.Menu, arg0: float, arg1: float) -> None:
```
Create a popup window and show the menu in it. This enable to popup the menu at specific position. X and Y are in points to make it easier to the Python users.
### tear_at
```python
def tear_at(self: omni.ui._ui.Menu, arg0: float, arg1: float) -> None:
```
### omni.ui.Menu.tear_at
```python
def tear_at(
arg0: int,
arg1: float
) -> None
```
Create a popup window and show the menu in it. This tear the menu at specific position. X and Y are in points to make it easier to the Python users.
### omni.ui.Menu.shown
```python
property shown
```
If the pulldown menu is shown on the screen.
### omni.ui.Menu.tearable
```python
property tearable
```
The ability to tear the window off.
### omni.ui.Menu.teared
```python
property teared
```
If the window is teared off. | 10,567 |