file_path
stringlengths
5
148
content
stringlengths
150
498k
size
int64
150
498k
omni.kit.collaboration.channel_manager.ChannelManagerExtension.md
# ChannelManagerExtension ## ChannelManagerExtension ```python class omni.kit.collaboration.channel_manager.ChannelManagerExtension ``` **Bases:** ```python IExt ``` ### Methods | Method | Description | |--------|-------------| | `join_channel_async(url, get_users_only)` | | | `on_shutdown()` | | | `on_startup()` | | ```python def __init__(self: omni.ext._extensions.IExt) -> None: ``` ```
400
omni.kit.collaboration.channel_manager.ChannelSubscriber.md
# ChannelSubscriber ## ChannelSubscriber Handler of subscription to a channel. ### Methods | Method | Description | |--------|-------------| | `__init__(message_handler, channel)` | Constructor. | | `unsubscribe()` | Stop subscribe. | #### `__init__(message_handler, channel)` Constructor. #### `unsubscribe()` Stop subscribe. ### Constructor. Internal only. #### Parameters - **message_handler** (`Callable[[Message, None]]`) – Message handler to handle message. - **channel** (`weakref`) – Weak holder of channel. ### unsubscribe() Stop subscribe.
559
omni.kit.collaboration.channel_manager.Classes.md
# omni.kit.collaboration.channel_manager Classes  ## Classes Summary: | Class Name | Description | |------------|-------------| | Channel | Channel represents the instance of an Nucleus Channel. | | ChannelManagerExtension | | | ChannelSubscriber | Handler of subscription to a channel. | | Message | Message is the container to wrap the messages received from the channel. | | MessageType | Message Type. | | PeerUser | Information of peer user that’s joined to the same channel. |
486
omni.kit.collaboration.channel_manager.Functions.md
# omni.kit.collaboration.channel_manager Functions ## Functions Summary: | Function | Description | |----------|-------------| | join_channel_async | Joins a channel and starts listening. The typical life cycle is as follows of a channel session if get_users_only is False: |
277
omni.kit.collaboration.channel_manager.join_channel_async.md
# join_channel_async ## Description Joins a channel and starts listening. The typical life cycle is as follows of a channel session if get_users_only is False: 1. User joins and sends a JOIN message to the channel. 2. Other clients receive JOIN message will respond with HELLO to broadcast its existence. 3. Clients communicate with each other by sending MESSAGE to each other. 4. Clients send LEFT before quit this channel. ### Parameters - **url** (str) – The channel url to join. The url could be stage url or url with `.__omni_channel__` or `.channel` suffix. If the suffix is not provided, it will be appended internally with `.__omni_channel__` to be compatible with old version. - **get_users_only** (bool) – It will join channel without sending JOIN/HELLO/LEFT message but only receives message from other clients. For example, it can be used to fetch user list without broadcasting its existence. After joining, all users inside the channel will respond HELLO message. ### Returns omni.kit.collaboration.channel_manager.Channel. The instance of channel that could be used to publish/subscribe channel messages. ### Examples ```python import omni.kit.collaboration.channel_manager as nm async def join_channel_async(url): channel = await nm.join_channel_async(url) ``` ```python >>> if channel: >>> channel.add_subscriber(...) >>> await channel.send_message_async(...) >>> else: >>> # Failed to join >>> pass ```
1,445
omni.kit.collaboration.channel_manager.md
# omni.kit.collaboration.channel_manager ## Classes Summary - **Channel** - Channel represents the instance of an Nucleus Channel. - **ChannelManagerExtension** - **ChannelSubscriber** - Handler of subscription to a channel. - **Message** - Message is the container to wrap the messages received from the channel. - **MessageType** - Message Type. - **PeerUser** - Information of peer user that’s joined to the same channel. ## Functions Summary - **join_channel_async** - Joins a channel and starts listening. The typical life cycle is as follows of a channel session if get_users_only is False:
612
omni.kit.collaboration.channel_manager.Message.md
# Message ## Message | Property | Description | |----------|-------------| | `from_user` | User that message sent from. | | `message_type` | Message type. | ```python __init__(from_user: PeerUser, message_type: MessageType, content: dict) -> None ``` Constructor. Internal only. Parameters: - **from_user** (PeerUser) – User that message sent from. - **message_type** (MessageType) – Message type. - **content** (dict) – Message content in dict. ```python property content: dict ``` Message content in dictionary. ```python property from_user: PeerUser ``` User that message sent from. ```python property message_type: MessageType ``` Message type.
658
omni.kit.collaboration.channel_manager.MessageType.md
# MessageType ## MessageType ```python class omni.kit.collaboration.channel_manager.MessageType ``` Bases: `object` Message Type. ### Methods ### Attributes | Attribute | Description | |-----------|-------------| | `GET_USERS` | Ping message to find out who joined this channel. | | `HELLO` | Someone said hello to me. | | `JOIN` | New user joined. | | `LEFT` | Someone left this channel. | | `MESSAGE` | Application specific message. | ### `__init__` ``` ## omni.kit.collaboration.channel_manager.MessageType ### GET_USERS = 'GET_USERS' Ping message to find out who joined this channel. Clients received this message should respond with HELLO to broadcast its existence. ### HELLO = 'HELLO' Someone said hello to me. Normally, client sends HELLO when it receives JOIN and GET_USERS. ### JOIN = 'JOIN' New user joined. Existing clients should respond HELLO when it’s received. ### LEFT = 'LEFT' Someone left this channel. ### MESSAGE = 'MESSAGE' Application specific message.
986
omni.kit.collaboration.channel_manager.Message_omni.kit.collaboration.channel_manager.Message.md
# Message ## Message ```python class omni.kit.collaboration.channel_manager.Message(from_user: PeerUser, message_type: MessageType, content: dict) ``` Bases: `object` Message is the container to wrap the messages received from the channel. ### Methods | Method | Description | |--------|-------------| | `__init__(from_user, message_type, content)` | Constructor. | ### Attributes | Attribute | Description | |-----------|-------------| | `content` | Message content in dictionary. | | `from_user` | The user from whom the message is received. | ``` | Property | Description | |----------|-------------| | `from_user` | User that message sent from. | | `message_type` | Message type. | ```python __init__(from_user: PeerUser, message_type: MessageType, content: dict) -> None ``` Constructor. Internal only. Parameters: - `from_user` (PeerUser) – User that message sent from. - `message_type` (MessageType) – Message type. - `content` (dict) – Message content in dict. ```python property content: dict ``` Message content in dictionary. ```python property from_user: PeerUser ``` User that message sent from. ```python property message_type: MessageType ``` Message type.
1,188
omni.kit.collaboration.channel_manager.PeerUser.md
# PeerUser Information of peer user that’s joined to the same channel. ## Methods - `__init__(user_id, user_name, from_app)` - Constructor. ## Attributes - `from_app` - Readable app name, like 'Kit', 'Maya', etc. - `user_id` - Unique user id. <p> user_name <p> Readable user name. <dl> <dt> __init__(user_id: str, user_name: str, from_app: str) -> None <dd> <p> Constructor. Internal only. <dl> <dt> Parameters <dd> <ul> <li> <p> <strong> user_id ( <em> str ) – Unique user id. <li> <p> <strong> user_name ( <em> str ) – Readable user name. <li> <p> <strong> from_app ( <em> str ) – Which app this users join from. <dl> <dt> property from_app <dd> <p> Readable app name, like ‘Kit’, ‘Maya’, etc. <dl> <dt> property user_id <dd> <p> Unique user id. <dl> <dt> property user_name <dd> <p> Readable user name.
854
omni.kit.collaboration.debug_options.Classes.md
# omni.kit.collaboration.debug_options Classes ## Classes Summary - [CollaborationDebugExtension](./omni.kit.collaboration.debug_options/omni.kit.collaboration.debug_options.CollaborationDebugExtension.html)
209
omni.kit.collaboration.debug_options.CollaborationDebugExtension.md
# CollaborationDebugExtension ## CollaborationDebugExtension ```python class omni.kit.collaboration.debug_options.CollaborationDebugExtension ``` Bases: `omni.ext._extensions.IExt` ### Methods | Method | Description | |--------------|-------------| | `on_shutdown()` | | | `on_startup(ext_id)` | | ```python def __init__(self: omni.ext._extensions.IExt) -> None: ``` ```
400
omni.kit.collaboration.debug_options.extension.md
# omni.kit.collaboration.debug_options.extension ## Classes Summary: - [CollaborationDebugExtension](omni.kit.collaboration.debug_options.extension/omni.kit.collaboration.debug_options.extension.CollaborationDebugExtension.html)
230
omni.kit.collaboration.debug_options.md
# omni.kit.collaboration.debug_options ## Submodules Summary: - **omni.kit.collaboration.debug_options.extension** - No submodule docstring provided ## Classes Summary: - **CollaborationDebugExtension**
206
omni.kit.collaboration.debug_options.Submodules.md
# omni.kit.collaboration.debug_options Submodules ## Submodules Summary | Submodule | Description | |-----------|-------------| | omni.kit.collaboration.debug_options.extension | No submodule docstring provided |
214
omni.kit.collaboration.presence_layer.Classes.md
# omni.kit.collaboration.presence_layer Classes ## Classes Summary - **PresenceLayerAPI** - Presence layer is the transport layer that works for exchange persistent data for - **PresenceLayerEventPayload** - Payload of Presence Layer Event. - **PresenceLayerEventType** - Events emitted from Presence Layer module. - **PresenceLayerExtension** - (No description provided)
384
omni.kit.collaboration.presence_layer.Functions.md
# omni.kit.collaboration.presence_layer Functions ## Functions Summary - **get_presence_layer_event_payload** - Utility to convert carb.events.IEvent into PresenceLayerEventPayload. - **get_presence_layer_interface** - Gets PresenceLayerAPI interface bound to the context. For each UsdContext, it has unique PresenceLayerAPI instance.
341
omni.kit.collaboration.presence_layer.get_presence_layer_event_payload.md
# get_presence_layer_event_payload ## get_presence_layer_event_payload ```python omni.kit.collaboration.presence_layer.get_presence_layer_event_payload(event: IEvent) -> PresenceLayerEventPayload ``` Utility to convert carb.events.IEvent into PresenceLayerEventPayload. ```
274
omni.kit.collaboration.presence_layer.get_presence_layer_interface.md
# get_presence_layer_interface ## get_presence_layer_interface ```python omni.kit.collaboration.presence_layer.get_presence_layer_interface(context_name_or_instance: Union[str, UsdContext] = '') -> Optional[PresenceLayerAPI] ``` Gets PresenceLayerAPI interface bound to the context. For each UsdContext, it has unique PresenceLayerAPI instance, through which, you can access all the interfaces supported. PresenceLayerAPI provides the APIs that serve for easy access to data of Presence Layer, where Presence Layer is the transport layer that works for exchange persistent data for all users in the Live Session of the bound UsdContext. It only supports Live Session of root layer for now. ```
696
omni.kit.collaboration.presence_layer.md
# omni.kit.collaboration.presence_layer ## Classes Summary - **PresenceLayerAPI** - Presence layer is the transport layer that works for exchange persistent data. - **PresenceLayerEventPayload** - Payload of Presence Layer Event. - **PresenceLayerEventType** - Events emitted from Presence Layer module. - **PresenceLayerExtension** ## Functions Summary - **get_presence_layer_event_payload** - Utility to convert carb.events.IEvent into PresenceLayerEventPayload. - **get_presence_layer_interface** - Gets PresenceLayerAPI interface bound to the context. For each UsdContext, it has unique PresenceLayerAPI instance.
631
omni.kit.collaboration.presence_layer.PresenceLayerAPI.md
# PresenceLayerAPI ## PresenceLayerAPI Presence layer is the transport layer that works for exchange persistent data for all users in the same Live Session. PresenceLayerAPI provides the APIs that serve for easy access to data of presence layer. ### Methods - **__init__(presence_layer_instance)** - Internal Constructor. - **broadcast_local_bound_camera(local_camera_path)** - Broadcasts local bound camera to presence layer. - **can_follow(user_id)** - If the specified peer user can be followed. - **enter_follow_mode(following_user_id)** - Try to follow user from local. - **get_bound_camera_prim()** - Get the bound camera prim. | Method | Description | | ------ | ----------- | | `get_bound_camera_prim(user_id)` | Gets the bound camera of the peer user in the local stage. | | `get_following_user_id([user_id])` | Gets the user id that the specific user is currently following. | | `get_selections(user_id)` | Gets the prim paths that the user selects. | | `get_shared_data_stage()` | Underlying storage. | | `is_bound_to_builtin_camera(user_id)` | Checks if peer user is bound to builtin camera. | | `is_in_following_mode([user_id])` | Checks if the user is following other user. | | `is_user_followed_by(user_id, followed_by_user_id)` | Checks if user is followed by other specific user. | | `quit_follow_mode()` | Quits following mode. | ### __init__(presence_layer_instance: PresenceLayerManager) Internal Constructor. ### broadcast_local_bound_camera(local_camera_path: Path) Broadcasts local bound camera to presence layer. Local application can be either in bound camera mode or following user mode. Switching bound camera will quit following user mode. ### can_follow(user_id) If the specified peer user can be followed. ### enter_follow_mode(user_id) Enters following mode. (following_user_id: str) Try to follow user from local. Local application can be either in bound camera mode or following user mode. Switching bound camera will quit following user mode. If the user specified by following_user_id is in following mode already, this function will return False. **Parameters** **following_user_id** (str) – The user id that local user is trying to follow. (user_id) → Optional[Prim] Gets the bound camera of the peer user in the local stage. If peer user is following other user, it will return the bound camera of the following user. (user_id: Optional[str] = None) → str Gets the user id that the specific user is currently following. user_id (str): User id, includes both local and peer users. If it’s None, it will return the user id that local user is currently following. (user_id: str) → List[Path] Gets the prim paths that the user selects. () → Stage Underlying storage. For applications that want to extend the functionality of Presence Layer, the raw handle of the stage is exposed for use. (user_id) <dl> <dt> <p> Checks if peer user is bound to builtin camera. If peer user is following other user, it will always return False. <dl> <dt> <p> is_in_following_mode <p> ( user_id: Optional[str] = None ) <dd> <p> Checks if the user is following other user. <dl> <dt> user_id (str): User id, including both the local and peer users. By default, it’s None, which means to <dd> <p> check if local user is in follow mode. <dl> <dt> <p> is_user_followed_by <p> ( user_id: str, followed_by_user_id: str ) -> str <dd> <p> Checks if user is followed by other specific user. <dl> <dt> Parameters <dd> <ul> <li> <p> <strong> user_id ( <em> str ) – The user id to query. <li> <p> <strong> followed_by_user_id ( <em> str ) – The user that’s following the one has user_id. <dl> <dt> <p> quit_follow_mode <p> ( ) <dd> <p> Quits following mode.
4,384
omni.kit.collaboration.presence_layer.PresenceLayerEventPayload.md
# PresenceLayerEventPayload ## Methods - `__init__(event)` - `get_changed_camera_properties(user_id)` - Gets the changed properties of bound builtin camera if event_type is BOUND_CAMERA_PROPERTIES_CHANGED. ## Attributes - `changed_user_ids` - Returns all user ids that have new updates. ## Methods ### get_changed_camera_properties ```python def get_changed_camera_properties(user_id: str) -> Set[str]: """ Gets the changed properties of bound builtin camera if event_type is BOUND_CAMERA_PROPERTIES_CHANGED. """ ``` ## Properties ### changed_user_ids ```python @property def changed_user_ids() -> List[str]: """ Returns all user ids that have new updates. """ ```
699
omni.kit.collaboration.presence_layer.PresenceLayerEventType.md
# PresenceLayerEventType Events emitted from Presence Layer module. ## Attributes - **LOCAL_FOLLOW_MODE_CHANGED** - Emitted when local user enters/quits follow mode to other peer users. - **BOUND_CAMERA_CHANGED** - Emitted when peer user switched its bound camera or the user that is following switches the bound camera. - **SELECTIONS_CHANGED** - Emitted when peer user switched its selections. - **BOUND_CAMERA_PROPERTIES_CHANGED** - Emitted when the bound camera of peer user is builtin camera, and its properties are changed. - **BOUND_CAMERA_RESYNCED** - Emitted when the bound camera of peer user is resynced. BOUND_CAMERA_RESYNCED <td> <p> Emitted when the bound camera of peer user is resynced. <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.collaboration.presence_layer.PresenceLayerEventType.__init__"> <span class="sig-name descname"> <span class="pre"> __init__ <span class="sig-paren"> ( <span class="sig-paren"> ) <a class="headerlink" href="#omni.kit.collaboration.presence_layer.PresenceLayerEventType.__init__" title="Permalink to this definition">  <dd> <dl class="py attribute"> <dt class="sig sig-object py" id="omni.kit.collaboration.presence_layer.PresenceLayerEventType.BOUND_CAMERA_CHANGED"> <span class="sig-name descname"> <span class="pre"> BOUND_CAMERA_CHANGED <em class="property"> <span class="w"> <span class="p"> <span class="pre"> = <span class="w"> <span class="pre"> 17702717275891937372 <a class="headerlink" href="#omni.kit.collaboration.presence_layer.PresenceLayerEventType.BOUND_CAMERA_CHANGED" title="Permalink to this definition">  <dd> <p> Emitted when peer user switched its bound camera or the the user that is following switches the bound camera. <dl class="py attribute"> <dt class="sig sig-object py" id="omni.kit.collaboration.presence_layer.PresenceLayerEventType.BOUND_CAMERA_PROPERTIES_CHANGED"> <span class="sig-name descname"> <span class="pre"> BOUND_CAMERA_PROPERTIES_CHANGED <em class="property"> <span class="w"> <span class="p"> <span class="pre"> = <span class="w"> <span class="pre"> 7479705425450465216 <a class="headerlink" href="#omni.kit.collaboration.presence_layer.PresenceLayerEventType.BOUND_CAMERA_PROPERTIES_CHANGED" title="Permalink to this definition">  <dd> <p> Emitted when the bound camera of peer user is builtin camera, and its properties are changed. <dl class="py attribute"> <dt class="sig sig-object py" id="omni.kit.collaboration.presence_layer.PresenceLayerEventType.BOUND_CAMERA_RESYNCED"> <span class="sig-name descname"> <span class="pre"> BOUND_CAMERA_RESYNCED <em class="property"> <span class="w"> <span class="p"> <span class="pre"> = <span class="w"> <span class="pre"> 4082520231869193342 <a class="headerlink" href="#omni.kit.collaboration.presence_layer.PresenceLayerEventType.BOUND_CAMERA_RESYNCED" title="Permalink to this definition">  <dd> <p> Emitted when the bound camera of peer user is resynced. This is the same as prim resync of USD. <dl class="py attribute"> <dt class="sig sig-object py" id="omni.kit.collaboration.presence_layer.PresenceLayerEventType.LOCAL_FOLLOW_MODE_CHANGED"> <span class="sig-name descname"> <span class="pre"> LOCAL_FOLLOW_MODE_CHANGED <em class="property"> <span class="w"> <span class="p"> <span class="pre"> = <span class="w"> <span class="pre"> 13850547902041140079 <a class="headerlink" href="#omni.kit.collaboration.presence_layer.PresenceLayerEventType.LOCAL_FOLLOW_MODE_CHANGED" title="Permalink to this definition">  <dd> <p> Emitted when local user enters/quits follow mode to other peer users. <dl class="py attribute"> <dt class="sig sig-object py" id="omni.kit.collaboration.presence_layer.PresenceLayerEventType.SELECTIONS_CHANGED"> <span class="sig-name descname"> <span class="pre"> SELECTIONS_CHANGED <em class="property"> <span class="w"> <span class="p"> <span class="pre"> = <span class="w"> <span class="pre"> 9833764249373169665 <a class="headerlink" href="#omni.kit.collaboration.presence_layer.PresenceLayerEventType.SELECTIONS_CHANGED" title="Permalink to this definition">  <dd> <p> Emitted when peer user switched its selections. <footer> <hr/>
4,236
omni.kit.collaboration.presence_layer.PresenceLayerExtension.md
# PresenceLayerExtension ## PresenceLayerExtension ``` class omni.kit.collaboration.presence_layer.PresenceLayerExtension ``` Bases: ``` IExt ``` ### Methods | Method | Description | |--------|-------------| | `on_shutdown()` | | | `on_startup()` | | ``` __init__(self: omni.ext._extensions.IExt) -> None ``` ```
320
omni.kit.collaboration.telemetry.Schema_omni_kit_collaboration_1_0.md
# Schema_omni_kit_collaboration_1_0 ## Schema_omni_kit_collaboration_1_0 Bases: `pybind11_object` ### Methods | Method | Description | |--------|-------------| | `__init__(self)` | | | `liveEdit_sendEvent(self, cloud_link_id, liveEdit)` | | #### `__init__(self)` #### `liveEdit_sendEvent(self, cloud_link_id, liveEdit)` omni.kit.collaboration.telemetry._telemetry.Schema_omni_kit_collaboration_1_0, cloud_link_id: str, liveEdit: omni.kit.collaboration.telemetry._telemetry.Struct_liveEdit_liveEdit ) → None
514
omni.kit.collaboration.telemetry.Struct_liveEdit_liveEdit.md
# Struct_liveEdit_liveEdit ## Struct_liveEdit_liveEdit ```python class omni.kit.collaboration.telemetry.Struct_liveEdit_liveEdit ``` Bases: `pybind11_object` ### Methods ```python __init__(self) ``` ### Attributes ```python action id ``` ```python __init__(self: omni.kit.collaboration.telemetry._telemetry.Struct_liveEdit_liveEdit) -> None ``` ```
352
omni.kit.commands.builtin.ChangeDraggableSettingCommand.md
# ChangeDraggableSettingCommand ## ChangeDraggableSettingCommand ```python class omni.kit.commands.builtin.ChangeDraggableSettingCommand(path, value) ``` Bases: `Command` Change draggable setting **Command**. ### Parameters - **path** – Path to the setting to change. - **value** – New value to change to. ### Methods - `__init__(path, value)` - `do()` ### `__init__(path, value)` ``` ```
393
omni.kit.commands.builtin.ChangeSettingCommand.md
# ChangeSettingCommand ## ChangeSettingCommand ```python class omni.kit.commands.builtin.ChangeSettingCommand(path, value, prev=None) ``` **Bases:** `Command` Change setting **Command**. **Parameters:** - **path** – Path to the setting to change. - **value** – New value to change to. - **prev** – Previous value to for undo operation. If `None`, current value would be saved as previous. **Methods:** - `__init__(path, value[, prev])` - `do()` - `undo()` ``` path, value, prev = None
490
omni.kit.commands.builtin.Classes.md
# omni.kit.commands.builtin Classes ## Classes Summary: | Class | Description | |-------|-------------| | [ChangeDraggableSettingCommand](omni.kit.commands.builtin/omni.kit.commands.builtin.ChangeDraggableSettingCommand.html) | Change draggable setting **Command**. | | [ChangeSettingCommand](omni.kit.commands.builtin/omni.kit.commands.builtin.ChangeSettingCommand.html) | Change setting **Command**. |
405
omni.kit.commands.builtin.md
# omni.kit.commands.builtin ## Submodules Summary: - [omni.kit.commands.builtin.settings_commands](omni.kit.commands.builtin.settings_commands.html) - No submodule docstring provided ## Classes Summary: - [ChangeDraggableSettingCommand](omni.kit.commands.builtin/omni.kit.commands.builtin.ChangeDraggableSettingCommand.html) - Change draggable setting **Command**. - [ChangeSettingCommand](omni.kit.commands.builtin/omni.kit.commands.builtin.ChangeSettingCommand.html) - Change setting **Command**.
506
omni.kit.commands.builtin.settings_commands.ChangeSettingCommand.md
# ChangeSettingCommand ## ChangeSettingCommand ``` ```markdown class omni.kit.commands.builtin.settings_commands.ChangeSettingCommand(path, value[, prev]) ``` ```markdown Bases: [Command](../omni.kit.commands/omni.kit.commands.Command.html#omni.kit.commands.Command) Change setting **Command**. ### Parameters - **path** – Path to the setting to change. - **value** – New value to change to. - **prev** – Previous value to for undo operation. If `None` current value would be saved as previous. ### Methods - `__init__(path, value[, prev])` - `do()` - `undo()` __init__(path, value, prev=None)
599
omni.kit.commands.builtin.settings_commands.md
# omni.kit.commands.builtin.settings_commands ## Classes Summary - **ChangeDraggableSettingCommand** - Change draggable setting **Command**. - **ChangeSettingCommand** - Change setting **Command**.
203
omni.kit.commands.Classes.md
# omni.kit.commands Classes ## Classes Summary: | Class | Description | |-------|-------------| | [Command](omni.kit.commands/omni.kit.commands.Command.html) | Base class for all **Commands**. |
196
omni.kit.commands.Command.md
# Command ## Command ```python class omni.kit.commands.Command(ABC) ``` Base class for all **Commands**. ### Methods | Method | Description | |--------|-------------| | `do()` | | | `modify_callback_info(cb_type: str, args: Dict[str, Any])` | Returns a dictionary of information to be passed to callbacks of the given type. | ```python def __init__(self): pass ``` ```python def modify_callback_info(self, cb_type: str, args: Dict[str, Any]) -> Dict[str, Any]: pass ``` ## Command.modify_callback_info Returns a dictionary of information to be passed to callbacks of the given type. By default callbacks are passed a copy of the arguments which were passed to `execute()` when the command was invoked. This method can be overridden to modify that information for specific callback types. ### Parameters - **cb_type** – Type of callback the information will be passed to. - **args** – A dictionary containing a copy of the arguments with which the command was invoked. This is a shallow copy so implementations may add, remove or replace dictionary elements but should not modify any of the objects contained within it. ### Returns A dictionary of information to be passed to callbacks of the specified type.
1,227
omni.kit.commands.Command_omni.kit.commands.Command.md
# Command ## Command Base class for all **Commands**. ### Methods - `do()` - `modify_callback_info(cb_type: str, args: Dict[str, Any])` - Returns a dictionary of information to be passed to callbacks of the given type. ## 定义 ```python Dict[str, Any] ``` ### 说明 返回一个字典,其中包含要传递给给定类型的回调的信息。 默认情况下,回调传递的是执行命令时传递的参数的副本。此方法可以被重写以修改特定回调类型的信息。 ### 参数 - **cb_type** – 回调信息的类型。 - **args** – 包含命令执行时传递的参数的副本的字典。这是一个浅拷贝,因此实现可以添加、删除或替换字典元素,但不应修改其中的任何对象。 ### 返回 一个字典,其中包含要传递给指定类型的回调的信息。
482
omni.kit.commands.create.md
# create ## create Create **Command** object. ### Parameters - **name** – **Command** name. - **\*\*kwargs** – Arbitrary keyword arguments to be passed into **Command** constructor. ### Returns - **Command** object if succeeded. `None` if failed.
250
omni.kit.commands.execute.md
# execute ## execute Execute **Command**. ### Parameters - **name** – **Command** name. Can be class name (e.g. “My”) or full name including module (e.g. “foo.bar.MyCommand”) - **\*\*kwargs** – Arbitrary keyword arguments to be passed into into **Command** constructor.
271
omni.kit.commands.execute_argv.md
# execute_argv ## execute_argv ```python omni.kit.commands.execute_argv(name, argv: list) -> Tuple[bool, Any] ``` Execute **Command** using argument list. Attempts to convert argument list into **Command**’s kwargs. If a **Command** has `get_argument_parser` method defined, it will be called to get `argparse.ArgumentParser` instance to use for parsing. Otherwise command docstring is used to extract argument information. ### Parameters - **name** – **Command** name. - **argv** – Argument list. ```
506
omni.kit.commands.Functions.md
# omni.kit.commands Functions ## Functions Summary: - **create**: Create **Command** object. - **execute**: Execute **Command**. - **execute_argv**: Execute **Command** using argument list. - **get_argument_parser_from_function**: - **get_command_class**: Get **Command** class(type) by name. - **get_command_class_signature**: Get the init signature for a **Command**. - **get_command_doc**: Get **Command** docstring by name. - **get_command_parameters**: Get all parameters for a **Commands**. - **get_commands**: Get all registered **Commands**. - **get_commands_list**: Return list of all **Command** classes registered. - **register**: Register a **Command**. - **register_all_commands_in_module**: | Command | Description | |---------|-------------| | `register_callback` | Register a callback for a command. | | `set_logging_enabled` | | | `unregister` | Unregister a **Command**. | | `unregister_callback` | Unregister a command callback previously registered through **register_callback**. | | `unregister_module_commands` | Unregister the list of commands registered by register_all_commands_in_module |
1,116
omni.kit.commands.get_argument_parser_from_function.md
# get_argument_parser_from_function ## get_argument_parser_from_function ```python omni.kit.commands.get_argument_parser_from_function(function) ```
150
omni.kit.commands.get_commands_list.md
# get_commands_list ## get_commands_list ```python omni.kit.commands.get_commands_list() -> List[Type[Command]] ``` Return list of all `Command` classes registered. ```
171
omni.kit.commands.get_command_class.md
# get_command_class  ## get_command_class omni.kit.commands.get_command_class(name: str) → Type[Command]  Get **Command** class(type) by name. ### Parameters - **name** – **Command** name. It may include a module name to be more specific and avoid conflicts. ### Returns - **Command** class if succeeded. `None` if can’t find a command with this name.
356
omni.kit.commands.get_command_class_signature.md
# get_command_class_signature ## get_command_class_signature ```python omni.kit.commands.get_command_class_signature(name: str) ``` Get the init signature for a **Command**. ### Parameters - **name** – **Command** name. It may include a module name to be more specific and avoid conflicts. ### Returns - __init__ signature ``` ```
335
omni.kit.commands.get_command_doc.md
# get_command_doc ## get_command_doc ```python omni.kit.commands.get_command_doc(name: str) -> str ``` Get **Command** docstring by name. **Parameters** - **name** – **Command** name. It may include a module name to be more specific and avoid conflicts. **Returns** - Python docstring (`__doc__`) from a command type. ``` ```
330
omni.kit.commands.get_command_parameters.md
# get_command_parameters  ## get_command_parameters  ### omni.kit.commands.get_command_parameters  ```python omni.kit.commands.get_command_parameters(name: str) -> List[Type[CommandParameter]] ``` Get all parameters for a **Commands**. #### Parameters - **name** – **Command** name. It may include a module name to be more specific and avoid conflicts. #### Returns - A list of **CommandParameter** (except ‘self’ parameter)
430
omni.kit.commands.md
# omni.kit.commands ## Classes Summary: | Class | Description | |-------|-------------| | [Command](omni.kit.commands/omni.kit.commands.Command.html) | Base class for all **Commands**. | ## Functions Summary: | Function | Description | |----------|-------------| | [create](omni.kit.commands/omni.kit.commands.create.html) | Create **Command** object. | | [execute](omni.kit.commands/omni.kit.commands.execute.html) | Execute **Command**. | | [execute_argv](omni.kit.commands/omni.kit.commands.execute_argv.html) | Execute **Command** using argument list. | | [get_argument_parser_from_function](omni.kit.commands/omni.kit.commands.get_argument_parser_from_function.html) | | | [get_command_class](omni.kit.commands/omni.kit.commands.get_command_class.html) | Get **Command** class(type) by name. | | [get_command_class_signature](omni.kit.commands/omni.kit.commands.get_command_class_signature.html) | Get the init signature for a **Command**. | | [get_command_doc](omni.kit.commands/omni.kit.commands.get_command_doc.html) | Get **Command** docstring by name. | | [get_command_parameters](omni.kit.commands/omni.kit.commands.get_command_parameters.html) | Get all parameters for a **Commands**. | | [get_commands](omni.kit.commands/omni.kit.commands.get_commands.html) | Get all registered **Commands**. | | [get_commands_list](omni.kit.commands/omni.kit.commands.get_commands_list.html) | Return list of all **Command** classes registered. | - **register** - Register a **Command**. - **register_all_commands_in_module** - Register all **Commands** found in specified module. - **register_callback** - Register a callback for a command. - **set_logging_enabled** - (No description provided) - **unregister** - Unregister a **Command**. - **unregister_callback** - Unregister a command callback previously registered through **register_callback**. - **unregister_module_commands** - Unregister the list of commands registered by register_all_commands_in_module
1,981
omni.kit.commands.register_all_commands_in_module.md
# register_all_commands_in_module  ## omni.kit.commands.register_all_commands_in_module  ### Parameters **module** – Module name or module object. ### Returns An accessor object that contains a function for every command to execute it. e.g. if you register the commands “Run” and “Hide” then the accessor behaves like: ```python class Accessor: @staticmethod def Run(*args, **kwargs): execute("Run", *args, **kwargs) @staticmethod def Hide(*args, **kwargs): execute("Hide", *args, **kwargs) ``` This gives you a nicer syntax for running your commands: ```python cmds = register_all_commands_in_module(module) cmds.Run(3.14) cmds.Hide("Behind the tree") ```
691
omni.kit.commands.register_callback.md
# register_callback ## register_callback ```python omni.kit.commands.register_callback(name: str, cb_type: str, callback: Callable[[Dict[str, Any]], None]) -> CallbackID ``` Register a callback for a command. ### Parameters - **name** – **Command** name. It may include a module name to be more specific and avoid conflicts. - **cb_type** – Type of callback. Currently supported types are: - PRE_DO_CALLBACK - called before the command is executed - POST_DO_CALLBACK - called after the command is executed - PRE_UNDO_CALLBACK - called before the command is undone - POST_UNDO_CALLBACK - called after the command is undone - **callback** – Callable to be called. Will be passed a dictionary of information specific to that command invocation. By default the dictionary will contain the parameters passed to execute(), but this may be overridden by individual commands so check their documentation. Many command parameters are optional so it is important that callbacks check for their presence before attempting to access them. The callback must not make any changes to ``` # 文档标题 ## 注册回调 ### 描述 一个函数,用于注册一个回调函数,该回调函数将在指定的字典被修改时调用。 ### 参数 #### 参数名 - **callback** (*function*) - 当指定的字典被修改时要调用的函数。 - **dictionary** (*dict*) - 要监视的字典。 ### 返回 一个ID,该ID可以被传递给 `unregister_callback` 函数。
1,298
omni.kit.commands.unregister.md
# unregister ## unregister ```python omni.kit.commands.unregister(command_class: Type[Command]) ``` Unregister a **Command**. **Parameters** - **command_class** – **Command** class. ``` ```
194
omni.kit.commands.unregister_callback.md
# unregister_callback ## unregister_callback Unregister a command callback previously registered through **register_callback**. ### Parameters - **id** – The ID returned by **register_callback** when the callback was registered.
231
omni.kit.commands.unregister_module_commands.md
# unregister_module_commands ## unregister_module_commands ```python omni.kit.commands.unregister_module_commands(command_interface) ``` Unregister the list of commands registered by register_all_commands_in_module ### Parameters - **command_interface** – An object whose only members are command classes that were registered ```
332
omni.kit.context_menu.add_menu.md
# add_menu ## add_menu Add custom menu to any context_menu ### Examples ```python menu = {"name": "Open in Material Editor", "onclick_fn": open_material} # add to all context menus self._my_custom_menu = omni.kit.context_menu.add_menu(menu, "MENU", "") # add to omni.kit.widget.stage context menu self._my_custom_menu = omni.kit.context_menu.add_menu(menu, "MENU", "omni.kit.widget.stage") ``` ### Parameters - **menu_dict** – a dictionary containing menu settings. See ContextMenuExtension docs for information on values - **index** – name of the menu EG. “MENU” - **extension_id** – name of the target EG. “” or “omni.kit.widget.stage” ### NOTE index and extension_id are extension arbitrary values. `add_menu(menu, "MENU", "omni.kit.widget.stage")` works as `omni.kit.widget.stage` retrieves custom context_menus with `get_menu_dict("MENU", "omni.kit.widget.stage")`. Adding a menu to an extension that doesn’t support context_menus would have no effect. ### Returns - A MenuSubscription, keep a copy of this as the custom menu will be removed when `release()` is explicitly called or this is garbage collected. - Return type: (MenuSubscription) ``` --- title: 页面标题 --- # 一级标题 ## 二级标题 ### 三级标题 正文内容... > 引用内容...
1,225
omni.kit.context_menu.Classes.md
# omni.kit.context_menu Classes ## Classes Summary: | Class Name | Description | |------------|-------------| | ContextMenuExtension | Context menu core functionality. | | ViewportMenu | Viewport context menu implementation with own styling |
244
omni.kit.context_menu.ContextMenuExtension.md
# ContextMenuExtension ## ContextMenuExtension ``` ```python class ContextMenu: def on_startup(self): # get window event stream import omni.kit.viewport_legacy viewport_win = get_viewport_interface().get_viewport_window() # on_mouse_event called when event dispatched self._stage_event_sub = viewport_win.get_mouse_event_stream().create_subscription_to_pop(self.on_mouse_event) def on_shutdown(self): # remove event self._stage_event_sub = None def on_mouse_event(self, event): # check its expected event if event.type != int(omni.kit.ui.MenuEventType.ACTIVATE): return # get context menu core functionality & check its enabled context_menu = omni.kit.context_menu.get_instance() if context_menu is None: carb.log_error("context_menu is disabled!") return # get parameters passed by event objects = {} objects["test_path"] = event.payload["test_path"] # setup objects, this is passed to all functions objects["test"] = "this is a test" # setup menu menu_list = [ # "name" is name shown on menu. (if name is "" then a menu ui.Separator is added. Can be combined with show_fn) # "glyph" is icon shown on menu, can use full paths to extensions # "name_fn" function to get menu item name # "show_fn" function or list of functions used to decide if menu item is shown. All functions must return True to show # "enabled_fn" function or list of functions used to decide if menu item is enabled. All functions must return True to be enabled # "onclick_fn" function to be called when user clicks menu item # "onclick_action" action to be called when user clicks menu item # "checked_fn" function returns True/False and shows solid/grey tick # "header" as be used with name of "" to use named ui.Separator # "populate_fn" a function to be called to populate the menu. Can be combined with show_fn # "appear_after" a identifier of menu name. Used by custom menus and will allow custom menu to change order # "show_fn_async" this is async function to set items visible flag. These behave differently to show functions as the item will be created regardless and have its visibility set to False and its upto show_fn_async callback to set the visible flag to True if required { "name": "Test Menu", "glyph": "question.svg", "show_fn": [ContextMenu.has_reason_to_show, ContextMenu.has_another_reason_to_show], "onclick_fn": ContextMenu.clear_default_prim }, { "name": "", "show_fn": ContextMenu.has_another_reason_to_show }, { "populate_fn": context_menu.show_create_menu }, { "name": "" }, { "name": "Copy URL Link", "glyph": "menu_link.svg", "onclick_fn": ContextMenu.copy_prim_url } # add custom menus menu_list += omni.kit.context_menu.get_menu_dict("MENU", "") menu_list += omni.kit.context_menu.get_menu_dict("MENU", "stagewindow") omni.kit.context_menu.reorder_menu_dict(menu_dict) # show menu context_menu.show_context_menu("stagewindow", objects, menu_list) # show_fn functions def has_reason_to_show(objects: dict): if not "test_path" in objects: return False return True def has_another_reason_to_show(objects: dict): if not "test_path" in objects: return False return True def copy_prim_url(objects: dict): try: import omni.kit.clipboard omni.kit.clipboard.copy("My hovercraft is full of eels") except ImportError: carb.log_warn("Could not import omni.kit.clipboard.") Builds "Create" context sub-menu items can_assign_material_async (objects, menu_item) async show function. can_be_copied (objects) Checks if prims can be copied :param objects: context_menu data :type objects: dict can_convert_references_or_payloads (objects) Checks if references can be converted into payloads or vice versa. can_delete (objects) Checks if prims can be deleted :param objects: context_menu data :type objects: dict can_show_find_in_browser (objects) Checks if "find" can be shown in browser. can_use_find_in_browser (objects) Checks if "find" can be used in browser. close_menu () [omni.kit.widget.context_menu bridge function] Close currently open context menu. convert_payload_to_reference (objects) Converts selected prims from payload(s) to reference(s). convert_reference_to_payload (objects) Converts selected prims from reference(s) to payload(s). copy_prim_path (objects) Copy prims path to clipboard copy_prim_url (objects) Copies URL of Prim in USDA references format. create_mesh_prim (prim_type) Create mesh prims create_prim (prim_type, attributes[, ...]) Create prims delete_prim (objects[, destructive]) - **Delete prims** - **duplicate_prim** (objects) - Duplicate prims - **find_in_browser** (objects) - Select prim in content_browser - **get_context_menu** () - [omni.kit.widget.context_menu bridge function] Gets current context_menu. - **get_prim_group** (prim) - If the prim is or has a parent prim that is a group Kind, returns that prim otherwise None - **group_selected_prims** (objects) - Group prims - **has_payload** (objects) - Checks if prims have payload. - **has_payload_or_reference** (objects) - Checks if prims have payloads or references :param objects: context_menu data :type objects: dict - **has_reference** (objects) - Checks if prims have references. - **is_material** (objects) - Checks if prims are UsdShade.Material - **is_material_bindable** (objects) - Checks if prims support material binding. - **is_one_prim_selected** (objects) - Checks if one prim is selected. - **is_prim_in_group** (objects) - Checks if any prims are in group(s) - **is_prim_selected** (objects) - Checks if any prims are selected - **menu** (*args, **kwargs) - [omni.kit.widget.context_menu bridge function] Creates a menu. - **menu_item** ### Functions - `menu_item(*args, **kwargs)` - [omni.kit.widget.context_menu bridge function] Creates a menu item. - `on_shutdown()` - ContextMenuExtension shutdown function. - `on_startup(ext_id)` - ContextMenuExtension startup function. - `prim_is_type(objects, type)` - Checks if prims are given class/schema - `refresh_payload_or_reference(objects)` - Find layers containing prims and triggers reload. - `refresh_reference_payload_name(objects)` - Checks if prims have references/payload and returns name - `select_prims_using_material(objects)` - Select stage prims using material - `separator([name])` - [omni.kit.widget.context_menu bridge function] Creates a ui.Separator named `name`. - `show_context_menu(menu_name, objects, menu_list)` - [omni.kit.widget.context_menu bridge function] build context menu from menu_list - `show_create_menu(objects)` - Populate function that builds create menu - `show_selected_prims_names(objects[, delegate])` - Populate function that builds menu items with selected prim info - `ungroup_selected_prims(objects)` - Ungroup prims ### Attributes - `menu_item_count` - [omni.kit.widget.context_menu bridge function] Number of items in context menu. - `name` - [omni.kit.widget.context_menu bridge function] Name of current context menu. <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.context_menu.ContextMenuExtension.__init__"> <span class="sig-name descname"> <span class="pre"> __init__ <span class="sig-paren"> ( <span class="sig-paren"> ) <dd> <p> ContextMenuExtension init function. <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.context_menu.ContextMenuExtension.bind_material_to_prims_dialog"> <span class="sig-name descname"> <span class="pre"> bind_material_to_prims_dialog <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> stage <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> Stage , <em class="sig-param"> <span class="n"> <span class="pre"> prims <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> list <span class="sig-paren"> ) <dd> <p> [deprecated] Shows bind_material_to_prims_dialog. <p> Replaced by omni.kit.material.library.bind_material_to_prims_dialog() <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.context_menu.ContextMenuExtension.build_add_menu"> <span class="sig-name descname"> <span class="pre"> build_add_menu <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> objects <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> dict , <em class="sig-param"> <span class="n"> <span class="pre"> prim_list <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> list , <em class="sig-param"> <span class="n"> <span class="pre"> custom_menu <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> Optional <span class="p"> <span class="pre"> [ <span class="pre"> list <span class="p"> <span class="pre"> ] <span class="w"> <span class="o"> <span class="pre"> = <span class="w"> <span class="default_value"> <span class="pre"> None , <em class="sig-param"> <span class="n"> <span class="pre"> delegate <span class="o"> <span class="pre"> = <span class="default_value"> <span class="pre"> None <span class="sig-paren"> ) <dd> <p> Builds “Add” context sub-menu items <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.context_menu.ContextMenuExtension.build_create_menu"> <span class="sig-name descname"> <span class="pre"> build_create_menu <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> objects <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> dict , <em class="sig-param"> <span class="n"> <span class="pre"> prim_list <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> list , <em class="sig-param"> <span class="n"> <span class="pre"> custom_menu <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> dict <span class="w"> <span class="o"> <span class="pre"> = <span class="w"> <span class="default_value"> <span class="pre"> [] , <em class="sig-param"> <span class="n"> <span class="pre"> delegate <span class="o"> <span class="pre"> = <span class="default_value"> <span class="pre"> None <span class="sig-paren"> ) <dd> <p> Builds “Create” context sub-menu items ### can_assign_material_async async show function. The `menu_item` is created but not visible, if this item is shown then `menu_item.visible = True`. This scans all the prims in the stage looking for a material, if one is found then it can “assign material” and `menu_item.visible = True`. **Parameters** - **objects** (dict) – context_menu data. - **menu_item** – (uiMenuItem): menu item. ### can_be_copied Checks if prims can be copied. **Parameters** - **objects**: context_menu data - **type objects**: dict **Returns** - True if prims can be copied else False. **Return type** - (bool) ### can_convert_references_or_payloads Checks if references can be converted into payloads or vice versa. **Parameters** - **objects**: context_menu data - **type objects**: dict **Returns** - True if prims can be converted from to payload/reference otherwise False. **Return type** - (bool) ### can_delete Checks if prims can be deleted. **Parameters** - **objects**: context_menu data - **type objects**: dict **Returns** - True if prim can be deleted otherwise False. **Return type** - (bool) ### can_show_find_in_browser Checks if “find” can be shown in browser. IE one prim is selected and is authored. **Parameters** - **objects**: context_menu data - **type objects**: dict **Returns** - True if authored and has URL that is saved otherwise False. **Return type** - (bool) ### can_use_find_in_browser ### can_use_find_in_browser Checks if “find” can be used in browser. #### Parameters - **objects** (dict) – context_menu data #### Returns True if prims are authored else False. #### Return type (bool) ### close_menu [omni.kit.widget.context_menu bridge function] Close currently open context menu. Used by tests not to leave context menu in bad state. ### convert_payload_to_reference Converts selected prims from payload(s) to reference(s). #### Parameters - **objects** (dict) – context_menu data ### convert_reference_to_payload Converts selected prims from reference(s) to payload(s). #### Parameters - **objects** (dict) – context_menu data ### copy_prim_path Copy prims path to clipboard #### Parameters - **objects** – context_menu data ### copy_prim_url Copies URL of Prim in USDA references format. @planet.usda@&lt;/Planet&gt; ### create_mesh_prim #### Parameters - **prim_type** (str) #### Returns None Create mesh prims Parameters - **objects** – context_menu data - **prim_type** – created prim’s type Create prims Parameters - **objects** – context_menu data - **prim_type** – created prim’s type - **attributes** – created prim’s custom attributes - **create_group_xform** – passed to CreatePrimWithDefaultXformCommand delete_prim(objects: dict, destructive: bool = False) Delete prims Parameters - **objects** – context_menu data - **destructive** – If it’s true, it will remove all corresponding prims in all layers. Otherwise, it will deactivate the prim in current edit target if its def is not in the current edit target. By default, it will be non-destructive. duplicate_prim(objects: dict) Duplicate prims Parameters - **objects** – context_menu data find_in_browser(objects: dict) <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.context_menu.ContextMenuExtension.find_in_browser"> <span class="sig-name descname"> <span class="pre"> find_in_browser <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> objects <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> dict <span class="sig-paren"> ) <span class="sig-return"> <span class="sig-return-icon"> → <span class="sig-return-typehint"> <span class="pre"> None <dd> <p> Select prim in content_browser <dl class="field-list simple"> <dt class="field-odd"> Parameters <dd class="field-odd"> <p> <strong> objects – context_menu data <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.context_menu.ContextMenuExtension.get_context_menu"> <span class="sig-name descname"> <span class="pre"> get_context_menu <span class="sig-paren"> ( <span class="sig-paren"> ) <dd> <p> [omni.kit.widget.context_menu bridge function] Gets current context_menu. <dl class="field-list simple"> <dt class="field-odd"> Returns <dd class="field-odd"> <p> Current context_menu. <dt class="field-even"> Return type <dd class="field-even"> <p> (str) <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.context_menu.ContextMenuExtension.get_prim_group"> <span class="sig-name descname"> <span class="pre"> get_prim_group <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> prim <span class="sig-paren"> ) <dd> <p> If the prim is or has a parent prim that is a group Kind, returns that prim otherwise None <dl class="field-list simple"> <dt class="field-odd"> Parameters <dd class="field-odd"> <p> <strong> prim ( <em> Usd.Prim ) – prim to get group from. <dt class="field-even"> Returns <dd class="field-even"> <p> (Usd.Prim) Group prim or None. <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.context_menu.ContextMenuExtension.group_selected_prims"> <span class="sig-name descname"> <span class="pre"> group_selected_prims <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> objects <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> dict <span class="sig-paren"> ) <dd> <p> Group prims <dl class="field-list simple"> <dt class="field-odd"> Parameters <dd class="field-odd"> <p> <strong> prims – list of prims <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.context_menu.ContextMenuExtension.has_payload"> <span class="sig-name descname"> <span class="pre"> has_payload <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> objects <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> dict <span class="sig-paren"> ) <dd> <p> Checks if prims have payload. <dl class="field-list simple"> <dt class="field-odd"> Parameters <dd class="field-odd"> <p> <strong> objects ( <em> dict ) – context_menu data <dt class="field-even"> Returns <dd class="field-even"> <p> True if prims has payload otherwise False. <dt class="field-odd"> Return type <dd class="field-odd"> <p> (bool) <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.context_menu.ContextMenuExtension.has_payload_or_reference"> <span class="sig-name descname"> <span class="pre"> has_payload_or_reference <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> objects <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> dict <span class="sig-paren"> ) <dd> <p> Checks if prims have payloads or references :param objects: context_menu data :type objects: dict <dl class="field-list simple"> <dt class="field-odd"> Returns <dd class="field-odd"> <p> True if prims have payload or references otherwise False. <dt class="field-even"> Return type <dd class="field-even"> <p> (bool) <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.context_menu.ContextMenuExtension.has_reference"> <span class="sig-name descname"> <span class="pre"> has_reference <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> objects <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> dict <span class="sig-paren"> ) <dd> <p> Checks if prims have reference. <dl class="field-list simple"> <dt class="field-odd"> Parameters <dd class="field-odd"> <p> <strong> objects ( <em> dict ) – context_menu data <dt class="field-even"> Returns <dd class="field-even"> <p> True if prims have reference otherwise False. <dt class="field-odd"> Return type <dd class="field-odd"> <p> (bool) ### has_reference Checks if prims have references. :param objects: context_menu data :type objects: dict Returns: - True if prims have reference otherwise False. - Return type: (bool) ### is_material Checks if prims are UsdShade.Material Parameters: - **objects** (dict) – context_menu data Returns: - True if prim is UsdShade.Material else False. - Return type: (bool) ### is_material_bindable Checks if prims support material binding. Parameters: - **objects** (dict) – context_menu data Returns: - True if prims can have bound materials otherwise False. - Return type: (bool) ### is_one_prim_selected Checks if one prim is selected. Parameters: - **objects** (dict) – context_menu data Returns: - True if one prim is selected otherwise False. - Return type: (bool) ### is_prim_in_group Checks if any prims are in group(s) Parameters: - **objects** (dict) – context_menu data Returns: - True if prims are part of group otherwise False. - Return type: (bool) ### is_prim_selected Checks if any prims are selected #### Parameters - **objects** (`dict`) – context_menu data #### Returns - True if one or more prim is selected otherwise False. #### Return type - (bool) ### menu [omni.kit.widget.context_menu bridge function] Creates a menu. #### Parameters - **name** (`str`) – Name of the menu. - **delegate** (`ui.MenuDelegate`) – Specify the delegate to create a custom menu. Optional. - **glyph** (`str`) – Path of the glyph image to show before the menu name. Optional. - **submenu** (`bool`) – Enables the submenu marker. Optional. - **tearable** (`bool`) – The ability to tear the window off. Optional. #### Returns - Menu item created. #### Return type - (uiMenu) ### menu_item [omni.kit.widget.context_menu bridge function] Creates a menu item. #### Parameters - **name** (`str`) – Name of the menu item. - **triggered_fn** (`Callable`) – Function to call when menu item is clicked. Optional. - **enabled** (`bool`) – Enable the menu item. Optional. - **checkable** (`bool`) – This property holds whether this menu item is checkable. A checkable item is one which has an on/off state. Optional. - **checked** (`bool`) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked. Optional. - **is_async_func** (`bool`) – Optional. - **delegate** (`ui.MenuDelegate`) – Specify the delegate to create a custom menu. Optional. - **additional_kwargs** (**dict**) – Additional keyword arguments to pass to ui.MenuItem. Optional. - **glyph** (**str**) – Path of the glyph image to show before the menu name. Optional. ### Returns Menu item created. ### Return type (uiMenuItem) ### on_shutdown ContextMenuExtension shutdown function. ### on_startup ContextMenuExtension startup function. #### Parameters - **ext_id** (**str**) – Extension identifier. ### prim_is_type Checks if prims are given class/schema #### Parameters - **objects** (**dict**) – context_menu data. - **type** (**Tf.Type**) – prim type to check. #### Returns True if prims are of type `type` otherwise False. #### Return type (bool) ### refresh_payload_or_reference Find layers containing prims and triggers reload. ### refresh_reference_payload_name Checks if prims have references/payload and returns name #### Returns Name of payload/reference or None #### Return type (str) ### select_prims_using_material ( objects : dict ) ``` ```markdown Select stage prims using material ``` ```markdown Parameters ``` ```markdown objects – context_menu data ``` ```markdown ### separator ( name : str = '' ) → bool ``` ```markdown [omni.kit.widget.context_menu bridge function] Creates a ui.Separator named `name`. ``` ```markdown Parameters ``` ```markdown name ( str ) – Name of the menu separator. Optional. ``` ```markdown ### show_context_menu ( menu_name : str , objects : dict , menu_list : List[dict] , min_menu_entries : int = 1 , **kwargs ) → None ``` ```markdown [omni.kit.widget.context_menu bridge function] build context menu from menu_list ``` ```markdown Parameters ``` ```markdown - menu_name – menu name ``` ```markdown - objects – context_menu data ``` ```markdown - menu_list – list of dictionaries containing context menu values ``` ```markdown - min_menu_entries – minimal number of menu needed for menu to be visible ``` ```markdown ### show_create_menu ( objects : dict ) ``` ```markdown [omni.kit.widget.context_menu bridge function] ``` ```markdown Parameters ``` ```markdown objects – context_menu data ``` ```markdown ### ContextMenuExtension Methods #### show_create_menu Populate function that builds create menu **Parameters** - **objects** – context_menu data #### show_selected_prims_names Populate function that builds menu items with selected prim info **Parameters** - **objects** – context_menu data #### ungroup_selected_prims Ungroup prims **Parameters** - **prims** – list of prims ### ContextMenuExtension Properties #### menu_item_count [omni.kit.widget.context_menu bridge function] Number of items in context menu. **Returns** - number of menu items. **Return type** - (int) #### name [omni.kit.widget.context_menu bridge function] Name of current context menu. **Returns** - Name of current context menu. **Return type** - (str)
28,348
omni.kit.context_menu.Functions.md
# omni.kit.context_menu Functions ## Functions Summary: | Function | Description | |----------|-------------| | `add_menu` | Add custom menu to any context_menu | | `close_menu` | Close currently open context menu. Used by tests not to leave context menu in bad state. | | `get_hovered_prim` | Get prim currently under mouse cursor or None. | | `get_instance` | Get instance of context menu class | | `get_menu_dict` | Get custom menus | | `get_menu_event_stream` | Gets menu event stream. | | `get_widget_instance` | Get instance of context menu class | | `post_notification` | Post a notification via omni.kit.notification_manager. | | `reorder_menu_dict` | Reorder menus using “appear_after” value in menu |
712
omni.kit.context_menu.get_hovered_prim.md
# get_hovered_prim ## get_hovered_prim ```python omni.kit.context_menu.get_hovered_prim(objects) ``` Get prim currently under mouse cursor or None. ### Parameters - **objects** (dict) – context_menu data ### Returns - Prim that is hovered by mouse cursor or None. ### Return type - (Usd.Prim) ```
301
omni.kit.context_menu.get_menu_dict.md
## get_menu_dict ### get_menu_dict ```python omni.kit.context_menu.get_menu_dict(index: str = 'MENU', extension_id: str = '') -> List[dict] ``` Get custom menus. See add_menu for dictionary info. #### Parameters - **index** (str) – name of the menu - **extension_id** (str) – name of the target #### Returns - a list of dictionaries containing custom menu settings. See ContextMenuExtension docs for information on values #### Return type - (list) ```
457
omni.kit.context_menu.get_widget_instance.md
# get_widget_instance ## get_widget_instance Get instance of context menu class **Returns:** - Instance of class. **Return type:** - (ContextMenuWidgetExtension)
165
omni.kit.context_menu.md
# omni.kit.context_menu ## Submodules Summary: - **omni.kit.context_menu.scripts** Context menu implementation classes. ## Classes Summary: - **ContextMenuExtension** Context menu core functionality. - **ViewportMenu** Viewport context menu implementation with own styling ## Functions Summary: - **add_menu** Add custom menu to any context_menu - **close_menu** Close currently open context menu. Used by tests not to leave context menu in bad state. - **get_hovered_prim** Get prim currently under mouse cursor or None. - **get_instance** Get instance of context menu class - **get_menu_dict** Get custom menus - **get_menu_event_stream** Gets menu event stream. - **get_widget_instance** Get instance of context menu class <section> <table> <tbody> <tr class="row-even"> <td> <p> post_notification <td> <p> Post a notification via omni.kit.notification_manager. <tr class="row-odd"> <td> <p> reorder_menu_dict <td> <p> Reorder menus using “appear_after” value in menu
1,257
omni.kit.context_menu.post_notification.md
# post_notification ## post_notification ```python omni.kit.context_menu.post_notification(message: str, info: bool = False, duration: int = 3) ``` Post a notification via omni.kit.notification_manager. ### Parameters - **message** (str) – The notification text. - **info** (bool) – notification is NotificationStatus.INFO when True otherwise NotificationStatus.WARNING - **duration** (int) – The duration (in seconds) after which the notification will be hidden. This duration only works if hide_after_timeout is True.
522
omni.kit.context_menu.reorder_menu_dict.md
# reorder_menu_dict ## reorder_menu_dict Reorder menus using “appear_after” value in menu ### Parameters - **menu_dict** (list) – list of dictionaries
152
omni.kit.context_menu.scripts.Classes.md
# omni.kit.context_menu.scripts Classes ## Classes Summary - **ContextMenuExtension** - Context menu core functionality. - **ViewportMenu** - Viewport context menu implementation with own styling ### ContextMenuExtension [ContextMenuExtension](./omni.kit.context_menu.scripts/omni.kit.context_menu.scripts.ContextMenuExtension.html) ### ViewportMenu [ViewportMenu](./omni.kit.context_menu.scripts/omni.kit.context_menu.scripts.ViewportMenu.html)
453
omni.kit.context_menu.scripts.context_menu.Classes.md
# omni.kit.context_menu.scripts.context_menu Classes ## Classes Summary: | Class | Description | |-------|-------------| | [ContextMenuExtension](./omni.kit.context_menu.scripts.context_menu/omni.kit.context_menu.scripts.context_menu.ContextMenuExtension.html) | Context menu core functionality. |
299
omni.kit.context_menu.scripts.context_menu.md
# omni.kit.context_menu.scripts.context_menu ## Classes Summary - [ContextMenuExtension](omni.kit.context_menu.scripts.context_menu/omni.kit.context_menu.scripts.context_menu.ContextMenuExtension.html): Context menu core functionality. ## Functions Summary - [add_menu](omni.kit.context_menu.scripts.context_menu/omni.kit.context_menu.scripts.context_menu.add_menu.html): Add custom menu to any context_menu - [close_menu](omni.kit.context_menu.scripts.context_menu/omni.kit.context_menu.scripts.context_menu.close_menu.html): Close currently open context menu. Used by tests not to leave context menu in bad state. - [get_hovered_prim](omni.kit.context_menu.scripts.context_menu/omni.kit.context_menu.scripts.context_menu.get_hovered_prim.html): Get prim currently under mouse cursor or None. - [get_instance](omni.kit.context_menu.scripts.context_menu/omni.kit.context_menu.scripts.context_menu.get_instance.html): Get instance of context menu class - [get_menu_dict](omni.kit.context_menu.scripts.context_menu/omni.kit.context_menu.scripts.context_menu.get_menu_dict.html): Get custom menus - [get_menu_event_stream](omni.kit.context_menu.scripts.context_menu/omni.kit.context_menu.scripts.context_menu.get_menu_event_stream.html): Gets menu event stream. - [get_widget_instance](omni.kit.context_menu.scripts.context_menu/omni.kit.context_menu.scripts.context_menu.get_widget_instance.html): Get instance of context menu class <p> post_notification <p> Post a notification via omni.kit.notification_manager. <p> reorder_menu_dict <p> Reorder menus using “appear_after” value in menu
1,596
omni.kit.context_menu.scripts.get_menu_dict.md
# get_menu_dict  ## get_menu_dict  ### omni.kit.context_menu.scripts.get_menu_dict  #### Parameters - **index** (str) – name of the menu - **extension_id** (str) – name of the target #### Returns - a list of dictionaries containing custom menu settings. See ContextMenuExtension docs for information on values #### Return type - (list)
340
omni.kit.context_menu.scripts.md
# omni.kit.context_menu.scripts ## Submodules Summary: - [omni.kit.context_menu.scripts.context_menu](omni.kit.context_menu.scripts.context_menu.html) - Context menu implementation classes. - [omni.kit.context_menu.scripts.viewport_menu](omni.kit.context_menu.scripts.viewport_menu.html) - Viewport context menu implementation with own styling ## Classes Summary: - [ContextMenuExtension](omni.kit.context_menu.scripts/omni.kit.context_menu.scripts.ContextMenuExtension.html) - Context menu core functionality. - [ViewportMenu](omni.kit.context_menu.scripts/omni.kit.context_menu.scripts.ViewportMenu.html) - Viewport context menu implementation with own styling ## Functions Summary: - [add_menu](omni.kit.context_menu.scripts/omni.kit.context_menu.scripts.add_menu.html) - Add custom menu to any context_menu - [close_menu](omni.kit.context_menu.scripts/omni.kit.context_menu.scripts.close_menu.html) - Close currently open context menu. Used by tests not to leave context menu in bad state. - [get_hovered_prim](omni.kit.context_menu.scripts/omni.kit.context_menu.scripts.get_hovered_prim.html) - Get prim currently under mouse cursor or None. - [get_instance](omni.kit.context_menu.scripts/omni.kit.context_menu.scripts.get_instance.html) - Get instance of context menu class - [get_menu_dict](omni.kit.context_menu.scripts/omni.kit.context_menu.scripts.get_menu_dict.html) - Get menu dictionary | HTML Content | Markdown Content | |--------------|------------------| | Get custom menus | Get custom menus | | get_menu_event_stream | get_menu_event_stream | | Gets menu event stream. | Gets menu event stream. | | get_widget_instance | get_widget_instance | | Get instance of context menu class | Get instance of context menu class | | post_notification | post_notification | | Post a notification via omni.kit.notification_manager. | Post a notification via omni.kit.notification_manager. | | reorder_menu_dict | reorder_menu_dict | | Reorder menus using “appear_after” value in menu | Reorder menus using “appear_after” value in menu |
2,065
omni.kit.context_menu.scripts.reorder_menu_dict.md
# reorder_menu_dict ## reorder_menu_dict ```python omni.kit.context_menu.scripts.reorder_menu_dict(menu_dict: List[dict]) ``` Reorder menus using “appear_after” value in menu **Parameters** - **menu_dict** (list) – list of dictionaries
239
omni.kit.context_menu.scripts.Submodules.md
# omni.kit.context_menu.scripts Submodules ## Submodules Summary | Module Name | Description | |-------------|-------------| | omni.kit.context_menu.scripts.context_menu | Context menu implementation classes. | | omni.kit.context_menu.scripts.viewport_menu | Viewport context menu implementation with own styling |
316
omni.kit.context_menu.scripts.ViewportMenu.md
# ViewportMenu ## ViewportMenu | Function Name | Description | |---------------|-------------| | `set_prim_to_pos(path, new_pos)` | | | `show_create_menu(objects)` | | | `show_menu(usd_context_name[, prim_path, ...])` | | ### Attributes | Attribute Name | Description | |----------------|-------------| | `menu_delegate` | | ### Methods #### `__init__()` #### `ViewportMenuDelegate` **Class**: `ViewportMenuDelegate(**kwargs)` - **Bases**: `DefaultMenuDelegate` ##### `get_style()` - **Description**: Get current style
527
omni.kit.context_menu.scripts.viewport_menu.Classes.md
# omni.kit.context_menu.scripts.viewport_menu Classes ## Classes Summary - **ViewportMenu** - Viewport context menu implementation with own styling
151
omni.kit.context_menu.Submodules.md
# omni.kit.context_menu Submodules ## Submodules Summary | Module | Description | | --- | --- | | [omni.kit.context_menu.scripts](omni.kit.context_menu.scripts.html) | Context menu implementation classes. |
208
omni.kit.context_menu.ViewportMenu.md
# ViewportMenu ## ViewportMenu Viewport context menu implementation with own styling ### Methods - `bind_material_to_prim_dialog(objects)` - `can_show_clear_clipboard(objects, menu_item)` - `clear_clipboard()` - `copy_prim_to_clipboard(objects)` - `is_material_bindable(objects)` - `is_on_clipboard(objects, name)` - `is_prim_on_clipboard(objects)` - `paste_prim_from_clipboard(objects)` - `set_prim_to_pos(path, new_pos)` ```{code-block} html :linenos: <span class="pre"> show_create_menu (objects) <td> <p> <tr class="row-odd"> <td> <p> <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> show_menu (usd_context_name[, prim_path, ...]) <td> <p> <p class="rubric"> Attributes <table class="autosummary longtable docutils align-default"> <colgroup> <col style="width: 10%"/> <col style="width: 90%"/> <tbody> <tr class="row-odd"> <td> <p> <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> menu_delegate <td> <p> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.context_menu.ViewportMenu.__init__"> <span class="sig-name descname"> <span class="pre"> __init__ <span class="sig-paren"> ( <span class="sig-paren"> ) <a class="headerlink" href="#omni.kit.context_menu.ViewportMenu.__init__" title="Permalink to this definition">  <dd> <dl class="py class"> <dt class="sig sig-object py" id="omni.kit.context_menu.ViewportMenu.ViewportMenuDelegate"> <em class="property"> <span class="pre"> class <span class="w"> <span class="sig-name descname"> <span class="pre"> ViewportMenuDelegate <span class="sig-paren"> ( <em class="sig-param"> <span class="o"> <span class="pre"> ** <span class="n"> <span class="pre"> kwargs <span class="sig-paren"> ) <a class="headerlink" href="#omni.kit.context_menu.ViewportMenu.ViewportMenuDelegate" title="Permalink to this definition">  <dd> <p> Bases: <code class="xref py py-class docutils literal notranslate"> <span class="pre"> DefaultMenuDelegate <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.context_menu.ViewportMenu.ViewportMenuDelegate.get_style"> <span class="sig-name descname"> <span class="pre"> get_style <span class="sig-paren"> ( <span class="sig-paren"> ) <a class="headerlink" href="#omni.kit.context_menu.ViewportMenu.ViewportMenuDelegate.get_style" title="Permalink to this definition">  <dd> <p> Get current style <footer> <hr/> <script> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); ```
2,527
omni.kit.converter.cad.CadConverter.md
# CadConverter ## Class: omni.kit.converter.cad.CadConverter Bases: `omni.ext._extensions.IExt` ### Methods - `__init__(self: omni.ext._extensions.IExt) -> None` - `on_shutdown()` - `on_startup()`
200
omni.kit.converter.cad_core.CadConverterHelper.md
# CadConverterHelper ## CadConverterHelper ```python class omni.kit.converter.cad_core.CadConverterHelper ``` Bases: `object` Can be used to make calls to the CAD converter and for updating the USD stage ### Methods - `__init__()` - Initialize CAD Converter Helper class - `cancel_task()` - Cancel CAD file conversion - `create_import_task(converter_options)` - Wraps the Hoops Exchange CAD Converter so that it works with Nucleus files. - `destroy()` - Clean up resources - `get_cached_stage_id()` - (No description provided) - `set_progress_changed_callback(cb)` - Set change in progress - `set_step_changed_callback(cb)` - (No description provided) ### Attributes | Name | Description | | --- | --- | | `CONVERTER_EXT_NAME` | | ### Methods #### `__init__()` Initialize CAD Converter Helper class #### `cancel_task()` Cancel CAD file conversion #### `create_import_task(converter_options: omni.kit.converter.cad_core._impl.options_models.HoopsOptions)` Wraps the Hoops Exchange CAD Converter so that it works with Nucleus files. **Parameters:** - `converter_options` – converter settings object **Returns:** - Final output destination URL. - hoops_convert_status(namedtuple): Hoops error code and associated message **Return type:** - output_destination_url (str) #### `destroy()` Clean up resources #### `set_progress_changed_callback(cb)` Set change in progress #### `set_step_changed_callback(cb)` Set change in step
1,457
omni.kit.converter.cad_core.CadCoreConverter.md
# CadCoreConverter ## CadCoreConverter ```python class omni.kit.converter.cad_core.CadCoreConverter(omni.ext._extensions.IExt) ``` CAD Core Converter Extension ### Methods | Method | Description | |--------|-------------| | `create_converter_task(converter_options[, ...])` | Converts CAD file (import_path) to USD (output_path) | | `on_shutdown()` | Uninitialize the CAD Converter and/or un-registers the service | | `on_startup()` | Initialize the CAD Converter and/or un-registers the service | ```python def __init__(self: omni.ext._extensions.IExt) -> None: pass def create_converter_task(self, converter_options, *args, **kwargs): pass def on_shutdown(self): pass def on_startup(self): pass ``` <em> <span class="n"> <span class="pre"> converter_options <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> omni.kit.converter.cad_core._impl.options_models.HoopsOptions , <em class="sig-param"> <span class="n"> <span class="pre"> progress_changed_callback <span class="o"> <span class="pre"> = <span class="default_value"> <span class="pre"> None , <em class="sig-param"> <span class="n"> <span class="pre"> step_changed_callback <span class="o"> <span class="pre"> = <span class="default_value"> <span class="pre"> None <span class="sig-paren"> ) <dd> <p> Converts CAD file (import_path) to USD (output_path) <p> Returns: An object containing the Path to the converted USD (str) and converter status (namedtuple). <p> If the path is empty, the conversion has failed. <p> The namedtuple contains error code (int) and error message (str). <dl class="field-list simple"> <dt class="field-odd"> Parameters <dd class="field-odd"> <ul class="simple"> <li> <p> <strong> converter_options – converter settings object <li> <p> <strong> progress_changed_callback – callback function (progress_text:str, progress_value:float) <li> <p> <strong> step_changed_callback – callback function (step_text:str) <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.converter.cad_core.CadCoreConverter.on_shutdown"> <span class="sig-name descname"> <span class="pre"> on_shutdown <span class="sig-paren"> ( <span class="sig-paren"> ) <dd> <p> Uninitialize the CAD Converter and/or un-registers the service <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.converter.cad_core.CadCoreConverter.on_startup"> <span class="sig-name descname"> <span class="pre"> on_startup <span class="sig-paren"> ( <span class="sig-paren"> ) <dd> <p> Initialize the CAD Converter and/or un-registers the service
3,277
omni.kit.converter.cad_core.CadRequest.md
# CadRequest ## CadRequest Generic request object. Can be used to retrieve result after completing. ### Methods | Method | Description | |--------|-------------| | `__init__(*args, **kwargs)` | | | `is_finished(self)` | Status of request. | #### `__init__(*args, **kwargs)` #### `is_finished(self)` Status of request. Returns true if request complete. --- title: "文章标题" author: "作者" date: "2023-04-01" --- ## 一级标题 这里是正文内容,包含一些文本和格式。 ### 二级标题 这里是更多的文本内容。 #### 三级标题 这里是更详细的文本内容。 --- 这里是页脚内容。
503
omni.kit.converter.cad_core.Classes.md
# omni.kit.converter.cad_core Classes  ## Classes Summary: | Class Name | Description | |------------|-------------| | CadConverterHelper | Can be used to make calls to the CAD converter and for updating the USD stage | | CadCoreConverter | CAD Core Converter Extension | | CadRequest | Generic request object. Can be used to retrieve result after completing. | | HoopsExchangeCadConverter | Initialize interface class | | HoopsOptions | Please defer to the hoopsExchangeCADConverterSpec base class for a list of all HoopsOptions converter settings | | hoopsExchangeCADConverterSpec | HoopsExchangeCADConverter Options Class. |
630
omni.kit.converter.cad_core.Functions.md
# omni.kit.converter.cad_core Functions ## Functions Summary: - **get_instance** - If available, returns the weakref pointer - **acquire_interface** - acquire_interface(plugin_name: str = None, library_path: str = None) -> omni.kit.converter.cad_core._hoops_cad_converter.HoopsExchangeCadConverter - **release_interface** - release_interface(arg0: omni.kit.converter.cad_core._hoops_cad_converter.HoopsExchangeCadConverter) -> None
441
omni.kit.converter.cad_core.HoopsExchangeCadConverter.md
# HoopsExchangeCadConverter ## Class: omni.kit.converter.cad_core.HoopsExchangeCadConverter Initialize interface class ### Methods - **__init__(*args, **kwargs)** - **cancel_convert(self)** Cancel CAD file conversion - **convert_file(self, configPath)** Convert file using JSON config file path - **convert_file_with_callback(self, configPath, ...)** Enables asynchronous file conversion when used with convert_file() - **convert_object(self, configObject)** Converts file using JSON config object - **convert_object_with_callback(self, ...)** Enables asynchronous file conversion when used with convert_object() <table> <tbody> <tr class="row-odd"> <td> <p> <code>get_cached_stage_id <td> <p> Retrieves stage id <tr class="row-even"> <td> <p> <code>set_progress_changed_callback <td> <p> Set change in progress <tr class="row-odd"> <td> <p> <code>set_step_changed_callback <td> <p> Set change in step <dl class="py method"> <dt> <code>__init__ <dd> <dl class="py method"> <dt> <code>cancel_convert <dd> <p> Cancel CAD file conversion <dl class="py method"> <dt> <code>convert_file <dd> <p> Convert file using JSON config file path <dl class="py method"> <dt> <code>convert_file_with_callback <dd> ### convert_file_with_callback(self: omni.kit.converter.cad_core._hoops_cad_converter.HoopsExchangeCadConverter, file: str, callback: Callable[[[Tuple[int, str]], None]) -> omni.kit.converter.cad_core.CadRequest  - Enables asynchronous file conversion when used with convert_file() ### convert_object(self: omni.kit.converter.cad_core._hoops_cad_converter.HoopsExchangeCadConverter, configObject: omni.kit.converter.cad_core._hoops_cad_converter.hoopsExchangeCADConverterSpec) -> Tuple[int, str]  - Converts file using JSON config object ### convert_object_with_callback(self: omni.kit.converter.cad_core._hoops_cad_converter.HoopsExchangeCadConverter, configObject: omni.kit.converter.cad_core._hoops_cad_converter.hoopsExchangeCADConverterSpec, callback: Callable[[[Tuple[int, str]], None]) -> Tuple[int, str]  - Converts file using JSON config object with callback ## omni.kit.converter.cad_core.HoopsExchangeCadConverter.convert_object_with_callback - **Description**: Enables asynchronous file conversion when used with convert_object() ## omni.kit.converter.cad_core.HoopsExchangeCadConverter.get_cached_stage_id - **Description**: Retrieves stage id ## omni.kit.converter.cad_core.HoopsExchangeCadConverter.set_progress_changed_callback - **Description**: Set change in progress ## omni.kit.converter.cad_core.HoopsExchangeCadConverter.set_step_changed_callback - **Description**: Set step change callback
2,668
omni.kit.converter.cad_core.hoopsExchangeCADConverterSpec.md
# hoopsExchangeCADConverterSpec  ## Class class omni.kit.converter.cad_core.hoopsExchangeCADConverterSpec  ### Description HoopsExchangeCADConverter Options Class. ### Methods | Method | Description | |--------|-------------| | `__init__(self)` | | ### Attributes | Attribute | Description | |-----------|-------------| | `bAccurateSurfaceCurvatures` | Consider surface curvature to control triangles elongation direction | | `bDedup` | Deduplicate mesh vertices and normals (welds mesh) | | `bGlobalXforms` | When instancing = false, this flag controls whether globalXforms are composited. | | `bInstancing` | If true, enable instancing | | `bMappedMaterials` | | | Key | Description | | --- | ----------- | | bMappedMaterials | Use material mapping or native materials | | bOptimize | Run UJITSO optimization on completed usd files | | bReportProgress | If true then we report import/export progress | | bReportProgressFreq | Progress reporting frequency in Hz. | | bUseCurrentStage | Use currently opened USD. | | bUseMaterials | If true then use specified modes of materials. | | bUseNormals | If true then we pass normals to USD. | | iTessLOD | 0=kA3DTessLODExtraLow, 1=kA3DTessLODLow,2=kA3DTessLODMedium, 3=kA3DTessLODHigh, 4=kA3DTessLODExtraHigh | | sConfigFilePath | Configuration file path | | sFileNameOut | Name of output USD file (the head file only in the case of multiple output files) | | sFilePathIn | Path to input model head file | | sFolderPathOut | Path to output destination folder | | sSettingsFolderPath | Path to material csv and potentially any other settings files | | sUsdSuffix | 'usd', 'usda', 'usdc' | omni.kit.converter.cad_core._hoops_cad_converter.hoopsExchangeCADConverterSpec property bAccurateSurfaceCurvatures Consider surface curvature to control triangles elongation direction Type: (bool) property bDedup Deduplicate mesh vertices and normals (welds mesh) Type: (bool) property bGlobalXforms When instancing = false, this flag controls whether globalXforms are composited. If false local transforms are applied Type: (bool) property bInstancing If true, enable instancing Type: (bool) property bMappedMaterials Use material mapping or native materials Type: (bool) property bOptimize Run UJITSO optimization on completed usd files Type: (bool) property bReportProgress If true then we report import/export progress Type: (bool) property bReportProgressFreq Progress reporting frequency in Hz. Type: (bool) (int) ### bUseCurrentStage property Use currently opened USD. Type: (bool) ### bUseMaterials property If true then use specified modes of materials. if false, then use only basic display colors Type: (bool) ### bUseNormals property If true then we pass normals to USD. if false, then we do not. Type: (bool) ### iTessLOD property 0=kA3DTessLODExtraLow, 1=kA3DTessLODLow,2=kA3DTessLODMedium, 3=kA3DTessLODHigh, 4=kA3DTessLODExtraHigh Type: (int) Tessellation Level of Detail (LOD) presets ### sConfigFilePath property Configuration file path Type: (str) ### sFileNameOut property Name of output USD file (the head file only in the case of multiple output files) Type: (str) ### sFilePathIn property Path to input model head file Type: (str) ### sFolderPathOut property Path to output destination folder Type: (str) ### sSettingsFolderPath property Path to settings folder Type: (str) Path to material csv and potentially any other settings files Type: - (str) sUsdSuffix: - ‘usd’, ‘usda’, ‘usdc’ - Type: (UsdSuffix) - Type: Save file(s) in following formats
3,527
omni.kit.converter.cad_core.HoopsOptions.md
# HoopsOptions ## Class: omni.kit.converter.cad_core.HoopsOptions Bases: - omni.kit.converter.cad_core._hoops_cad_converter.hoopsExchangeCADConverterSpec - omni.kit.converter.common.common.BaseOptions Please defer to the hoopsExchangeCADConverterSpec base class for a list of all HoopsOptions converter settings ### Methods - **__init__()** - Initialize the Hoops Exchange Converter Spec ### Attributes - None listed ### __init__ Initialize the Hoops Exchange Converter Spec
485
omni.kit.converter.cad_core.md
# omni.kit.converter.cad_core ## Classes Summary: - **CadConverterHelper** - Can be used to make calls to the CAD converter and for updating the USD stage - **CadCoreConverter** - CAD Core Converter Extension - **CadRequest** - Generic request object. Can be used to retrieve result after completing. - **HoopsExchangeCadConverter** - Initialize interface class - **HoopsOptions** - Please defer to the hoopsExchangeCADConverterSpec base class for a list of all HoopsOptions converter settings - **hoopsExchangeCADConverterSpec** - HoopsExchangeCADConverter Options Class. ## Functions Summary: - **get_instance** - If available, returns the weakref pointer - **acquire_interface** - acquire_interface(plugin_name: str = None, library_path: str = None) -> omni.kit.converter.cad_core._hoops_cad_converter.HoopsExchangeCadConverter - **release_interface** - release_interface(arg0: omni.kit.converter.cad_core._hoops_cad_converter.HoopsExchangeCadConverter) -> None
986
omni.kit.converter.cad_core_api.md
# omni.kit.converter.cad_core API ## Directory hierarchy - **dir** - **8fa04669143f4cb0** - **_build** - **target-deps** - **hoops_exchange_cad_converter_release** ## Namespace hierarchy  ### Namespace hierarchy  #### Namespace hierarchy  ##### Namespace hierarchy  ###### Namespace hierarchy  - dir - 8fa04669143f4cb0/_build/target-deps/hoops_exchange_cad_converter_release/hoops_exchange_cad_converter - dir - 8fa04669143f4cb0/_build/target-deps/hoops_exchange_cad_converter_release/hoops_exchange_cad_converter/include - dir - 8fa04669143f4cb0/_build/target-deps/hoops_exchange_cad_converter_release/hoops_exchange_cad_converter/include/hoops_reader - file - 8fa04669143f4cb0/_build/target-deps/hoops_exchange_cad_converter_release/hoops_exchange_cad_converter/include/hoops_reader/CADConverterSpec.h ## Namespace hierarchy  - struct - hoopsExchangeCADConverterSpec - struct - hoopsExchangeCADConverterSpecDescription ## API contents  - [Directories](directories.html) - [Files](files.html) - [Structs](structs.html)
1,069
omni.kit.converter.common.BaseOptions.md
# BaseOptions ## BaseOptions ```python class omni.kit.converter.common.BaseOptions ``` A utility for storing and managing JSON data associated with CAD Converter options ### Methods | Method | Description | |--------|-------------| | `as_dict()` | Returns object as a python dictionary | | `from_json(json_dict)` | Parse json and store in the options class | | `json()` | Returns object as a json string | | `write_json(file_path)` | Takes json object and writes out to a file | ```python def __init__(): pass ``` ```python def as_dict(): return dict ``` <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.converter.common.BaseOptions.from_json"> <em class="property"> <span class="pre"> classmethod <span class="w"> <span class="sig-name descname"> <span class="pre"> from_json <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> json_dict <span class="sig-paren"> ) <dd> <p> Parse json and store in the options class <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.converter.common.BaseOptions.json"> <span class="sig-name descname"> <span class="pre"> json <span class="sig-paren"> ( <span class="sig-paren"> ) <dd> <p> Returns object as a json string <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.converter.common.BaseOptions.write_json"> <span class="sig-name descname"> <span class="pre"> write_json <span class="sig-paren"> ( <em class="sig-param"> <span class="n"> <span class="pre"> file_path <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> str <span class="sig-paren"> ) <dd> <p> Takes json object and writes out to a file <dl class="field-list simple"> <dt class="field-odd"> Parameters <dd class="field-odd"> <p> <strong> file_path ( <em> str ) – output file path
2,416
omni.kit.converter.common.Classes.md
# omni.kit.converter.common Classes ## Classes Summary: | Class Name | Description | |------------|-------------| | BaseOptions | A utility for storing and managing JSON data associated with CAD Converter options | | ConverterFilterData | Used to hold information about a CAD Converters supported file types | | ConverterStatus | Represents the conversion status | | ICadCoreExtBase | Base Cad Converter Extension Class | | ICadExtBase | Base Cad Converter Extension Class | | OmniClientWrapper | Helper class based on omni.client library | | OmniUrl | Omniverse Url Helper Class | | UsdSuffix | Enums for USD Suffixes |
622
omni.kit.converter.common.ConverterFilterData.md
# ConverterFilterData ## Class Definition ```python class omni.kit.converter.common.ConverterFilterData(name: str, filter_regexes: List[str], filter_descriptions: List[str]) ``` ### Description Bases: `object` Used to hold information about a CAD Converters supported file types ### Methods - `__init__(name, filter_regexes, filter_descriptions)` ### Attributes - `name`: Name of the CAD Converter and the native application - `filter_regexes`: List of regexes for filtering file types - `filter_descriptions`: List of descriptions for the filter regexes ``` | Key | Description | |--------------------------|------------------------------| | `filter_regexes` | List of the supported file extensions | | `filter_descriptions` | Description of the supported file extensions | ### `__init__(name: str, filter_regexes: List[str], filter_descriptions: List[str]) -> None` - **name**: str - **filter_regexes**: List[str] - **filter_descriptions**: List[str] ### `filter_descriptions`: List[str] - Description of the supported file extensions ### `filter_regexes`: List[str] - List of the supported file extensions ### `name`: str - Name of the CAD Converter and the native application
1,237
omni.kit.converter.common.ConverterStatus.md
# ConverterStatus ## Summary Bases: `NamedTuple` Represents the conversion status ### Methods ### Attributes | Attribute | Description | |-----------|-------------| | `error_code` | Alias for field number 0 | | `error_msg` | Alias for field number 1 | <dl class="py attribute"> <dt class="sig sig-object py" id="omni.kit.converter.common.ConverterStatus.error_code"> <span class="sig-name descname"> <span class="pre"> error_code <em class="property"> <span class="p"> <span class="pre"> : <span class="w"> <span class="pre"> int <a class="headerlink" href="#omni.kit.converter.common.ConverterStatus.error_code" title="Permalink to this definition">  <dd> <p> Alias for field number 0 <dl class="py attribute"> <dt class="sig sig-object py" id="omni.kit.converter.common.ConverterStatus.error_msg"> <span class="sig-name descname"> <span class="pre"> error_msg <em class="property"> <span class="p"> <span class="pre"> : <span class="w"> <span class="pre"> str <a class="headerlink" href="#omni.kit.converter.common.ConverterStatus.error_msg" title="Permalink to this definition">  <dd> <p> Alias for field number 1
1,430
omni.kit.converter.common.Functions.md
# omni.kit.converter.common Functions ## Functions Summary: | Function Name | Description | |---------------|-------------| | initialize_connect_sdk | Initializes the Connect SDK | | is_asset_supported | If the asset is supported by the specified filters. | | run_scene_opt | If the stage was successfully authored then execute the scene optimizer. | | strip_file_regex | Strips the input_path regex from input_path file; else, returns stem | | validate_file_path | Utility to address file picker issue which is returning url-escaped versions of special chars. |
564
omni.kit.converter.common.ICadCoreExtBase.md
# ICadCoreExtBase ## Methods - `get_converter_registry()` - Import and return ConverterRegistry or None if service ext is not loaded - `get_ext_name()` - Return the extension name, ie: omni.kit.converter.hoops_core - `get_ext_path()` - Return the path to the extension - `get_ext_version()` - Return the version of the extension - `get_filters()` - Return list of `ConverterFilterData` ## Attributes - `FILTER_DATA` - (Description not provided in the HTML) <p> <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> OPTIONS_CLS <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> SERVICE_TITLE <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.converter.common.ICadCoreExtBase.__init__"> <span class="sig-name descname"> <span class="pre"> __init__ <em class="sig-param"> <span class="n"> <span class="pre"> self <span class="p"> <span class="pre"> : <span class="w"> <span class="n"> <span class="pre"> omni.ext._extensions.IExt <span class="sig-return"> <span class="sig-return-icon"> → <span class="sig-return-typehint"> <span class="pre"> None <dd> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.converter.common.ICadCoreExtBase.get_converter_registry"> <span class="sig-name descname"> <span class="pre"> get_converter_registry <span class="sig-return"> <span class="sig-return-icon"> → <span class="sig-return-typehint"> <span class="pre"> Optional <span class="p"> <span class="pre"> [ <span class="pre"> ConverterRegistry <span class="p"> <span class="pre"> ] <dd> <p> Import and return ConverterRegistry or None if service ext is not loaded <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.converter.common.ICadCoreExtBase.get_ext_name"> <span class="sig-name descname"> <span class="pre"> get_ext_name <span class="sig-return"> <span class="sig-return-icon"> → <span class="sig-return-typehint"> <span class="pre"> str <dd> <p> Return the extension name, ie: omni.kit.converter.hoops_core <p> Returns: `str` <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.converter.common.ICadCoreExtBase.get_ext_path"> <span class="sig-name descname"> <span class="pre"> get_ext_path <span class="sig-return"> <span class="sig-return-icon"> → <span class="sig-return-typehint"> <span class="pre"> pathlib.Path <dd> <p> Return the path to the extension <p> Returns: `Path` <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.converter.common.ICadCoreExtBase.get_ext_version"> <span class="sig-name descname"> <span class="pre"> get_ext_version <span class="sig-return"> <span class="sig-return-icon"> → <span class="sig-return-typehint"> <span class="pre"> str <dd> <p> Return the version of the extension <p> Returns: `str` <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.converter.common.ICadCoreExtBase.get_filters"> <span class="sig-name descname"> <span class="pre"> get_filters <span class="sig-return"> <span class="sig-return-icon"> → <span class="sig-return-typehint"> <span class="pre"> List <span class="p"> <span class="pre"> [ <span class="pre"> omni.kit.converter.common.common.ConverterFilterData <span class="p"> <span class="pre"> ] <dd> <p> Return list of `ConverterFilterData`
3,341
omni.kit.converter.common.ICadExtBase.md
# ICadExtBase ## ICadExtBase - Bases: `omni.ext._extensions.IExt` - Base Cad Converter Extension Class ### Methods | Method | Description | |--------|-------------| | `__init__(self)` | | | `get_ext_name()` | Return the extension name, ie: omni.kit.converter.hoops | | `get_ext_path()` | Return the path to the extension | | `get_ext_version()` | Return the version of the extension | | `get_filters()` | Return list of `ConverterFilterData` | ### Attributes | Attribute | Description | |-----------|-------------| | `DELEGATE` | | | FILTER_DATA | | --- | __init__(self: omni.ext._extensions.IExt) -> None get_ext_name() -> str Return the extension name, ie: omni.kit.converter.hoops Returns: `str` get_ext_path() -> pathlib.Path Return the path to the extension Returns: `Path` get_ext_version() -> str Return the version of the extension Returns: `str` get_filters() -> List[omni.kit.converter.common.common.ConverterFilterData] Return list of `ConverterFilterData`
977
omni.kit.converter.common.initialize_connect_sdk.md
# initialize_connect_sdk ## initialize_connect_sdk ```python omni.kit.converter.common.initialize_connect_sdk(core_ext_name: str) -> None ``` Initializes the Connect SDK ```
175
omni.kit.converter.common.is_asset_supported.md
# is_asset_supported ## is_asset_supported ```python omni.kit.converter.common.is_asset_supported(path: str, filters: List[str]) -> bool ``` If the asset is supported by the specified filters. ```
198
omni.kit.converter.common.md
# omni.kit.converter.common ## Classes Summary - **BaseOptions** - A utility for storing and managing JSON data associated with CAD Converter options - **ConverterFilterData** - Used to hold information about a CAD Converters supported file types - **ConverterStatus** - Represents the conversion status - **ICadCoreExtBase** - Base Cad Converter Extension Class - **ICadExtBase** - Base Cad Converter Extension Class - **OmniClientWrapper** - Helper class based on omni.client library - **OmniUrl** - Omniverse Url Helper Class - **UsdSuffix** - Enums for USD Suffixes ## Functions Summary - **initialize_connect_sdk** - Initializes the Connect SDK - **is_asset_supported** - If the asset is supported by the specified filters. - **run_scene_opt** - (Function description not provided in the HTML snippet) | | | | --- | --- | | | If the stage was successfully authored then execute the scene optimizer. | | | Strips the input_path regex from input_path file; else, returns stem | | | Utility to address file picker issue which is returning url-escaped versions of special chars. |
1,112
omni.kit.converter.common.OmniClientWrapper.md
# OmniClientWrapper ## OmniClientWrapper - **Bases:** `object` - **Description:** Helper class based on omni.client library ### Methods | Method | Description | |--------|-------------| | `copy(src_path, dest_path)` | Asynchronously copy an item from src_url to dst_url and wait for the result | | `copy_sync(src_path, dest_path)` | Copy an item from src_url to dst_url and wait for the result | | `create_folder(path)` | Asynchronously create a folder | | `create_folder_sync(path)` | Create a folder | | `exists(path)` | Asynchronously Retrieve information about a single item | | `exists_sync(path)` | Retrieve information about a single item and wait for the result | | Method | Description | | ------ | ----------- | | `read` (src_path) | Asynchronously read a file | | `write` (path, content) | Asynchronously write a file | ### `__init__` ### `copy` ```python async static copy(src_path: str, dest_path: str) ``` Asynchronously copy an item from src_url to dst_url and wait for the result **Parameters:** - **src_path** – input file to copy - **dest_path** – destination path to copy to **Returns:** - true if successfully copied to destination **Return type:** - boolean ### `copy_sync` ```python static copy_sync(src_path: str, dest_path: str) ``` Copy an item from src_url to dst_url and wait for the result **Parameters:** - **src_path** – input file to copy - **dest_path** – destination path to copy to **Returns:** - true if successfully copied to destination **Return type:** - boolean ### `create_folder` ```python async static create_folder(path) ``` Asynchronously create a folder ### `create_folder_sync` ```python static create_folder_sync(path) <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.converter.common.OmniClientWrapper.create_folder_sync"> <span class="pre">create_folder_sync <span class="sig-paren">( <em class="sig-param"> <span class="n"> <span class="pre">path <span class="sig-paren">) <dd> <p>Create a folder <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.converter.common.OmniClientWrapper.exists"> <em class="property"> <span class="pre">async <span class="w"> <span class="pre">static <span class="w"> <span class="sig-name descname"> <span class="pre">exists <span class="sig-paren">( <em class="sig-param"> <span class="n"> <span class="pre">path <span class="sig-paren">) <dd> <p>Asynchronously Retrieve information about a single item <dl class="field-list simple"> <dt class="field-odd">Parameters <dd class="field-odd"> <p><strong>path <dt class="field-even">Returns <dd class="field-even"> <p>true if the result is OK <dt class="field-odd">Return type <dd class="field-odd"> <p>boolean <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.converter.common.OmniClientWrapper.exists_sync"> <em class="property"> <span class="pre">static <span class="w"> <span class="sig-name descname"> <span class="pre">exists_sync <span class="sig-paren">( <em class="sig-param"> <span class="n"> <span class="pre">path <span class="sig-paren">) <dd> <p>Retrieve information about a single item and wait for the result <dl class="field-list simple"> <dt class="field-odd">Parameters <dd class="field-odd"> <p><strong>path <dt class="field-even">Returns <dd class="field-even"> <p>true if the result is OK <dt class="field-odd">Return type <dd class="field-odd"> <p>boolean <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.converter.common.OmniClientWrapper.read"> <em class="property"> <span class="pre">async <span class="w"> <span class="pre">static <span class="w"> <span class="sig-name descname"> <span class="pre">read <span class="sig-paren">( <em class="sig-param"> <span class="n"> <span class="pre">src_path <span class="p"> <span class="pre">: <span class="w"> <span class="n"> <span class="pre">str <span class="sig-paren">) <dd> <p>Asynchronously read a file <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.converter.common.OmniClientWrapper.write"> <em class="property"> <span class="pre">async <span class="w"> <span class="pre">static <span class="w"> <span class="sig-name descname"> <span class="pre">write <span class="sig-paren">( <em class="sig-param"> <span class="n"> <span class="pre">path <span class="p"> <span class="pre">: <span class="w"> <span class="n"> <span class="pre">str , <em class="sig-param"> <span class="n"> <span class="pre">content <span class="sig-paren">) <dd> <p>Asynchronously write a file <dl class="field-list simple"> <dt class="field-odd">Parameters <dd class="field-odd"> <p><strong>path <dt class="field-even">Returns <dd class="field-even"> <p>true if file was written successfully <dt class="field-odd">Return type <dd class="field-odd"> <p>boolean
5,582
omni.kit.converter.common.OmniUrl.md
# OmniUrl ## OmniUrl ``` class omni.kit.converter.common.OmniUrl(url: Union[str, pathlib.Path], list_entry=None) ``` **Bases:** `object` **Omniverse Url Helper Class** ### Methods | Method | Description | |--------|-------------| | `__init__(url[, list_entry])` | Returns url as a OmniUrl() | | `get_local_file()` | Returns: Path() object for local file | | `get_local_file_async()` | Returns: Path() object for local file | | `sync_stat()` | Returns the status of the url | ``` | Attribute | Description | |-----------|-------------| | `url_with_name(name)` | Return a new url with the url path final component changed. | | `url_with_path(path)` | Return a new url with the path changed. | | `url_with_suffix(suffix)` | Return a url with the file full suffix changed. | | `exists` | True if exists; else False | | `full_suffix` | Return path suffix(s) if any. | | `name` | The final path component, if any. | | `parent_url` | OmniUrl object | | `path` | Returns the path | | `scheme` | | | `stat` | Status of the url | | `stem` | The final path component, minus its suffix(s). | | `suffix` | The final component's last suffix, if any. | | `writeable` | Checks if the url path is writeable | ### `__init__(url: Union[str, pathlib.Path], list_entry)` ## Methods ### `__init__(self)` - Returns url as a OmniUrl() ### `get_local_file()` - Returns: Path() object for local file ### `get_local_file_async()` - Returns: Path() object for local file ### `sync_stat()` - Returns the status of the url ### `url_with_name(name: str)` - Return a new url with the url path final component changed. ### `url_with_path(path: pathlib.Path)` - Return a new url with the path changed. ### `url_with_suffix(suffix: str)` - Return a url with the file full suffix changed. If the url path has no suffix, add given suffix. If the given suffix is an empty string, remove the suffix from the url path. ### `exists` - (Property) ### OmniUrl Properties #### exists True if exists; else False - **Type**: Returns #### full_suffix Return path suffix(s) if any. This includes the leading period. For example: ‘.skelanim.usd’ #### name The final path component, if any. #### parent_url OmniUrl object - **Type**: Returns #### path Returns the path #### stat Status of the url #### stem The final path component, minus its suffix(s). #### suffix The final component’s last suffix, if any. This includes the leading period. For example: ‘.txt’ #### writeable Checks if the url path is writeable
2,490
omni.kit.converter.common.run_scene_opt.md
# run_scene_opt ## run_scene_opt ```python omni.kit.converter.common.run_scene_opt(output_path: str, bOptimize: bool, bConvertHidden: bool) ``` If the stage was successfully authored then execute the scene optimizer. ```
222
omni.kit.converter.common.strip_file_regex.md
# strip_file_regex ## strip_file_regex ```python omni.kit.converter.common.strip_file_regex(input_path: pathlib.Path, file_regex_patterns) -> str ``` **Description:** Strips the input_path regex from input_path file; else, returns stem **Parameters:** - **input_path** (Path) – input file path - **file_regex_patterns** – regex patterns to strip from input_path **Returns:** - name of file without suffix **Return type:** - str ```
436
omni.kit.converter.common.UsdSuffix.md
# UsdSuffix ## Attributes - **USD** - USD (Universal Scene Description) file format - **USDC** - USD Crate File Format - **USDA** - USDA are human-readable and editable USD files ## USDA USDA are human-readable and editable USD files ## USDC USD Crate File Format
272
omni.kit.converter.common.validate_file_path.md
# validate_file_path ## validate_file_path ```python omni.kit.converter.common.validate_file_path(file_path: str) -> Optional[str] ``` Utility to address file picker issue which is returning url-escaped versions of special chars. If a raw path and path does not exist, returns the escaped file path if it exists, otherwise returns None. ```
341
omni.kit.converter.dgn.Classes.md
# omni.kit.converter.dgn Classes ## Classes Summary: | Class Name | Description | |------------|-------------| | [DgnConverter](omni.kit.converter.dgn/omni.kit.converter.dgn.DgnConverter.html) | Base Cad Converter Extension Class | | [DgnConverterDelegate](omni.kit.converter.dgn/omni.kit.converter.dgn.DgnConverterDelegate.html) | AbstractImporterDelegate is abstract class for extending |
392