file_path
stringlengths
5
148
content
stringlengths
0
526k
omni.kit.window.popup_dialog.InputDialog.md
# InputDialog ## Overview The `InputDialog` class is a part of the `omni.kit.window.popup_dialog` module. It is used to create a dialog box that prompts the user for input. ### Constructor ```python class omni.kit.window.popup_dialog.InputDialog( width: int = 400, parent: Optional[Widget] = None, message: Optional[str] = None, title: Optional[str] = None, ok_handler: Optional[Callable[[str], None]] = None ) ``` #### Parameters - `width`: The width of the dialog box. Default is `400`. - `parent`: The parent widget of the dialog box. Default is `None`. - `message`: The message to be displayed in the dialog box. Default is `None`. - `title`: The title of the dialog box. Default is `None`. - `ok_handler`: A callback function to be executed when the OK button is clicked. Default is `None`. ``` [Callable[..., None], None] = None, cancel_handler: Optional[Callable[[AbstractDialog], None]] = None, ok_label: str = 'Ok', cancel_label: str = 'Cancel', input_cls: Optional[AbstractField] = None, pre_label: Optional[str] = None, post_label: Optional[str] = None, default_value: Optional[str] = None, warning_message: Optional[str] = None ## InputDialog ### Description A simple popup dialog with an input field and two buttons, OK and Cancel. ### Bases - `PopupDialog` ### Keyword Arguments - **width** (int) – Width of popup window. Default 400. - **parent** (obj:'omni.ui.Widget') – OBSOLETE. - **message** (str) – Message to display. - **title** (str) – Title of popup window. Default None. - **ok_handler** (Callable[[AbstractDialog], None]) – Handler called when click ok button. Default None. Function signature is: void ok_handler(AbstractDialog) - **cancel_handler** (Callable[[AbstractDialog], None]) – Handler called when click cancel button. Default None. Function signature is: void ok_handler(AbstractDialog) - **ok_label** (str) – Label text for ok button. Default “Ok”. - **cancel_label** (str) – Label text for cancel button. Default “Cancel”. - **input_cls** (omni.ui.AbstractField) – Type of input field specified by class name, e.g. omni.ui.StringField, omni.ui.IntField, omni.ui.CheckBox. Default is omni.ui.StringField. - **pre_label** (str) – Text displayed before input field. Default None. - **post_label** (str) – Text displayed after input field. Default None. - **default_value** (str) – Default value of the input field. - **warning_message** (Optional[str]) – Warning message that will displayed in red with the warning glyph. Default None. ### Methods - `__init__`([width, parent, message, title, ...]) – Inherited args from the base class. - `destroy`() – Destructor. - `get_value`() – Returns field value. ### Attributes - (No attributes listed) __init__( width: int = 400, parent: Optional[Widget] = None, message: Optional[str] = None, title: Optional[str] = None, ok_handler: Optional[Callable[[AbstractDialog], None]] = None, cancel_handler: Optional[Callable[[AbstractDialog], None]] = None, ok_label: str = 'Ok' ) : str = 'Cancel', input_cls: Optional[AbstractField] = None, pre_label: Optional[str] = None, post_label: Optional[str] = None, default_value: Optional[str] = None, warning_message: Optional[str] = None ) Inherited args from the base class. **Keyword Arguments** * **width** (int) – Window width. Default 400. * **title** (str) – Title to display. Default None. * **ok_handler** (Callable) – Function to invoke when Ok button clicked. Function signature: void okay_handler(dialog: PopupDialog) * **cancel_handler** (Callable) – Function to invoke when Cancel button clicked. Function signature: void cancel_handler(dialog: PopupDialog) * **ok_label** (str) – Alternative text to display on ‘Accept’ button. Default ‘Ok’. * **cancel_label** (str) – Alternative text to display on ‘Cancel’ button. Default ‘Cancel’. * **warning_message** (Optional[str]) – Warning message to display. Default None. ### InputDialog Methods #### WarningMessage - **warning_message** (str) – Warning message that will displayed in red with the warning glyph. Default None. #### Parent - **parent** (omni.ui.Widget) – OBSOLETE. #### Destroy - **destroy** () – Destructor. #### GetValue - **get_value** () – Returns field value. - **Returns**: Any, e.g. one of [str, int, float, bool]
omni.kit.window.popup_dialog.InputWidget.md
# InputWidget ## Class Definition ```python class omni.kit.window.popup_dialog.InputWidget(message: Optional[str] = None, input_cls: Optional[AbstractField] = None, pre_label: Optional[str] = None, post_label: Optional[str] = None) ``` ### Parameters - `message`: Optional message string. Default is `None`. - `input_cls`: Optional AbstractField class. Default is `None`. - `pre_label`: Optional pre-label string. Default is `None`. - `post_label`: Optional post-label string. Default is `None`. ``` ### Description InputWidget is a class within the `omni.kit.window.popup_dialog` module, designed to handle input dialogs with customizable labels and input fields. ``` ### Usage ```python # Example usage of InputWidget from omni.kit.window.popup_dialog import InputWidget # Create an instance of InputWidget input_widget = InputWidget(message="Enter your name", input_cls=TextInputField, pre_label="Name:", post_label="Please") ``` ### Additional Notes - The `InputWidget` class can be extended or modified to fit specific application requirements. - Ensure that the `input_cls` parameter is correctly specified to match the desired input field type. ``` ### References - [omni.kit.window.popup_dialog Documentation](https://docs.omniverse.nvidia.com/kit/docs) ``` ## InputWidget ### Description A simple widget with an input field. As opposed to the dialog class, the widget can be combined with other widget types in the same window. ### Bases - object ### Keyword Arguments - **message** (str) – Message to display. - **input_cls** (omni.ui.AbstractField) – Class of the input field, e.g. omni.ui.StringField, omni.ui.IntField, omni.ui.CheckBox. Default is omni.ui.StringField. - **pre_label** (str) – Text displayed before input field. Default None. - **post_label** (str) – Text displayed after input field. Default None. - **default_value** (str) – Default value of the input field. ### Methods - **__init__(message=None, input_cls=None, pre_label=None, post_label=None, ...)** - **destroy()** – Destructor. - **get_value()** – Returns value of input field. <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="n"> <span class="pre"> Optional </span> <span class="p"> <span class="pre"> [ </span> </span> <span class="pre"> str </span> <span class="p"> <span class="pre"> ] </span> </span> </span> <span class="w"> </span> <span class="o"> <span class="pre"> = </span> </span> <span class="w"> </span> <span class="default_value"> <span class="pre"> None </span> </span> </em> , <em class="sig-param"> <span class="n"> <span class="pre"> default_value </span> </span> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="n"> <span class="pre"> Optional </span> <span class="p"> <span class="pre"> [ </span> </span> <span class="pre"> Any </span> <span class="p"> <span class="pre"> ] </span> </span> </span> <span class="w"> </span> <span class="o"> <span class="pre"> = </span> </span> <span class="w"> </span> <span class="default_value"> <span class="pre"> None </span> </span> </em> <span class="sig-paren"> ) </span> </dt> <dd> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.window.popup_dialog.InputWidget.destroy"> <span class="sig-name descname"> <span class="pre"> destroy </span> </span> <span class="sig-paren"> ( </span> <span class="sig-paren"> ) </span> </dt> <dd> <p> Destructor. </p> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.window.popup_dialog.InputWidget.get_value"> <span class="sig-name descname"> <span class="pre"> get_value </span> </span> <span class="sig-paren"> ( </span> <span class="sig-paren"> ) </span> <span class="sig-return"> <span class="sig-return-icon"> → </span> <span class="sig-return-typehint"> <span class="pre"> Any </span> </span> </span> </dt> <dd> <p> Returns value of input field. </p> <dl class="field-list simple"> <dt class="field-odd"> Returns </dt> <dd class="field-odd"> <p> Any </p> </dd> </dl> </dd> </dl> </dd> </dl> </section> </div> </div> <footer> <hr/> </footer> </div> </div> </section> </div>
omni.kit.window.popup_dialog.MessageDialog.md
# MessageDialog ## MessageDialog [AbstractDialog], None] = None , cancel_handler: Optional[Callable[[AbstractDialog], None]] = None , ok_label: str = 'Ok' , cancel_label: str = 'Cancel' , disable_okay_button: bool = False , disable_cancel_button: bool = False , warning_message: Optional[str] = None ) Bases: PopupDialog This simplest of all popup dialogs displays a confirmation message before executing an action. Keyword Arguments: - **width** (int) – Width of popup window. Default 400. - **parent** (obj:'omni.ui.Widget'): OBSOLETE. - **message** (str) – The displayed message. Default ‘’. - **title** (str) – Title of popup window. Default None. - **ok_handler** (Optional[Callable[[AbstractDialog], None]]) – The handler for the OK button. ### Parameters - **ok_handler** (Callable[[AbstractDialog], None]) – Handler called when click ok button. Default None. Function signature is: void ok_handler(AbstractDialog) - **cancel_handler** (Callable[[AbstractDialog], None]) – Handler called when click cancel button. Default None. Function signature is: void ok_handler(AbstractDialog) - **ok_label** (str) – Label text for ok button. Default “Ok”. - **cancel_label** (str) – Label text for cancel button. Default “Cancel”. - **disable_okay_button** (bool) – If True, then don’t display ‘Ok’ button. Default False. - **disable_cancel_button** (bool) – If True, then don’t display ‘Cancel’ button. Default False. - **warning_message** (Optional[str]) – Warning message that will displayed in red with the warning glyph. Default None. ### Methods - **__init__** ([width: int = 400, parent: Optional[Widget] = None, message: str = '', title: Optional[str] = None, ...]) Inherited args from the base class. - **destroy** () Destructor - **set_message** (message: str) Updates the message string. ### Attributes - (No attributes listed) Parameters: - `parent`: Optional[AbstractWindow] = None - `ok_handler`: Optional[Callable[[AbstractDialog], None]] = None - `cancel_handler`: Optional[Callable[[AbstractDialog], None]] = None - `ok_label`: str = 'Ok' - `cancel_label`: str = 'Cancel' - `disable_okay_button`: bool = False - `disable_cancel_button`: bool = False - `warning_message`: Optional[str] = None ``` Inherited args from the base class. <dl class="field-list simple"> <dt class="field-odd"> Keyword Arguments </dt> <dd class="field-odd"> <ul class="simple"> <li> <p> <strong> width </strong> ( <em> int </em> ) – Window width. Default 400. </p> </li> <li> <p> <strong> title </strong> ( <em> str </em> ) – Title to display. Default None. </p> </li> <li> <p> <strong> ok_handler </strong> ( <em> Callable </em> ) – Function to invoke when Ok button clicked. Function signature: void okay_handler(dialog: PopupDialog) </p> </li> <li> <p> <strong> cancel_handler </strong> ( <em> Callable </em> ) – Function to invoke when Cancel button clicked. Function signature: void cancel_handler(dialog: PopupDialog) </p> </li> <li> <p> <strong> ok_label </strong> ( <em> str </em> ) – Alternative text to display on ‘Accept’ button. Default ‘Ok’. </p> </li> <li> <p> <strong> cancel_label </strong> ( <em> str </em> ) – Alternative text to display on ‘Cancel’ button. Default ‘Cancel’. </p> </li> <li> <p> <strong> warning_message </strong> ( <em> Optional </em> <em> [ </em> <em> str </em> <em> ] </em> ) – Warning message that will displayed in red with the warning glyph. Default None. </p> </li> <li> <p> <strong> parent </strong> ( <em> omni.ui.Widget </em> ) – OBSOLETE. </p> </li> </ul> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.window.popup_dialog.MessageDialog.destroy"> <span class="sig-name descname"> <span class="pre"> destroy </span> </span> <span class="sig-paren"> ( </span> <span class="sig-paren"> ) </span> <a class="headerlink" href="#omni.kit.window.popup_dialog.MessageDialog.destroy" title="Permalink to this definition">  </a> </dt> <dd> <p> Destructor </p> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.window.popup_dialog.MessageDialog.set_message"> <span class="sig-name descname"> <span class="pre"> set_message </span> </span> <span class="sig-paren"> ( </span> <em class="sig-param"> <span class="n"> <span class="pre"> message </span> </span> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="n"> <span class="pre"> str </span> </span> </em> <span class="sig-paren"> ) </span> <a class="headerlink" href="#omni.kit.window.popup_dialog.MessageDialog.set_message" title="Permalink to this definition">  </a> </dt> <dd> <p> Updates the message string. </p> <dl class="field-list simple"> <dt class="field-odd"> Parameters </dt> <dd class="field-odd"> <p> <strong> message </strong> ( <em> str </em> ) – The message string. </p> </dd> </dl> </dd> </dl>
omni.kit.window.popup_dialog.MessageWidget.md
# MessageWidget ## MessageWidget ```python class omni.kit.window.popup_dialog.MessageWidget(message: str = ''): ``` Bases: `object` This widget displays a custom message. As opposed to the dialog class, the widget can be combined with other widget types in the same window. ### Keyword Arguments - **message** (`str`) – The message string ### Methods - `__init__(message)` - `destroy()` - Destructor. - `set_message(message)` - Updates the message string. ``` ## Methods ### `__init__()` Initializes the widget. ### `destroy()` Destructor. ### `set_message(message: str)` Updates the message string. #### Parameters - **message** (str) – The message string.
omni.kit.window.popup_dialog.OptionsDialog.md
# OptionsDialog ## OptionsDialog ### Class ```python class omni.kit.window.popup_dialog.OptionsDialog(width: int = 400, parent: Optional[Widget] = None, message: Optional[str] = None, title: Optional[str] = None, ok_handler: Optional[Callable[[], None]] = None) ``` ``` [ Callable [ AbstractDialog ], , None ] = None , cancel_handler: Optional[Callable[[AbstractDialog], None]] = None , ok_label: str = 'Ok' , cancel_label: str = 'Cancel' , field_defs: Optional[List[OptionsDialogFieldDef]] = None , value_changed_fn: Optional[Callable[]] = None , radio_group: bool = False ) Bases: PopupDialog A simple checkbox dialog with a set options and two buttons, OK and Cancel Keyword Arguments: - **width** (int) – Width of popup window. Default 400. - **obj** (`parent`) – `omni.ui.Widget`: OBSOLETE. - **message** (`str`) – Message string. - **title** (`str`) – Title of popup window. Default None. - **ok_handler** (`Callable[[AbstractDialog], None]`) – Handler called when click ok button. Default None. Function signature is: void ok_handler(AbstractDialog) - **cancel_handler** (`Callable[[AbstractDialog], None]`) – Handler called when click cancel button. Default None. Function signature is: void ok_handler(AbstractDialog) - **ok_label** (`str`) – Label text for ok button. Default “Ok”. - **cancel_label** (`str`) – Label text for cancel button. Default “Cancel”. - **field_defs** (`[OptionsDialog.FieldDef]`) – List of FieldDefs. Default []. - **value_changed_fn** (`Callable`) – This callback is triggered on any value change. - **radio_group** (`bool`) – If True, then only one option can be selected at a time. ### Note OptionsDialog.FieldDef: A namedtuple of (name, label, default) for describing the options field, e.g. OptionsDialog.FieldDef(“option”, “Option”, True). ### Methods - `__init__([width, parent, message, title, ...])` - Inherited args from the base class. - `destroy()` - Destructor - `get_choice()` - Returns name of chosen option. - `get_value(name)` - Returns value of the named field. - `get_values()` - Returns all values in a dictionary. ### Attributes parent : Optional[Widget] = None message : Optional[str] = None title : Optional[str] = None ok_handler : Optional[Callable[[AbstractDialog], None]] = None cancel_handler : Optional[Callable[[AbstractDialog], None]] = None ok_label : str = 'Ok' cancel_label : str = 'Cancel' ### OptionsDialog.__init__ **Parameters:** - **options_def** (Optional[List[OptionsDialogFieldDef]]) = None - **value_changed_fn** (Optional[Callable]) = None - **radio_group** (bool) = False **Keyword Arguments:** - **width** (int) – Window width. Default 400. - **title** (str) – Title to display. Default None. - **ok_handler** (Callable) – Function to invoke when Ok button clicked. Function signature: void okay_handler(dialog: PopupDialog) - **cancel_handler** (Callable) – Function to invoke when Cancel button clicked. Function signature: void cancel_handler(dialog: PopupDialog) - **ok_label** (str) – Alternative text to display on ‘Accept’ button. Default ‘Ok’. - **cancel_label** (str) – Alternative text to display on ‘Cancel’ button. Default ‘Cancel’. - **warning_message** (Optional[str]) – Warning message that will displayed in red with the warning glyph. Default None. - **parent** (omni.ui.Widget) – OBSOLETE. ### OptionsDialog.FieldDef alias of OptionsDialogFieldDef ### OptionsDialog.destroy Destructor ### OptionsDialog.get_choice **Returns:** - str Returns name of chosen option. ## get_value ### Description Returns value of the named field. ### Parameters - **name** (str) – Name of the field. ### Returns - bool ## get_values ### Description Returns all values in a dictionary. ### Returns - Dict
omni.kit.window.popup_dialog.OptionsMenu.md
# OptionsMenu ## OptionsMenu ### OptionsMenu , **cancel_handler** (: Optional[Callable[[AbstractDialog], None]]) = None, **ok_label** (str) = 'Ok', **cancel_label** (str) = 'Cancel', **field_defs** (: Optional[List[OptionsMenuFieldDef]]) = None, **value_changed_fn** (: Optional[Callable]) = None ) Bases: - PopupDialog A simple checkbox menu with a set of options Keyword Arguments: - **title** (str) – Title of this menu. Default None. - **field_defs** ([OptionsMenu.FieldDef]) – List of FieldDefs. Default []. - **value_changed_fn** (Callable) – This callback is triggered on any value change. Note: - OptionsMenu.FieldDef: A namedtuple of (name, label, glyph, default) for describing the options field, e.g. OptionsDialog.FieldDef("option", "Option", None, True). Methods: - __init__ | Method | Description | | --- | --- | | `__init__([width=400, parent=None, title=None, ok_handler=None, ...])` | Inherited args from the base class. | | `destroy()` | Destructor | | `get_value(name)` | Returns value of the named field. | | `get_values()` | Returns all values in a dictionary. | | `reset_values()` | Resets all values to their defaults. | | `set_value(name, value)` | Sets the value of the named field. | ### Attributes `__init__(width: int = 400, parent: Optional[Widget] = None, title: Optional[str] = None, ok_handler: Optional[Callable[[AbstractDialog], None]] = None, cancel_handler: Optional[Callable[[AbstractDialog], None]] = None)` : Optional[Callable[[AbstractDialog], None], None] ok_label: str = 'Ok' cancel_label: str = 'Cancel' field_defs: Optional[List[OptionsMenuFieldDef]] = None value_changed_fn: Optional[Callable] = None Inherited args from the base class. Keyword Arguments - **width** (int) – Window width. Default 400. - **title** (str) – Title to display. Default None. - **ok_handler** (Callable) – Function to invoke when Ok button clicked. Function signature: void okay_handler(dialog: PopupDialog) - **cancel_handler** (Callable) – Function to invoke when Cancel button clicked. Function signature: void cancel_handler(dialog: PopupDialog) - **ok_label** (str) – Alternative text to display on ‘Accept’ button. Default ‘Ok’. - **cancel_label** (str) – Alternative text to display on ‘Cancel’ button. Default ‘Cancel’. - **warning_message** (Optional[str]) – Warning message that will displayed in red with the warning glyph. Default None. - **parent** ( <em> omni.ui.Widget </em> ) – OBSOLETE. ### FieldDef alias of `OptionsMenuFieldDef` ### destroy Destructor ### get_value Returns value of the named field. **Parameters** - **name** (`str`) – Name of the field. **Returns** - bool ### get_values Returns all values in a dictionary. **Returns** - dict ### reset_values Resets all values to their defaults. ### set_value Sets the value of the named field. **Parameters** - **name** (`str`) – Name of the field. - **value** (`bool`) – New value
omni.kit.window.popup_dialog.OptionsMenuWidget.md
# OptionsMenuWidget ## Class Definition ```python class omni.kit.window.popup_dialog.OptionsMenuWidget: def __init__(self, title: Optional[str] = None, field_defs: List[OptionsMenuFieldDef] = [], value_changed_fn: Optional[Callable] = None, build_ui: bool = True): ``` ### Description Bases: ``` ``` # Object A simple checkbox widget with a set of options. As opposed to the menu class, the widget can be combined with other widget types in the same window. ## Keyword Arguments - **title** (`str`) – Title of this menu. Default None. - **field_defs** (`[OptionsDialog.FieldDef]`) – List of FieldDefs. Default []. - **value_changed_fn** (`Callable`) – This callback is triggered on any value change. - **build_ui** (`bool`) – Build ui when created. ## Note OptionsMenu.FieldDef: A namedtuple of (name, label, glyph, default) for describing the options field, e.g. OptionsDialog.FieldDef("option", "Option", None, True). ## Methods - `__init__([title, field_defs, ...])` - `build_ui()` - `destroy()` - Destructor. - `get_value(name)` - Returns value of the named field. - `get_values()` - Returns all values in a dictionary. - `reset_values()` - Resets all values to their defaults. - `set_value(name, value)` - Sets the value of the named field. ### __init__(title: Optional[str] = None, field_defs: List[OptionsMenuFieldDef] = []) ### OptionsMenuWidget Class #### `__init__(self, title: str = "Options", value_changed_fn: Optional[Callable] = None, build_ui: bool = True)` - `title` (str): The title of the options menu. - `value_changed_fn` (Optional[Callable]): A callback function for value changes. Default is `None`. - `build_ui` (bool): Whether to build the UI. Default is `True`. #### `destroy(self)` - Destructor. #### `get_value(self, name: str)` - `name` (str): The name of the field. - Returns: bool - Description: Returns value of the named field. #### `get_values(self)` - Returns: dict - Description: Returns all values in a dictionary. #### `reset_values(self)` - Description: Resets all values to their defaults. #### `set_value(self, name: str, value: bool)` - `name` (str): The name of the field. - `value` (bool): The value to set. - Description: Sets the value of the named field. </em>) – New value
omni.kit.window.popup_dialog.OptionsWidget.md
# OptionsWidget ## Class Definition ```python class omni.kit.window.popup_dialog.OptionsWidget(message: Optional[str] = None, field_defs: List[OptionsDialogFieldDef] = [], value_changed_fn: Optional[Callable] = None, radio_group: bool = False) ``` ### Description Bases: `object` ``` A simple checkbox widget with a set options. As opposed to the dialog class, the widget can be combined with other widget types in the same window. ### Keyword Arguments - **message** (`str`) – Message string. - **field_defs** (`[OptionsDialog.FieldDef]`) – List of FieldDefs. Default []. - **value_changed_fn** (`Callable`) – This callback is triggered on any value change. - **radio_group** (`bool`) – If True, then only one option can be selected at a time. ### Note OptionsDialog.FieldDef: A namedtuple of (name, label, default) for describing the options field, e.g. OptionsDialog.FieldDef("option", "Option", True). ### Methods - `__init__(message, field_defs, ...)` - `destroy()` - `get_choice()` - `get_value(name)` - `get_values()` #### __init__(message=None, field_defs=[], value_changed_fn=None, radio_group=False) - `message`: Optional[str] = None - `field_defs`: List[OptionsDialogFieldDef] = [] - `value_changed_fn`: Optional[Callable] = None - `radio_group`: bool = False ## Methods ### __init__ ```python def __init__( self, radio_group: bool = False ) ``` ### destroy ```python def destroy() ``` Destructor. ### get_choice ```python def get_choice() -> str ``` Returns name of chosen option. #### Returns - str ### get_value ```python def get_value(name: str) -> bool ``` Returns value of the named field. #### Parameters - **name** (str) – Name of the field. #### Returns - bool ### get_values ```python def get_values() -> dict ``` Returns all values in a dictionary. #### Returns - dict
omni.kit.window.popup_dialog.PopupDialog.md
# PopupDialog ## PopupDialog ( width: Optional[int] = None, cancel_handler: Optional[Callable[[AbstractDialog], None]] = None, ok_label: str = 'Ok', cancel_label: str = 'Cancel', hide_title_bar: bool = False, modal: bool = False, warning_message: Optional[str] = None ) Bases: AbstractDialog Base class for a simple popup dialog with two primary buttons, OK and Cancel. Methods ------- - __init__(width, parent, title, ok_handler, ...) - Inherited args from the base class. - destroy() - Destructor - hide() - Hides this dialog. - set_cancel_clicked_fn() - Sets the function to be called when the cancel button is clicked. ### Methods | Description | |-------------| | Sets function to invoke when Cancel button is clicked. | | Sets function to invoke when Okay button is clicked. | | Shows this dialog, optionally offset from the parent widget, if any. | ### Attributes | Attribute | Description | |-----------|-------------| | WINDOW_FLAGS | | | position_x | Get position x of the dialog window. | | position_y | Get position y of the dialog window. | | window | Get the dialog window widget. | ### Initialization ```python __init__(width: int = 400, parent: Optional[Widget] = None, title: Optional[str] = None, ok_handler: Optional[Callable[[AbstractDialog], None]] = None) ``` Inherited args from the base class. **Keyword Arguments** * **width** (int) – Window width. Default 400. * **title** (str) – Title to display. Default None. * **ok_handler** (Callable) – Function to invoke when Ok button clicked. Function signature: void okay_handler(dialog: PopupDialog) * **cancel_handler** (Callable) – Function to invoke when Cancel button clicked. Function signature: void cancel_handler(dialog: PopupDialog) * **ok_label** (str) – Alternative text to display on ‘Accept’ button. Default ‘Ok’. * **cancel_label** (str) – Alternative text to display on ‘Cancel’ button. Default ‘Cancel’. * **warning_message** (Optional[str]) – Warning message to display. Default None. - **warning_message** (Optional [str]) – Warning message that will displayed in red with the warning glyph. Default None. - **parent** (omni.ui.Widget) – OBSOLETE. ### destroy() Destructor ### hide() Hides this dialog. ### set_cancel_clicked_fn(cancel_handler: Callable[[AbstractDialog], None]) Sets function to invoke when Cancel button is clicked. **Parameters** - **cancel_handler** (Callable) – Callback with signature: void cancel_handler(dialog: PopupDialog) ### set_okay_clicked_fn(ok_handler: Callable[[AbstractDialog], None]) Sets function to invoke when Okay button is clicked. **Parameters** - **ok_handler** (Callable) – Callback with signature: void okay_handler(dialog: PopupDialog) ### show(offset_x: int = 0, offset_y: int = 0, parent: omni.ui.Widget) ### PopupDialog.show Method Shows this dialog, optionally offset from the parent widget, if any. #### Keyword Arguments - **offset_x** (int) – X offset. Default 0. - **offset_y** (int) – Y offset. Default 0. - **parent** (ui.Widget) – Offset from this parent widget. Default None. - **recreate_window** (bool) – Recreate popup window. Default False. ### PopupDialog.position_x Property Get position x of the dialog window. #### Returns - int ### PopupDialog.position_y Property Get position y of the dialog window. #### Returns - int ### PopupDialog.window Property Get the dialog window widget. #### Returns - obj:'omni.ui.window'
omni.kit.window.preferences.Classes.md
# omni.kit.window.preferences Classes ## Classes Summary: | Class Name | Description | |------------|-------------| | PreferenceBuilder | Page building class | | PreferenceBuilderUI | Preferences “page” display functions. | | PreferencesExtension | Preference window class. | | SettingType | Supported setting types for create_setting_widget. |
omni.kit.window.preferences.deregister_actions.md
# deregister_actions ## deregister_actions ```python omni.kit.window.preferences.deregister_actions(extension_id) ``` Deregister actions: show_preferences_window, hide_preferences_window, toggle_preferences_window. ```
omni.kit.window.preferences.Functions.md
# omni.kit.window.preferences Functions ## Functions Summary: | Function Name | Description | |---------------|-------------| | `deregister_actions` | Deregister actions: show_preferences_window, hide_preferences_window, toggle_preferences_window. | | `get_instance` | Get instance of preference window class. | | `get_page_list` | Get list of all available pages. | | `get_shown_page_list` | Gets list of pages that are visible. IE list of pages that PreferenceBuilder.show_page() returned True. | | `hide_preferences_window` | Hide the Preferences window from the User. | | `rebuild_pages` | rebuild UI | | `register_actions` | Register actions: show_preferences_window, hide_preferences_window, toggle_preferences_window. | | `register_page` | Add new custom page to preference window list. | | `select_page` | Select page to display and refresh. | | `show_file_importer` | Shows file importer. | | `show_preferences_window` | Show the Preferences window to the User. | | 操作 | 描述 | | --- | --- | | show_preferences_window | Show the Preferences window to the User. | | unregister_page | Remove custom page from preference window list. |
omni.kit.window.preferences.get_instance.md
# get_instance ## get_instance ```python omni.kit.window.preferences.get_instance() ``` Get instance of preference window class. ```
omni.kit.window.preferences.get_page_list.md
# get_page_list ## get_page_list ### omni.kit.window.preferences.get_page_list Get list of all available pages.
omni.kit.window.preferences.get_shown_page_list.md
# get_shown_page_list ## get_shown_page_list ### omni.kit.window.preferences.get_shown_page_list ``` ``` Gets list of pages that are visible. IE list of pages that PreferenceBuilder.show_page() returned True. ```
omni.kit.window.preferences.hide_preferences_window.md
# hide_preferences_window ## hide_preferences_window ```python omni.kit.window.preferences.hide_preferences_window() ``` Hide the Preferences window from the User. ```
omni.kit.window.preferences.md
# omni.kit.window.preferences ## Submodules Summary: - **omni.kit.window.preferences.scripts** - Preference window classes. ## Classes Summary: - **PreferenceBuilder** - Page building class - **PreferenceBuilderUI** - Preferences “page” display functions. - **PreferencesExtension** - Preference window class. - **SettingType** - Supported setting types for create_setting_widget. ## Functions Summary: - **deregister_actions** - Deregister actions: show_preferences_window, hide_preferences_window, toggle_preferences_window. - **get_instance** - Get instance of preference window class. - **get_page_list** - Get list of all available pages. - **get_shown_page_list** - Gets list of pages that are visible. IE list of pages that PreferenceBuilder.show_page() returned True. - **hide_preferences_window** - Hide the preferences window. | 操作 | 描述 | | --- | --- | | hide_preferences_window | Hide the Preferences window from the User. | | rebuild_pages | rebuild UI | | register_actions | Register actions: show_preferences_window, hide_preferences_window, toggle_preferences_window. | | register_page | Add new custom page to preference window list. | | select_page | Select page to display and refresh. | | show_file_importer | Shows file importer. | | show_preferences_window | Show the Preferences window to the User. | | unregister_page | Remove custom page from preference window list. |
omni.kit.window.preferences.PreferenceBuilder.md
# PreferenceBuilder ## Class: omni.kit.window.preferences.PreferenceBuilder - **Bases:** `object` - **Methods:** - `__init__(title)` - `add_frame(name)` - Create a UI collapsable frame. - `cleanup_slashes(path[, is_directory])` - Makes path/slashes uniform - `create_setting_widget(label_name, ...)` - Create a UI widget connected with a setting. - `create_setting_widget_combo(name, ...[, ...])` - Creating a Combo Setting widget. ### Methods Detail #### `__init__(title)` #### `add_frame(name)` Create a UI collapsable frame. #### `cleanup_slashes(path[, is_directory])` Makes path/slashes uniform #### `create_setting_widget(label_name, ...)` Create a UI widget connected with a setting. #### `create_setting_widget_combo(name, ...[, ...])` Creating a Combo Setting widget. <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> get_title </span> </code> </a> () </p> </td> <td> <p> Gets the page title </p> </td> </tr> <tr class="row-odd"> <td> <p> <a class="reference internal" href="#omni.kit.window.preferences.PreferenceBuilder.label" title="omni.kit.window.preferences.PreferenceBuilder.label"> <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> label </span> </code> </a> (name[, tooltip]) </p> </td> <td> <p> Create a UI widget label. </p> </td> </tr> <tr class="row-even"> <td> <p> <a class="reference internal" href="#omni.kit.window.preferences.PreferenceBuilder.show_page" title="omni.kit.window.preferences.PreferenceBuilder.show_page"> <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> show_page </span> </code> </a> ()</p> </td> <td> <p> Page is visible. </p> </td> </tr> <tr class="row-odd"> <td> <p> <a class="reference internal" href="#omni.kit.window.preferences.PreferenceBuilder.spacer" title="omni.kit.window.preferences.PreferenceBuilder.spacer"> <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> spacer </span> </code> </a> ()</p> </td> <td> <p> Create a UI spacer. </p> </td> </tr> </tbody> </table> <p class="rubric"> Attributes </p> <table class="autosummary longtable docutils align-default"> <colgroup> <col style="width: 10%"/> <col style="width: 90%"/> </colgroup> <tbody> <tr class="row-odd"> <td> <p> <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> WINDOW_NAME </span> </code> </p> </td> <td> <p> </p> </td> </tr> </tbody> </table> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.window.preferences.PreferenceBuilder.__init__"> <span class="sig-name descname"> <span class="pre"> __init__ </span> </span> <span class="sig-paren"> ( </span> <em class="sig-param"> <span class="n"> <span class="pre"> title </span> </span> </em> <span class="sig-paren"> )</span> <a class="headerlink" href="#omni.kit.window.preferences.PreferenceBuilder.__init__" title="Permalink to this definition">  </a> </dt> <dd> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.window.preferences.PreferenceBuilder.add_frame"> <span class="sig-name descname"> <span class="pre"> add_frame </span> </span> <span class="sig-paren"> ( </span> <em class="sig-param"> <span class="n"> <span class="pre"> name </span> </span> <span class="p"> <span class="pre"> :</span> </span> <span class="w"> </span> <span class="n"> <span class="pre"> str </span> </span> </em> <span class="sig-paren"> )</span> <span class="sig-return"> <span class="sig-return-icon"> → </span> <span class="sig-return-typehint"> <span class="pre"> CollapsableFrame </span> </span> </span> <a class="headerlink" href="#omni.kit.window.preferences.PreferenceBuilder.add_frame" title="Permalink to this definition">  </a> </dt> <dd> <p> Create a UI collapsable frame. </p> <dl class="field-list simple"> <dt class="field-odd"> Parameters </dt> <dd class="field-odd"> <p> <strong> name </strong> – Name to be in frame </p> </dd> <dt class="field-even"> Returns </dt> <dd class="field-even"> <p> <code class="xref py py-class docutils literal notranslate"> <span class="pre"> ui.Widget </span> </code> connected with the setting on the path specified. </p> </dd> </dl> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.window.preferences.PreferenceBuilder.cleanup_slashes"> <span class="sig-name descname"> <span class="pre"> cleanup_slashes </span> </span> <span class="sig-paren"> ( </span> <em class="sig-param"> <span class="n"> <span class="pre"> path </span> </span> <span class="p"> <span class="pre"> :</span> </span> <span class="w"> </span> <span class="n"> <span class="pre"> str </span> </span> </em> , <em class="sig-param"> <span class="n"> <span class="pre"> is_directory </span> </span> <span class="p"> <span class="pre"> :</span> </span> <span class="w"> </span> <span class="n"> <span class="pre"> bool </span> </span> <span class="w"> </span> <span class="o"> <span class="pre"> =</span> </span> <span class="w"> </span> <span class="default_value"> <span class="pre"> False </span> </span> </em> <span class="sig-paren"> )</span> <span class="sig-return"> <span class="sig-return-icon"> → </span> <span class="sig-return-typehint"> <span class="pre"> str </span> </span> </span> <a class="headerlink" href="#omni.kit.window.preferences.PreferenceBuilder.cleanup_slashes" title="Permalink to this definition">  </a> </dt> <dd> <p> Makes path/slashes uniform </p> <dl class="field-list simple"> <dt class="field-odd"> Parameters </dt> <dd class="field-odd"> <ul class="simple"> <li> <p> <strong> path </strong> – path </p> </li> <li> <p> <strong> directory </strong> ( <em> is_directory is path a </em> ) – </p> </li> <li> <p> <strong> added </strong> ( <em> so final slash can be </em> ) – </p> </li> </ul> </dd> <dt class="field-even"> Returns </dt> <dd class="field-even"> <p> path </p> </dd> </dl> ## create_setting_widget ```python create_setting_widget(label_name: str, setting_path: str, setting_type: SettingType, **kwargs) -> Widget ``` - **Parameters**: - `label_name`: str - `setting_path`: str - `setting_type`: SettingType - `**kwargs` - **Returns**: Widget ### Description Create a UI widget connected with a setting. If `range_from` >= `range_to` there is no limit. Undo/redo operations are also supported, because changing setting goes through the `omni.kit.commands` module, using `:class:`.ChangeSettingCommand`. #### Parameters - **setting_path** – Path to the setting to show and edit. - **setting_type** – Type of the setting to expect. - **range_from** – Limit setting value lower bound. - **range_to** – Limit setting value upper bound. #### Returns `ui.Widget` connected with the setting on the path specified. ## create_setting_widget_combo ```python create_setting_widget_combo(name: str, setting_path: str, list: List[str], setting_is_index: Optional[bool] = None, **kwargs) -> Widget ``` - **Parameters**: - `name`: str - `setting_path`: str - `list`: List[str] - `setting_is_index`: Optional[bool] = None - `**kwargs` - **Returns**: Widget ### Description Creating a Combo Setting widget. This function creates a combo box that shows a provided list of names and it is connected with setting by path specified. Underlying setting values are used from values of `items` dict. - **setting_path** – Path to the setting to show and edit. - **items** – Can be either `dict` or :py:obj:`list`. For :py:obj:`dict` keys are UI displayed names, values are actual values set into settings. If it is a `list` UI displayed names are equal to setting values. - **setting_is_index** – None - Detect type from setting_path value. If the type is int, set to True. True - setting_path value is index into items list False - setting_path value is string in items list (default) ### get_title() - **Returns** - str name of the page ### label(name: str, tooltip: Optional[str] = None) - **Parameters** - **name** – Name to be in label - **tooltip** – The Tooltip string to be displayed when mouse hovers on the label - **Returns** - ui.Widget connected with the setting on the path specified. ### show_page() - **Returns** - True or False ### spacer() - **Returns** - Spacer **None**– **Returns** ``` ui.Widget ``` connected with the setting on the path specified. ---
omni.kit.window.preferences.PreferenceBuilderUI.md
# PreferenceBuilderUI ## Methods - `__init__(visibility_changed_fn)` - `create_window()` - Create omni.ui.window - `destroy()` - Destroy class and cleanup. - `hide_window()` - Hides window - `rebuild_pages()` - Rebuilds window pages using current page list | Method Name | Description | |-------------|-------------| | `select_page(page)` | If found, display the given Preference page and select its title in the TreeView. | | `set_active_page(page_index)` | Set the given page index as the active one. | | `show_window()` | Shows window | | `update_page_list(page_list)` | Updates page list | ### `__init__(visibility_changed_fn: Callable)` ### `create_window()` - **Parameters**: None - **Returns**: None ### `destroy()` Destroy class and cleanup. ### `hide_window()` - **Parameters**: None - **Returns**: None ### `rebuild_pages()` - **Parameters**: None - **Returns**: None ### `select_page(page)` ### PreferenceBuilderUI.select_page ```python def select_page(page) -> bool: ``` If found, display the given Preference page and select its title in the TreeView. #### Parameters - **page** – One of the page from the list of pages. #### Returns - A flag indicating if the given page was successfully selected. #### Return type - bool ### PreferenceBuilderUI.set_active_page ```python def set_active_page(page_index: Union[int, str]) -> None: ``` Set the given page index as the active one. #### Parameters - **page_index** – Index of page of the page list to set as the active one. #### Returns - None ### PreferenceBuilderUI.show_window ```python def show_window() -> None: ``` Shows window #### Parameters - **None** – #### Returns - None ### PreferenceBuilderUI.update_page_list ```python def update_page_list(page_list: List[str]) -> None: ``` Updates page list #### Parameters - **page_list** – list of pages #### Returns - None
omni.kit.window.preferences.PreferencesExtension.md
# PreferencesExtension ## PreferencesExtension - **Bases:** `IExt` - **Description:** Preference window class. ### Methods - **hide_preferences_window()** - **Description:** Hide the Preferences window from the User. - **on_shutdown()** - **Description:** - **on_startup(ext_id)** - **Description:** - **rebuild_pages()** - **Description:** Rebuild UI. - **select_page(page)** - **Description:** Select page to display and refresh. - **show_preferences_window()** - **Description:** Show the Preferences window to the User. ### __init__ <span class="sig-paren"> ( </span> <em class="sig-param"> <span class="n"> <span class="pre"> self </span> </span> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="n"> <span class="pre"> omni.ext._extensions.IExt </span> </span> </em> <span class="sig-paren"> ) </span> <span class="sig-return"> <span class="sig-return-icon"> → </span> <span class="sig-return-typehint"> <span class="pre"> None </span> </span> </span> </dt> <dd> </dd> </dl> <dl class="py class"> <dt class="sig sig-object py" id="omni.kit.window.preferences.PreferencesExtension.PreferencesState"> <em class="property"> <span class="pre"> class </span> <span class="w"> </span> </em> <span class="sig-name descname"> <span class="pre"> PreferencesState </span> </span> <span class="sig-paren"> ( </span> <em class="sig-param"> <span class="n"> <span class="pre"> value </span> </span> </em> <span class="sig-paren"> ) </span> </dt> <dd> <p> Bases: <code class="xref py py-class docutils literal notranslate"> <span class="pre"> IntFlag </span> </code> </p> <p> Preference startup state, either Invalid or Created. </p> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.window.preferences.PreferencesExtension.hide_preferences_window"> <span class="sig-name descname"> <span class="pre"> hide_preferences_window </span> </span> <span class="sig-paren"> ( </span> <span class="sig-paren"> ) </span> </dt> <dd> <p> Hide the Preferences window from the User. </p> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.window.preferences.PreferencesExtension.rebuild_pages"> <span class="sig-name descname"> <span class="pre"> rebuild_pages </span> </span> <span class="sig-paren"> ( </span> <span class="sig-paren"> ) </span> </dt> <dd> <p> Rebuild UI. </p> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.window.preferences.PreferencesExtension.select_page"> <span class="sig-name descname"> <span class="pre"> select_page </span> </span> <span class="sig-paren"> ( </span> <em class="sig-param"> <span class="n"> <span class="pre"> page </span> </span> </em> <span class="sig-paren"> ) </span> </dt> <dd> <p> Select page to display and refresh. </p> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.window.preferences.PreferencesExtension.show_preferences_window"> <span class="sig-name descname"> <span class="pre"> show_preferences_window </span> </span> <span class="sig-paren"> ( </span> <span class="sig-paren"> ) </span> </dt> <dd> <p> Show the Preferences window to the User. </p> </dd> </dl>
omni.kit.window.preferences.rebuild_pages.md
# rebuild_pages ## rebuild_pages ```python omni.kit.window.preferences.rebuild_pages() ``` rebuild UI ```
omni.kit.window.preferences.register_actions.md
# register_actions ## register_actions ```python omni.kit.window.preferences.register_actions(extension_id, cls, get_self_fn) ``` Register actions: show_preferences_window, hide_preferences_window, toggle_preferences_window.
omni.kit.window.preferences.register_page.md
# register_page ## register_page
omni.kit.window.preferences.scripts.Classes.md
# omni.kit.window.preferences.scripts Classes ## Classes Summary: - **PreferenceBuilder** - Page building class - [PreferenceBuilder](omni.kit.window.preferences.scripts/omni.kit.window.preferences.scripts.PreferenceBuilder.html) - **PreferenceBuilderUI** - Preferences “page” display functions - [PreferenceBuilderUI](omni.kit.window.preferences.scripts/omni.kit.window.preferences.scripts.PreferenceBuilderUI.html) - **PreferencesExtension** - Preference window class - [PreferencesExtension](omni.kit.window.preferences.scripts/omni.kit.window.preferences.scripts.PreferencesExtension.html)
omni.kit.window.preferences.scripts.get_page_list.md
# get_page_list ## get_page_list ```python omni.kit.window.preferences.scripts.get_page_list() ``` Get list of all available pages. ```
omni.kit.window.preferences.scripts.get_shown_page_list.md
# get_shown_page_list ## get_shown_page_list Gets list of pages that are visible. IE list of pages that PreferenceBuilder.show_page() returned True.
omni.kit.window.preferences.scripts.md
# omni.kit.window.preferences.scripts ## Submodules Summary: - [omni.kit.window.preferences.scripts.preference_builder](omni.kit.window.preferences.scripts.preference_builder.html) - Page building class. - [omni.kit.window.preferences.scripts.preferences_actions](omni.kit.window.preferences.scripts.preferences_actions.html) - Register/deregister actions. - [omni.kit.window.preferences.scripts.preferences_window](omni.kit.window.preferences.scripts.preferences_window.html) - preference window class ## Classes Summary: - [PreferenceBuilder](omni.kit.window.preferences.scripts/omni.kit.window.preferences.scripts.PreferenceBuilder.html) - Page building class - [PreferenceBuilderUI](omni.kit.window.preferences.scripts/omni.kit.window.preferences.scripts.PreferenceBuilderUI.html) - Preferences “page” display functions. - [PreferencesExtension](omni.kit.window.preferences.scripts/omni.kit.window.preferences.scripts.PreferencesExtension.html) - Preference window class. ## Functions Summary: - [deregister_actions](omni.kit.window.preferences.scripts/omni.kit.window.preferences.scripts.deregister_actions.html) - Deregister actions: show_preferences_window, hide_preferences_window, toggle_preferences_window. - [get_instance](omni.kit.window.preferences.scripts/omni.kit.window.preferences.scripts.get_instance.html) - Get instance of preference window class. - [get_page_list](omni.kit.window.preferences.scripts/omni.kit.window.preferences.scripts.get_page_list.html) - Get list of preference pages. | 方法名 | 描述 | | --- | --- | | get_page_list | Get list of all available pages. | | get_shown_page_list | Gets list of pages that are visible. IE list of pages that PreferenceBuilder.show_page() returned True. | | hide_preferences_window | Hide the Preferences window from the User. | | rebuild_pages | rebuild UI | | register_actions | Register actions: show_preferences_window, hide_preferences_window, toggle_preferences_window. | | register_page | Add new custom page to preference window list. | | select_page | Select page to display and refresh. | | show_file_importer | Shows file importer. | | show_preferences_window | Show the Preferences window to the User. | | unregister_page | Remove custom page from preference window list. |
omni.kit.window.preferences.scripts.PreferenceBuilder.md
# PreferenceBuilder ## PreferenceBuilder ```python class omni.kit.window.preferences.scripts.PreferenceBuilder(title) ``` Bases: `object` Page building class ### Methods - `__init__(title)` - `add_frame(name)` - Create a UI collapsable frame. - `cleanup_slashes(path[, is_directory])` - Makes path/slashes uniform - `create_setting_widget(label_name, ...)` - Create a UI widget connected with a setting. - `create_setting_widget_combo(label_name, ...)` - Create a UI widget connected with a setting. ``` | Method | Description | | ------ | ----------- | | (name, ...[, ...]) | Creating a Combo Setting widget. | | get_title() | Gets the page title | | label(name[, tooltip]) | Create a UI widget label. | | show_page() | Page is visible. | | spacer() | Create a UI spacer. | ### Attributes | Attribute | Description | | --------- | ----------- | | WINDOW_NAME | | ### Methods #### __init__(title) - Initialize the PreferenceBuilder with a title. #### add_frame(name: str) -> CollapsableFrame - Create a UI collapsable frame. - **Parameters** - **name** – Name to be in frame - **Returns** - `ui.Widget` connected with the setting on the path specified. #### cleanup_slashes(path: str, is_directory: bool = False) -> str - Makes path/slashes uniform - **Parameters** - **path** – path - **is_directory** – is path a directory, default is False - **Returns** - str ### create_setting_widget ```python create_setting_widget(label_name: str, setting_path: str, setting_type: SettingType, **kwargs) -> Widget ``` - **Parameters**: - `label_name`: str - `setting_path`: str - `setting_type`: SettingType - `**kwargs` - **Returns**: Widget ### create_setting_widget_combo ```python create_setting_widget_combo(name: str, setting_path: str, list: List[str], setting_is_index: Optional[bool] = None, **kwargs) ``` - **Parameters**: - `name`: str - `setting_path`: str - `list`: List[str] - `setting_is_index`: Optional[bool] = None - `**kwargs` - **Returns**: Widget ``` ) → Widget Creating a Combo Setting widget. This function creates a combo box that shows a provided list of names and it is connected with setting by path specified. Underlying setting values are used from values of `items` dict. **Parameters** - **setting_path** – Path to the setting to show and edit. - **items** – Can be either `dict` or :py:obj:`list`. For :py:obj:`dict` keys are UI displayed names, values are actual values set into settings. If it is a `list` UI displayed names are equal to setting values. - **setting_is_index** – None - Detect type from setting_path value. If the type is int, set to True. True - setting_path value is index into items list False - setting_path value is string in items list (default) ``` get_title () → str Gets the page title **Parameters** - **None** – **Returns** - str name of the page ``` label (name: str, tooltip: Optional[str] = None) Create a UI widget label. **Parameters** - **name** – Name to be in label - **tooltip** – The Tooltip string to be displayed when mouse hovers on the label **Returns** - ui.Widget connected with the setting on the path specified. ``` show_page () → bool Page is visible. Function can be overridden in subclasses to hide pages. **Returns** - True or False ``` spacer () → Spacer Create a UI spacer. Parameters ---------- None – Returns ------- ui.Widget connected with the setting on the path specified.
omni.kit.window.preferences.scripts.PreferencesExtension.md
# PreferencesExtension ## PreferencesExtension Bases: `IExt` Preference window class. ### Methods - `hide_preferences_window()` - Hide the Preferences window from the User. - `on_shutdown()` - (No description provided) - `on_startup(ext_id)` - (No description provided) - `rebuild_pages()` - Rebuild UI. - `select_page(page)` - Select page to display and refresh. - `show_preferences_window()` - (Description not provided in the HTML snippet) <p>Show the Preferences window to the User.</p> <dt class="sig sig-object py" id="omni.kit.window.preferences.scripts.PreferencesExtension.__init__"> <span class="sig-name descname"> <span class="pre">__init__</span> </span> <span class="sig-paren">(</span> <em class="sig-param"> <span class="n"> <span class="pre">self</span> </span> <span class="p"> <span class="pre">:</span> </span> <span class="w"></span> <span class="n"> <span class="pre">omni.ext._extensions.IExt</span> </span> </em> <span class="sig-paren">)</span> <span class="sig-return"> <span class="sig-return-icon">→</span> <span class="sig-return-typehint"> <span class="pre">None</span> </span> </span> </dt> <dt class="sig sig-object py" id="omni.kit.window.preferences.scripts.PreferencesExtension.PreferencesState"> <em class="property"> <span class="pre">class</span> <span class="w"></span> </em> <span class="sig-name descname"> <span class="pre">PreferencesState</span> </span> <span class="sig-paren">(</span> <em class="sig-param"> <span class="n"> <span class="pre">value</span> </span> </em> <span class="sig-paren">)</span> </dt> <dd> <p>Bases: <code class="xref py py-class docutils literal notranslate"> <span class="pre">IntFlag</span> </code> </p> <p>Preference startup state, either Invalid or Created.</p> </dd> <dt class="sig sig-object py" id="omni.kit.window.preferences.scripts.PreferencesExtension.hide_preferences_window"> <span class="sig-name descname"> <span class="pre">hide_preferences_window</span> </span> <span class="sig-paren">(</span> <span class="sig-paren">)</span> </dt> <dd> <p>Hide the Preferences window from the User.</p> </dd> <dt class="sig sig-object py" id="omni.kit.window.preferences.scripts.PreferencesExtension.rebuild_pages"> <span class="sig-name descname"> <span class="pre">rebuild_pages</span> </span> <span class="sig-paren">(</span> <span class="sig-paren">)</span> </dt> <dd> <p>Rebuild UI.</p> </dd> <dt class="sig sig-object py" id="omni.kit.window.preferences.scripts.PreferencesExtension.select_page"> <span class="sig-name descname"> <span class="pre">select_page</span> </span> <span class="sig-paren">(</span> <em class="sig-param"> <span class="n"> <span class="pre">page</span> </span> </em> <span class="sig-paren">)</span> </dt> <dd> <p>Select page to display and refresh.</p> </dd> <dt class="sig sig-object py" id="omni.kit.window.preferences.scripts.PreferencesExtension.show_preferences_window"> <span class="sig-name descname"> <span class="pre">show_preferences_window</span> </span> <span class="sig-paren">(</span> <span class="sig-paren">)</span> </dt> <dd> <p>Show the Preferences window to the User.</p> </dd>
omni.kit.window.preferences.scripts.preferences_actions.Functions.md
# omni.kit.window.preferences.scripts.preferences_actions Functions ## Functions Summary - **deregister_actions** - Deregister actions: show_preferences_window, hide_preferences_window, toggle_preferences_window. - **register_actions** - Register actions: show_preferences_window, hide_preferences_window, toggle_preferences_window.
omni.kit.window.preferences.scripts.preferences_window.Functions.md
# omni.kit.window.preferences.scripts.preferences_window Functions ## Functions Summary ### deregister_actions Deregister actions: show_preferences_window, hide_preferences_window, toggle_preferences_window. ### get_instance Get instance of preference window class. ### get_page_list Get list of all available pages. ### get_shown_page_list Gets list of pages that are visible. IE list of pages that PreferenceBuilder.show_page() returned True. ### hide_preferences_window Hide the Preferences window from the User. ### rebuild_pages rebuild UI ### register_actions Register actions: show_preferences_window, hide_preferences_window, toggle_preferences_window. ### register_page | 功能 | 描述 | | --- | --- | | register_page | Add new custom page to preference window list. | | select_page | Select page to display and refresh. | | show_file_importer | Shows file importer. | | show_preferences_window | Show the Preferences window to the User. | | unregister_page | Remove custom page from preference window list. |
omni.kit.window.preferences.scripts.preferences_window.md
# omni.kit.window.preferences.scripts.preferences_window ## Classes Summary: | Class | Description | | --- | --- | | [PreferenceBuilder](omni.kit.window.preferences.scripts.preferences_window/omni.kit.window.preferences.scripts.preferences_window.PreferenceBuilder.html) | Page building class | | [PreferenceBuilderUI](omni.kit.window.preferences.scripts.preferences_window/omni.kit.window.preferences.scripts.preferences_window.PreferenceBuilderUI.html) | Preferences “page” display functions. | | [PreferencesExtension](omni.kit.window.preferences.scripts.preferences_window/omni.kit.window.preferences.scripts.preferences_window.PreferencesExtension.html) | Preference window class. | ## Functions Summary: | Function | Description | | --- | --- | | [deregister_actions](omni.kit.window.preferences.scripts.preferences_window/omni.kit.window.preferences.scripts.preferences_window.deregister_actions.html) | Deregister actions: show_preferences_window, hide_preferences_window, toggle_preferences_window. | | [get_instance](omni.kit.window.preferences.scripts.preferences_window/omni.kit.window.preferences.scripts.preferences_window.get_instance.html) | Get instance of preference window class. | | [get_page_list](omni.kit.window.preferences.scripts.preferences_window/omni.kit.window.preferences.scripts.preferences_window.get_page_list.html) | Get list of all available pages. | | [get_shown_page_list](omni.kit.window.preferences.scripts.preferences_window/omni.kit.window.preferences.scripts.preferences_window.get_shown_page_list.html) | Gets list of pages that are visible. IE list of pages that PreferenceBuilder.show_page() returned True. | <p> hide_preferences_window </p> <p> Hide the Preferences window from the User. </p> <p> rebuild_pages </p> <p> rebuild UI </p> <p> register_actions </p> <p> Register actions: show_preferences_window, hide_preferences_window, toggle_preferences_window. </p> <p> register_page </p> <p> Add new custom page to preference window list. </p> <p> select_page </p> <p> Select page to display and refresh. </p> <p> show_file_importer </p> <p> Shows file importer. </p> <p> show_preferences_window </p> <p> Show the Preferences window to the User. </p> <p> unregister_page </p> <p> Remove custom page from preference window list. </p>
omni.kit.window.preferences.scripts.preference_builder.Classes.md
# omni.kit.window.preferences.scripts.preference_builder Classes ## Classes Summary | Class Name | Description | |------------|-------------| | [PageItem](omni.kit.window.preferences.scripts.preference_builder/omni.kit.window.preferences.scripts.preference_builder.PageItem.html) | Single item of the model | | [PageModel](omni.kit.window.preferences.scripts.preference_builder/omni.kit.window.preferences.scripts.preference_builder.PageModel.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. | | [PreferenceBuilder](omni.kit.window.preferences.scripts.preference_builder/omni.kit.window.preferences.scripts.preference_builder.PreferenceBuilder.html) | Page building class | | [PreferenceBuilderUI](omni.kit.window.preferences.scripts.preference_builder/omni.kit.window.preferences.scripts.preference_builder.PreferenceBuilderUI.html) | Preferences “page” display functions. |
omni.kit.window.preferences.scripts.preference_builder.Functions.md
# omni.kit.window.preferences.scripts.preference_builder Functions  ## Functions Summary Functions Summary: | Function Name | Description | |---------------|-------------| | create_setting_widget | Create a UI widget connected with a setting. | | create_setting_widget_combo | Create a Combo Setting widget. | | get_style | Get default style. | | get_ui_style_name | Gets which light/dark theme kit is using. Not wildly supported. |
omni.kit.window.preferences.scripts.preference_builder.md
# omni.kit.window.preferences.scripts.preference_builder ## Classes Summary: - **PageItem** - Single item of the model - **PageModel** - 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. - **PreferenceBuilder** - Page building class - **PreferenceBuilderUI** - Preferences “page” display functions. ## Functions Summary: - **create_setting_widget** - Create a UI widget connected with a setting. - **create_setting_widget_combo** - Create a Combo Setting widget. - **get_style** - Get the style of the widget. | | | | --- | --- | | | Get default style. | | | Gets which light/dark theme kit is using. Not wildly supported. |
omni.kit.window.preferences.scripts.rebuild_pages.md
# rebuild_pages ## rebuild_pages
omni.kit.window.preferences.scripts.register_page.md
# register_page ## register_page Add new custom page to preference window list.
omni.kit.window.preferences.scripts.select_page.md
# select_page ## select_page ```python omni.kit.window.preferences.scripts.select_page(page) ``` Select page to display and refresh. ```
omni.kit.window.preferences.scripts.show_file_importer.md
# show_file_importer ## Overview `show_file_importer` is a function within the `omni.kit.window.preferences.scripts` module. It is used to display a file importer dialog with specified parameters. ## Function Definition ```python def show_file_importer(title: str, file_exts: list = [('All Files(*)', '')], filename_url: Optional[str] = None, click_apply_fn: Optional[Callable] = None, show_only_folders: bool = False) ``` ### Parameters - **title** (`str`): The title of the file importer dialog. - **file_exts** (`list`): A list of tuples specifying the file extensions to be shown in the dialog. Default is `[('All Files(*)', '')]`. - **filename_url** (`Optional[str]`): An optional URL associated with the filename. Default is `None`. - **click_apply_fn** (`Optional[Callable]`): An optional callback function to be called when the "Apply" button is clicked. Default is `None`. - **show_only_folders** (`bool`): A boolean indicating whether to show only folders in the dialog. Default is `False`. <span class="default_value"> <span class="pre"> False </span> </span> </em> <span class="sig-paren"> ) </span> <a class="headerlink" href="#omni.kit.window.preferences.scripts.show_file_importer" title="Permalink to this definition">  </a> </dt> <dd> <p> Shows file importer. </p> </dd> </dl> </section> </div> </div> <footer> <hr/> </footer> </div> </div> </section>
omni.kit.window.preferences.scripts.show_preferences_window.md
# show_preferences_window ## show_preferences_window ``` This function shows the Preferences window to the User. ``` ```
omni.kit.window.preferences.scripts.Submodules.md
# omni.kit.window.preferences.scripts Submodules ## Submodules Summary - **omni.kit.window.preferences.scripts.preference_builder** - Page building class. - **omni.kit.window.preferences.scripts.preferences_actions** - Register/deregister actions. - **omni.kit.window.preferences.scripts.preferences_window** - preference window class
omni.kit.window.preferences.scripts.unregister_page.md
# unregister_page ## unregister_page ```python omni.kit.window.preferences.scripts.unregister_page(page, rebuild: bool = True) ``` Remove custom page from preference window list. ```
omni.kit.window.preferences.select_page.md
# select_page ## select_page
omni.kit.window.preferences.SettingType.md
# SettingType ## SettingType ``` ```markdown class omni.kit.window.preferences.SettingType(value) ``` ```markdown Bases: Enum Supported setting types for create_setting_widget. ### Attributes | Attribute | Description | |-----------|-------------| | FLOAT | Setting is a floating-point number. | | INT | Setting is a integer number. | | COLOR3 | Setting is a three color floating-point numbers (0.0-1.0). | | BOOL | Setting is a boolean. | | STRING | Setting is a string. | | DOUBLE3 | Setting is a three double-precision floating-point numbers. | | Setting Type | Description | | --- | --- | | `INT2` | Setting is a two integer numbers. | | `DOUBLE2` | Setting is a two double-precision floating-point numbers. | | `ASSET` | Setting is a asset path. | ### __init__ ### ASSET Setting is a asset path. ### BOOL Setting is a boolean. ### COLOR3 Setting is a three color floating-point numbers (0.0-1.0). ### DOUBLE2 Setting is a two double-precision floating-point numbers. ### DOUBLE3 Setting is a three double-precision floating-point numbers. ### FLOAT Setting is a floating-point number. ### INT Setting is a integer number. ### INT2 Setting is a two integer numbers. <dl class="py attribute"> <dt class="sig sig-object py" id="omni.kit.window.preferences.SettingType.INT"> <span class="sig-name descname"> <span class="pre"> INT </span> </span> <em class="property"> <span class="w"> </span> <span class="p"> <span class="pre"> = </span> </span> <span class="w"> </span> <span class="pre"> 3 </span> </em> <a class="headerlink" href="#omni.kit.window.preferences.SettingType.INT" title="Permalink to this definition">  </a> </dt> <dd> <p> Setting is a two integer numbers. </p> </dd> </dl> <dl class="py attribute"> <dt class="sig sig-object py" id="omni.kit.window.preferences.SettingType.STRING"> <span class="sig-name descname"> <span class="pre"> STRING </span> </span> <em class="property"> <span class="w"> </span> <span class="p"> <span class="pre"> = </span> </span> <span class="w"> </span> <span class="pre"> 4 </span> </em> <a class="headerlink" href="#omni.kit.window.preferences.SettingType.STRING" title="Permalink to this definition">  </a> </dt> <dd> <p> Setting is a string. </p> </dd> </dl>
omni.kit.window.preferences.show_file_importer.md
# show_file_importer ## show_file_importer ## 文件导入器 显示文件导入器。
omni.kit.window.preferences.show_preferences_window.md
# show_preferences_window ## show_preferences_window ```python omni.kit.window.preferences.show_preferences_window() ``` Show the Preferences window to the User. ```
omni.kit.window.preferences.Submodules.md
# omni.kit.window.preferences Submodules ## Submodules Summary - [omni.kit.window.preferences.scripts](omni.kit.window.preferences.scripts.html) - Preference window classes.
omni.kit.window.property.Classes.md
# omni.kit.window.property Classes ## Classes Summary | Class | Description | |-------|-------------| | [PropertyExtension](omni.kit.window.property/omni.kit.window.property.PropertyExtension.html) | Property window extension class. |
omni.kit.window.property.extension.Functions.md
# omni.kit.window.property.extension Functions ## Functions Summary: | Function | Description | |----------|-------------| | [get_window](#get_window) | Get property window. | ### get_window Get property window.
omni.kit.window.property.extension.get_window.md
# get_window ## get_window Get property window.
omni.kit.window.property.extension.md
# omni.kit.window.property.extension ## Classes Summary - **PropertyExtension** - Property window extension class. ## Functions Summary - **get_window** - Get property window.
omni.kit.window.property.extension.PropertyExtension.md
# PropertyExtension ## PropertyExtension ```python class omni.kit.window.property.extension.PropertyExtension ``` Bases: `IExt`, `MenuHelperExtension` Property window extension class. ### Methods | Method | Description | |--------|-------------| | `__init__()` | Initialize PropertyExtension | | `on_shutdown()` | Shutdown function | | `on_startup(ext_id)` | Startup function | | `show_window(value)` | Show/hide property window function | ### Attributes | Attribute | Description | |-----------|-------------| | `MENU_GROUP` | [Description] | | Property menu group | | --- | | MENU_GROUP | | Property menu group | | --- | | WINDOW_NAME | | Property window name | ### __init__() Initialize PropertyExtension ### on_shutdown() Shutdown function ### on_startup(ext_id) Startup function - **Parameters** - **ext_id** (str) – Extension id. ### show_window(value: bool) Show/hide property window function - **Parameters** - **value** (bool) – True if window will be shown or False if window will be hidden. ### MENU_GROUP = 'Window' Property menu group ### WINDOW_NAME = 'Property' Property window name
omni.kit.window.property.Functions.md
# omni.kit.window.property Functions ## Functions Summary - **get_window** - Get property window.
omni.kit.window.property.get_window.md
# get_window ## get_window ### omni.kit.window.property.get_window Get property window.
omni.kit.window.property.managed_frame.Functions.md
# omni.kit.window.property.managed_frame Functions ## Functions Summary - **get_collapsed_state** - Get current collapsed state for `index_name`. - **prep** - Update ui.CollapsableFrame and insert hooks so collapsed state can be tracked. - **reset_collapsed_state** - Reset collapsed state data, so default will be used. - **set_collapsed_state** - Set new collapsed state.
omni.kit.window.property.managed_frame.get_collapsed_state.md
# get_collapsed_state ## get_collapsed_state ```python omni.kit.window.property.managed_frame.get_collapsed_state(index_name: Optional[str] = None) ``` Get current collapsed state for `index_name`. **Parameters:** - **index_name** (str) – group name of the frame. **Returns:** - collapsed settings dictionary. **Return type:** - dict ```
omni.kit.window.property.managed_frame.prep.md
# prep ## prep ```python omni.kit.window.property.managed_frame.prep(frame: CollapsableFrame, type: str) ``` Update ui.CollapsableFrame and insert hooks so collapsed state can be tracked. ### Parameters - **frame** (`ui.CollapsableFrame`) – frame to be prepared. - **type** (`str`) – group name of the frame. ```
omni.kit.window.property.managed_frame.reset_collapsed_state.md
# reset_collapsed_state ## reset_collapsed_state
omni.kit.window.property.managed_frame.set_collapsed_state.md
# set_collapsed_state ## set_collapsed_state ```python omni.kit.window.property.managed_frame.set_collapsed_state(index_name: str, state: bool) ``` Set new collapsed state. ### Parameters - **index_name** (str) – group name of the frame. - **state** (bool) – new collapsed state of the frame.
omni.kit.window.property.md
# omni.kit.window.property ## Submodules Summary: - **omni.kit.window.property.extension** - omni.kit.window.property PropertyExtension class. - **omni.kit.window.property.managed_frame** - omni.kit.window.property managed_frame functions. This provides persistent open/closed states for ui.CollapsableFrames - **omni.kit.window.property.property_filter** - omni.kit.window.property PropertyFilter base class. - **omni.kit.window.property.property_scheme_delegate** - omni.kit.window.property PropertySchemeDelegate base class - **omni.kit.window.property.property_widget** - omni.kit.window.property PropertyWidget base class - **omni.kit.window.property.style** - omni.kit.window.property style functions - **omni.kit.window.property.templates** - omni.kit.window.property template classes - **omni.kit.window.property.window** - omni.kit.window.property PropertyWindow class ## Classes Summary: - **PropertyExtension** - Property window extension class. ## Functions Summary: - **get_window** - # 文档标题 ## 目录 ### 子标题 - 列表项1 - 列表项2 ## 正文内容 这里是正文内容,包含一些文本信息。 ## 表格 | 列1 | 列2 | | --- | --- | | 内容1 | 内容2 | | 内容3 | 内容4 | ## 代码块 ```javascript // 这是一个JavaScript代码示例 console.log("Hello, World!"); ``` ## 脚注 这里是脚注信息。
omni.kit.window.property.property_filter.Classes.md
# omni.kit.window.property.property_filter Classes ## Classes Summary: | Class | Description | |-------|-------------| | [PropertyFilter](omni.kit.window.property.property_filter/omni.kit.window.property.property_filter.PropertyFilter.html) | User defined filters for properties. For now, just a substring filter on property names. |
omni.kit.window.property.property_filter.PropertyFilter.md
# PropertyFilter ## PropertyFilter User defined filters for properties. For now, just a substring filter on property names. ### Methods | Method | Description | |--------|-------------| | `__init__()` | Initialize class function. | | `matches(name)` | Returns True if name matches filter, so property should be visible. | ### Attributes | Attribute | Description | |-----------|-------------| | `name` | Name getter function. | | `name_model` | Model name getter function. | ## Initialize class function. ## matches Returns True if name matches filter, so property should be visible. ### Parameters **name** – name to match. ### Returns True if matched ### Return type bool ## name Name getter function. ### Returns name ### Return type str ## name_model Model name getter function. ### Returns name model. ### Return type str
omni.kit.window.property.property_scheme_delegate.Classes.md
# omni.kit.window.property.property_scheme_delegate Classes ## Classes Summary: | Class Name | Description | |------------|-------------| | [PropertySchemeDelegate](omni.kit.window.property.property_scheme_delegate/omni.kit.window.property.property_scheme_delegate.PropertySchemeDelegate.html) | PropertySchemeDelegate is a class to test given payload and determine what widgets to be drawn in what order. |
omni.kit.window.property.property_scheme_delegate.PropertySchemeDelegate.md
# PropertySchemeDelegate ## PropertySchemeDelegate ``` ```markdown PropertySchemeDelegate is a class to test given payload and determine what widgets to be drawn in what order. ``` ```markdown ### Methods - `get_unwanted_widgets(payload)` - Tests the payload and returns a list of widget names which this delegate does not want to include. - `get_widgets(payload)` - Tests the payload and gathers widgets in interest to be drawn in specific order. ``` ```markdown - `__init__()` ``` ```markdown - `get_unwanted_widgets(payload)` - Returns a list of widget names which this delegate does not want to include. - `get_widgets(payload)` - Gathers widgets in interest to be drawn in specific order. ``` ### get_unwanted_widgets Tests the payload and returns a list of widget names which this delegate does not want to include. Note that if there is another PropertySchemeDelegate returning widget in its get_widgets that conflicts with names in get_unwanted_widgets, get_widgets always wins (i.e. the Widget will be drawn). This function is optional. #### Parameters - **payload** (`PrimSelectionPayload`) – payload. #### Returns - list of unwanted widgets. #### Return type - list ### get_widgets Tests the payload and gathers widgets in interest to be drawn in specific order. #### Parameters - **payload** (`PrimSelectionPayload`) – payload. #### Returns - list of widgets to build. #### Return type - list
omni.kit.window.property.property_widget.Classes.md
# omni.kit.window.property.property_widget Classes ## Classes Summary: | Class | Description | |-------|-------------| | [PropertyWidget](omni.kit.window.property.property_widget/omni.kit.window.property.property_widget.PropertyWidget.html) | Base class to create a group of widgets in Property Window |
omni.kit.window.property.property_widget.PropertyWidget.md
# PropertyWidget ## PropertyWidget ``` class omni.kit.window.property.property_widget.PropertyWidget(title: str) ``` Bases: `object` Base class to create a group of widgets in Property Window ### Methods - **__init__(title)** - Initialize class function - **build([filter])** - UI builder function. - **build_impl()** - Main function to creates the UI elements. - **clean()** - Clean up function to be called before destroying the object. - **on_new_payload()** - Function to handle new payloads. ``` | Method | Description | | ------ | ----------- | | `on_new_payload(payload)` | Called when a new payload is delivered. | | `reset()` | Clean up function to be called when previously built widget is no longer visible given new scheme/payload. | | `__init__(title: str)` | Initialize class function | | `build(filter: Optional[PropertyFilter] = None)` | UI builder function. | | `build_impl()` | Main function to creates the UI elements. | | `clean()` | Clean up function to be called before destroying the object. | | `on_new_payload(payload)` | Called when a new payload is delivered. PropertyWidget can take this opportunity to update its ui models, or schedule full UI rebuild. | ### reset() Clean up function to be called when previously built widget is no longer visible given new scheme/payload.
omni.kit.window.property.style.Functions.md
# omni.kit.window.property.style Functions ## Functions Summary: | Function | Description | |----------|-------------| | [get_style](omni.kit.window.property.style/omni.kit.window.property.style.get_style.html) | Get UI default style. |
omni.kit.window.property.style.get_style.md
# get_style ## get_style Get UI default style. **Returns:** - style dictionary. **Return type:** - dict
omni.kit.window.property.style.md
# omni.kit.window.property.style ## Functions Summary: - **get_style** - Description: Get UI default style.
omni.kit.window.property.Submodules.md
# omni.kit.window.property Submodules ## Submodules Summary: | Module | Description | |--------|-------------| | [omni.kit.window.property.extension](omni.kit.window.property.extension.html) | omni.kit.window.property PropertyExtension class. | | [omni.kit.window.property.managed_frame](omni.kit.window.property.managed_frame.html) | omni.kit.window.property managed_frame functions. This provides persistent open/closed states for ui.CollapsableFrames | | [omni.kit.window.property.property_filter](omni.kit.window.property.property_filter.html) | omni.kit.window.property PropertyFilter base class. | | [omni.kit.window.property.property_scheme_delegate](omni.kit.window.property.property_scheme_delegate.html) | omni.kit.window.property PropertySchemeDelegate base class | | [omni.kit.window.property.property_widget](omni.kit.window.property.property_widget.html) | omni.kit.window.property PropertyWidget base class | | [omni.kit.window.property.style](omni.kit.window.property.style.html) | omni.kit.window.property style functions | | [omni.kit.window.property.templates](omni.kit.window.property.templates.html) | omni.kit.window.property template classes | | [omni.kit.window.property.window](omni.kit.window.property.window.html) | omni.kit.window.property PropertyWindow class |
omni.kit.window.property.templates.build_frame_header.md
# build_frame_header ## build_frame_header ```python omni.kit.window.property.templates.build_frame_header(collapsed, text: str, id: Optional[str] = None) ``` Custom header for CollapsibleFrame ### Parameters - **collapsed** (bool) – Default collapsed state. - **text** (str) – Name of CollapsibleFrame. - **id** (str) – Group identifier, which is passed to GroupHeaderContextMenuEvent. ```
omni.kit.window.property.templates.Classes.md
# omni.kit.window.property.templates Classes ## Classes Summary - **GroupHeaderContextMenu** - Context menu for group headers. - **GroupHeaderContextMenuEvent** - Right mouse click event sent by SimplePropertyWidget - **PropertyWidget** - Base class to create a group of widgets in Property Window - **SimplePropertyWidget** - SimplePropertyWidget provides a simple vertical list of “Label” -> “Value widget” pair layout.
omni.kit.window.property.templates.Functions.md
# omni.kit.window.property.templates Functions ## Functions Summary: | Function Name | Description | |---------------|-------------| | build_frame_header | Custom header for CollapsibleFrame |
omni.kit.window.property.templates.GroupHeaderContextMenu.md
# GroupHeaderContextMenu ## GroupHeaderContextMenu Context menu for group headers. ### Methods | Method | Description | | --- | --- | | `__init__()` | Initialize function. | | `destroy()` | Destroy function. | | `on_mouse_event(event)` | Mouse event received. | #### `__init__()` Initialize function. #### `destroy()` Destroy function. ## on_mouse_event ### Description Mouse event received. Used to show context menu. ### Parameters - **event** (GroupHeaderContextMenuEvent): Mouse event
omni.kit.window.property.templates.GroupHeaderContextMenuEvent.md
# GroupHeaderContextMenuEvent ## GroupHeaderContextMenuEvent ```python class omni.kit.window.property.templates.GroupHeaderContextMenuEvent(group_id: str, payload: Any) ``` Bases: `object` Right mouse click event sent by SimplePropertyWidget ### Methods | Method | Description | |--------|-------------| | `__init__(group_id: str, payload: Any)` | Initialize class function. | ```python def __init__(group_id: str, payload: Any): # Initialize class function ``` Initialize class function. **Parameters** - **group_id** (`str`) – Group identifier for event. - **payload** (`Any`) – payload for event
omni.kit.window.property.templates.header_context_menu.Classes.md
# omni.kit.window.property.templates.header_context_menu Classes ## Classes Summary - **GroupHeaderContextMenu** - Context menu for group headers. - **GroupHeaderContextMenuEvent** - Right mouse click event sent by SimplePropertyWidget
omni.kit.window.property.templates.header_context_menu.md
# omni.kit.window.property.templates.header_context_menu ## Classes Summary: | Class | Description | |-------|-------------| | [GroupHeaderContextMenu](omni.kit.window.property.templates.header_context_menu/omni.kit.window.property.templates.header_context_menu.GroupHeaderContextMenu.html) | Context menu for group headers. | | [GroupHeaderContextMenuEvent](omni.kit.window.property.templates.header_context_menu/omni.kit.window.property.templates.header_context_menu.GroupHeaderContextMenuEvent.html) | Right mouse click event sent by SimplePropertyWidget |
omni.kit.window.property.templates.md
# omni.kit.window.property.templates ## Submodules Summary: | Module | Description | | --- | --- | | [omni.kit.window.property.templates.header_context_menu](omni.kit.window.property.templates.header_context_menu.html) | Context menu for group header classes. | | [omni.kit.window.property.templates.simple_property_widget](omni.kit.window.property.templates.simple_property_widget.html) | SimplePropertyWidget class. | ## Classes Summary: | Class | Description | | --- | --- | | [GroupHeaderContextMenu](omni.kit.window.property.templates/omni.kit.window.property.templates.GroupHeaderContextMenu.html) | Context menu for group headers. | | [GroupHeaderContextMenuEvent](omni.kit.window.property.templates/omni.kit.window.property.templates.GroupHeaderContextMenuEvent.html) | Right mouse click event sent by SimplePropertyWidget | | [PropertyWidget](omni.kit.window.property.templates/omni.kit.window.property.templates.PropertyWidget.html) | Base class to create a group of widgets in Property Window | | [SimplePropertyWidget](omni.kit.window.property.templates/omni.kit.window.property.templates.SimplePropertyWidget.html) | SimplePropertyWidget provides a simple vertical list of “Label” -> “Value widget” pair layout. | ## Functions Summary: | Function | Description | | --- | --- | | [build_frame_header](omni.kit.window.property.templates/omni.kit.window.property.templates.build_frame_header.html) | Custom header for CollapsibleFrame |
omni.kit.window.property.templates.PropertyWidget.md
# PropertyWidget ## Class: omni.kit.window.property.templates.PropertyWidget Base class to create a group of widgets in Property Window ### Methods - **__init__(title)** - Initialize class function - **build([filter])** - UI builder function. - **build_impl()** - Main function to creates the UI elements. - **clean()** - Clean up function to be called before destroying the object. - **on_new_payload()** - (Method description not provided in the HTML) | Method | Description | |--------|-------------| | `on_new_payload(payload)` | Called when a new payload is delivered. | | `reset()` | Clean up function to be called when previously built widget is no longer visible given new scheme/payload. | | `__init__(title: str)` | Initialize class function | | `build(filter: Optional[PropertyFilter] = None)` | UI builder function. | | `build_impl()` | Main function to creates the UI elements. | | `clean()` | Clean up function to be called before destroying the object. | | `on_new_payload(payload)` | Called when a new payload is delivered. PropertyWidget can take this opportunity to update its ui models, or schedule full UI rebuild. | | `reset()` | Clean up function to be called when previously built widget is no longer visible given new scheme/payload. | ## 函数定义 ### reset() Clean up function to be called when previously built widget is no longer visible given new scheme/payload.
omni.kit.window.property.templates.SimplePropertyWidget.md
# SimplePropertyWidget ## SimplePropertyWidget ```python class omni.kit.window.property.templates.SimplePropertyWidget(title: str, collapsed: bool = False, collapsable: bool = True) ``` Bases: [PropertyWidget](../omni.kit.window.property.property_widget/omni.kit.window.property.property_widget.PropertyWidget.html#omni.kit.window.property.property_widget.PropertyWidget) SimplePropertyWidget provides a simple vertical list of “Label” -> “Value widget” pair layout. ### Methods | Method | Description | |--------|-------------| | `__init__(title[, collapsed, collapsable])` | Initialize class function | | `add_item()` | | | Function Name | Description | |------------------------------|-----------------------------------------------------------------------------| | add_item | This function is supposed to be called inside of build_items function. | | add_item_with_model | This function is supposed to be called inside of build_items function. | | add_label | Add a Label with a highlight text based on current filter | | build_impl | See PropertyWidget.build_impl. | | build_items | When derived from SimplePropertyWidget, override this function to build your items. | | clean | See PropertyWidget.clean | | on_collapsed_changed | Update collapsed state. | | on_new_payload | See PropertyWidget.on_new_payload | | request_rebuild | Request the widget to rebuild. | | reset | See PropertyWidget.reset | ### __init__(title: str, collapsed: bool = False, collapsable: bool = True) Initialize class function - `title`: str - `collapsed`: bool, default is False - `collapsable`: bool, default is True ### Parameters - **collapsed** (`bool`) – Default Collapsed state of frame. - **collapsable** (`collapsable`) – Created frame is CollapsibleFrame/Frame. ### add_item ```python add_item(label: str, value) ``` This function is supposed to be called inside of build_items function. Adds a “Label” -> “Value widget” pair item to the widget. “value” will be an uneditable string in a StringField. #### Parameters - **label** (`str`) – The label text of the entry. - **value** – The value to be stringified and displayed in a StringField. ### add_item_with_model ```python add_item_with_model(label: str, model, editable: bool = False, identifier: Optional[str] = None) ``` This function is supposed to be called inside of build_items function. Adds a “Label” -> “Value widget with model” pair item to the widget. “value” will be an editable string in a StringField backed by supplied model. #### Parameters - **label** (`str`) – The label text of the entry. - **model** – The model to be used by the string field. - **editable** – If the StringField generated from model should be editable. Default is False. ### add_label ```python add_label(label: str) ``` Add a Label with a highlight text based on current filter #### Parameters - **label** (`str`) – Name of label. <span class="sig-name descname"> <span class="pre"> build_impl </span> </span> <span class="sig-paren"> ( </span> <span class="sig-paren"> ) </span>  </dt> <dd> <p> See PropertyWidget.build_impl. </p> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.window.property.templates.SimplePropertyWidget.build_items"> <span class="sig-name descname"> <span class="pre"> build_items </span> </span> <span class="sig-paren"> ( </span> <span class="sig-paren"> ) </span>  </dt> <dd> <p> When derived from SimplePropertyWidget, override this function to build your items. </p> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.window.property.templates.SimplePropertyWidget.clean"> <span class="sig-name descname"> <span class="pre"> clean </span> </span> <span class="sig-paren"> ( </span> <span class="sig-paren"> ) </span>  </dt> <dd> <p> See PropertyWidget.clean </p> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.window.property.templates.SimplePropertyWidget.on_collapsed_changed"> <span class="sig-name descname"> <span class="pre"> on_collapsed_changed </span> </span> <span class="sig-paren"> ( </span> <em class="sig-param"> <span class="n"> <span class="pre"> collapsed </span> </span> </em> <span class="sig-paren"> ) </span>  </dt> <dd> <p> Update collapsed state. </p> <dl class="field-list simple"> <dt class="field-odd"> Parameters </dt> <dd class="field-odd"> <p> <strong> collapsed </strong> ( <em> bool </em> ) – New state of collapsed frame. </p> </dd> </dl> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.window.property.templates.SimplePropertyWidget.on_new_payload"> <span class="sig-name descname"> <span class="pre"> on_new_payload </span> </span> <span class="sig-paren"> ( </span> <em class="sig-param"> <span class="n"> <span class="pre"> payload </span> </span> </em> , <em class="sig-param"> <span class="n"> <span class="pre"> ignore_large_selection </span> </span> <span class="o"> <span class="pre"> = </span> </span> <span class="default_value"> <span class="pre"> False </span> </span> </em> <span class="sig-paren"> ) </span> <span class="sig-return"> <span class="sig-return-icon"> → </span> <span class="sig-return-typehint"> <span class="pre"> bool </span> </span> </span>  </dt> <dd> <p> See PropertyWidget.on_new_payload </p> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.window.property.templates.SimplePropertyWidget.request_rebuild"> <span class="sig-name descname"> <span class="pre"> request_rebuild </span> </span> <span class="sig-paren"> ( </span> <span class="sig-paren"> ) </span>  </dt> <dd> <p> Request the widget to rebuild. It will be rebuilt on next frame. </p> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.window.property.templates.SimplePropertyWidget.reset"> <span class="sig-name descname"> <span class="pre"> reset </span> </span> <span class="sig-paren"> ( </span> <span class="sig-paren"> ) </span>  </dt> <dd> <p> See PropertyWidget.reset </p> </dd> </dl> </dd> </dl> </section> </div> </div> <footer> <hr/> </footer> </div> </div> </section> </div>
omni.kit.window.property.templates.simple_property_widget.Functions.md
# omni.kit.window.property.templates.simple_property_widget Functions ## Functions Summary - **build_frame_header** - Custom header for CollapsibleFrame
omni.kit.window.property.templates.simple_property_widget.md
# omni.kit.window.property.templates.simple_property_widget ## Classes Summary: - **GroupHeaderContextMenu** - Context menu for group headers. - **GroupHeaderContextMenuEvent** - Right mouse click event sent by SimplePropertyWidget - **PropertyWidget** - Base class to create a group of widgets in Property Window - **SimplePropertyWidget** - SimplePropertyWidget provides a simple vertical list of “Label” -> “Value widget” pair layout. ## Functions Summary: - **build_frame_header** - Custom header for CollapsibleFrame
omni.kit.window.property.templates.Submodules.md
# omni.kit.window.property.templates Submodules ## Submodules Summary - **omni.kit.window.property.templates.header_context_menu** - Context menu for group header classes. - **omni.kit.window.property.templates.simple_property_widget** - SimplePropertyWidget class.
omni.kit.window.property.window.Classes.md
# omni.kit.window.property.window Classes ## Classes Summary - **PropertyWindow** - Property Window framework.
omni.kit.window.property.window.PropertyWindow.md
# PropertyWindow ## PropertyWindow ```python class omni.kit.window.property.window.PropertyWindow(window_kwargs=None, properties_frame_kwargs=None) ``` Bases: `object` Property Window framework. ### Methods - **`__init__(window_kwargs, properties_frame_kwargs)`** - Create a PropertyWindow. - **`destroy()`** - Destroy function. - **`get_scheme()`** - Gets the current scheme being displayed in Property Window. - **`notify(scheme, payload)`** - Notify Property Window of a scheme and/or payload change. ``` | Method | Description | | --- | --- | | `register_scheme_delegate(scheme, name, delegate)` | Register a PropertySchemeDelegate for a given scheme. | | `register_widget(scheme, name, property_widget)` | Registers a PropertyWidget to PropertyWindow. | | `request_rebuild()` | Requests the entire property window to be rebuilt. | | `reset_scheme_delegate_layout(scheme)` | Reset the order so PropertySchemeDelegate will be processed in the order of registration when building UI. | | `restore_scroll_pos()` | Restore scroll position from previous position. | | `save_scroll_pos([reset])` | Save scroll position to previous position. | | `set_scheme_delegate_layout(scheme, layout)` | Register a list of PropertySchemeDelegate's names to finalize the order and visibility of all registered PropertySchemeDelegate. | | `set_visibility_changed_listener(listener)` | Adds callback function for when window visibility is changed. | | `set_visible(visible)` | Set window visibility state. | | `unregister_scheme_delegate(scheme, name)` | Unregister a PropertySchemeDelegate from PropertyWindow by name. | | `unregister_widget(scheme, name[, top_stack])` | Unregister a PropertyWidget from PropertyWindow. | ### Attributes | Attribute | Description | | --- | --- | | `paused` | Gets if property window refresh is paused. | | `properties_frame` | Gets the ui.ScrollingFrame container of PropertyWidgets | __init__(window_kwargs=None, properties_frame_kwargs=None) Create a PropertyWindow. Parameters ---------- window_kwargs (dict) – Additional kwargs to pass to ui.Window. properties_frame_kwargs (dict) – Additional kwargs to pass to ui.ScrollingFrame. destroy() Destroy function. Class cleanup function get_scheme() Gets the current scheme being displayed in Property Window. notify(scheme: str, payload: Any) Notify Property Window of a scheme and/or payload change. This is the function to trigger refresh of PropertyWindow. Parameters ---------- scheme (str) – Scheme of this notification. payload – Payload to refresh the widgets. register_scheme_delegate(scheme: str, name: str, delegate: PropertySchemeDelegate) Register a PropertySchemeDelegate for a given scheme. A PropertySchemeDelegate tests the payload and determines what widgets to be drawn in what order. A scheme can have multiple PropertySchemeDelegate and their result will be merged to display all relevant widgets. PropertySchemeDelegate does not hide widgets that are not returned from its get_widgets function. If you want to hide certain widget, return them in PropertySchemeDelegate.get_unwanted_widgets. See PropertySchemeDelegate’s documentation for details. ### PropertySchemeDelegate Registration - **scheme** (`str`) – Scheme of the PropertySchemeDelegate to be added to. - **name** (`str`) – A unique name to identify the PropertySchemeDelegate under. Delegate with existing name will be overridden. - **delegate** (`PropertySchemeDelegate`) – A PropertySchemeDelegate instance to be added. ### PropertyWidget Registration - **scheme** (`str`) – Scheme of the PropertyWidget will work with. - **name** (`str`) – A unique name to identify the PropertyWidget under. Widget with existing name will be overridden. - **property_widget** (`PropertyWidget`) – A PropertyWidget instance to be added. - **top_stack** (`bool`) – Widgets are managed in double stack: - `True` to register the widget to “Top” stack which layouts widgets from top to bottom. - `False` to register the widget to “Button” stack which layouts widgets from bottom to top and always below the “Top” stack. ### PropertyWindow Methods - **register_widget** (`scheme: str`, `name: str`, `property_widget: PropertyWidget`, `top_stack: bool = True`) – Registers a PropertyWidget to PropertyWindow. - **request_rebuild** () – Requests the entire property window to be rebuilt. - **reset_scheme_delegate_layout** (`scheme: str`) – Reset the order so PropertySchemeDelegate will be processed in the order of registration when building UI. ### restore_scroll_pos() Restore scroll position from previous position. Used when trying to keep scroll position when selecting attributes of same type. ### save_scroll_pos(reset=False) Save scroll position to previous position. Used when trying to keep scroll position when selecting attributes of same type. #### Parameters - **reset** (bool) – If True clear old scroll position. ### set_scheme_delegate_layout(scheme: str, layout: List[str]) Register a list of PropertySchemeDelegate’s names to finalize the order and visibility of all registered PropertySchemeDelegate. Useful if you need a fixed layout of Property Widgets for your Kit experience. #### Remark: If you’re a Property Widget writer, DO NOT call this function. It should only be called by Kit Experience to tune the final look and layout of the Property Window. #### Parameters - **scheme** (str) – Scheme of the PropertySchemeDelegate order to be added to. - **layout** (List[str]) – a list of PropertySchemeDelegate’s name, in the order of being processed when building UI. Scheme delegate not in this will be skipped. ### set_visibility_changed_listener(listener: callable) Adds callback function for when window visibility is changed. #### Parameters - **listener** (callable) – visibility changed callback. ### set_visible(visible: bool) Set window visibility state. #### Parameters - **visible** (bool) – Visible state of the window. ### unregister_scheme_delegate **Parameters** - **scheme** (`str`) – Scheme of the PropertySchemeDelegate to be removed from. - **name** (`str`) – The name to find the PropertySchemeDelegate and remove. ### unregister_widget **Parameters** - **scheme** (`str`) – Scheme of the PropertyWidget to be removed from. - **name** (`str`) – The name to find the PropertyWidget and remove. - **top_stack** (`bool`) – see @register_widget ### paused Gets if property window refresh is paused. ### properties_frame Gets the ui.ScrollingFrame container of PropertyWidgets
omni.kit.window.stage.Classes.md
# omni.kit.window.stage Classes ## Classes Summary: | Class | Description | |-------|-------------| | [StageExtension](omni.kit.window.stage/omni.kit.window.stage.StageExtension.html) | The entry point for Stage Window |
omni.kit.window.stage.external_drag_drop_helper.destroy_external_drag_drop.md
# destroy_external_drag_drop ## destroy_external_drag_drop
omni.kit.window.stage.external_drag_drop_helper.Functions.md
# omni.kit.window.stage.external_drag_drop_helper Functions ## Functions Summary - **destroy_external_drag_drop** - **setup_external_drag_drop**
omni.kit.window.stage.external_drag_drop_helper.setup_external_drag_drop.md
# setup_external_drag_drop ## setup_external_drag_drop
omni.kit.window.stage.md
# omni.kit.window.stage ## Submodules Summary | Module | Description | |--------|-------------| | omni.kit.window.stage.external_drag_drop_helper | No submodule docstring provided | | omni.kit.window.stage.selection_watch | No submodule docstring provided | | omni.kit.window.stage.singleton | No submodule docstring provided | | omni.kit.window.stage.stage_extension | No submodule docstring provided | | omni.kit.window.stage.stage_settings | No submodule docstring provided | | omni.kit.window.stage.stage_window | No submodule docstring provided | ## Classes Summary | Class | Description | |-------|-------------| | StageExtension | The entry point for Stage Window |
omni.kit.window.stage.selection_watch.Classes.md
# omni.kit.window.stage.selection_watch Classes ## Classes Summary | Class Name | Description | |------------|-------------| | [SelectionWatch](omni.kit.window.stage.selection_watch/omni.kit.window.stage.selection_watch.SelectionWatch.html) | A watcher object that updates selections in TreeView when scene selections are updated, and vice versa. |
omni.kit.window.stage.selection_watch.md
# omni.kit.window.stage.selection_watch ## Classes Summary: - **SelectionWatch** - A watcher object that updates selections in TreeView when scene selections are updated, and vice versa.
omni.kit.window.stage.selection_watch.SelectionWatch.md
# SelectionWatch ## SelectionWatch - **alias of**: `DefaultSelectionWatch`
omni.kit.window.stage.singleton.Functions.md
# omni.kit.window.stage.singleton Functions ## Functions Summary - **Singleton** - A singleton decorator
omni.kit.window.stage.singleton.Singleton.md
# Singleton ## Singleton
omni.kit.window.stage.StageExtension.md
# StageExtension ## StageExtension The entry point for Stage Window ### Methods | Method | Description | |--------|-------------| | `on_shutdown()` | | | `on_startup()` | | | `show_window(value)` | | ### Attributes | Attribute | Description | |-----------|-------------| | `MENU_GROUP` | | | `WINDOW_NAME` | | ### `__init__(self: omni.ext._extensions.IExt) -> None` # 标题1 这是一个段落,包含一个[链接]和一张图片。
omni.kit.window.stage.stage_extension.md
# omni.kit.window.stage.stage_extension ## Classes Summary - **StageExtension** - The entry point for Stage Window
omni.kit.window.stage.stage_extension.StageExtension.md
# StageExtension ## StageExtension The entry point for Stage Window ### Methods | Method | Description | |--------|-------------| | `on_shutdown()` | | | `on_startup()` | | | `show_window(value)` | | ### Attributes | Attribute | Description | |-----------|-------------| | `MENU_GROUP` | | | `WINDOW_NAME` | | → None 
omni.kit.window.stage.stage_settings.Classes.md
# omni.kit.window.stage.stage_settings Classes ## Classes Summary - [StageSettings](#)
omni.kit.window.stage.stage_settings.md
# omni.kit.window.stage.stage_settings ## Classes Summary - **StageSettings** ## Functions Summary - **Singleton** - A singleton decorator