file_path
stringlengths
5
148
content
stringlengths
0
526k
omni.kit.undo.history.Classes.md
# omni.kit.undo.history Classes ## Classes Summary: | Class | Description | |-------|-------------| | [HistoryEntry](omni.kit.undo.history/omni.kit.undo.history.HistoryEntry.html) | HistoryEntry(name, kwargs, level, error) | | [OrderedDict](omni.kit.undo.history/omni.kit.undo.history.OrderedDict.html) | Dictionary that remembers insertion order | | [islice](omni.kit.undo.history/omni.kit.undo.history.islice.html) | islice(iterable, stop) –> islice object |
omni.kit.undo.history.Functions.md
# omni.kit.undo.history Functions ## Functions Summary: | Function | Description | |----------|-------------| | add_history | Add a **Command** execution to the history. | | change_history | Update the history entry for **key**. | | clear_history | Clear **Command** execution history. | | get_history | Get **Command** execution history. | | get_history_item | | | lru_cache | Least-recently-used cache decorator. | | namedtuple | Returns a new subclass of tuple with named fields. |
omni.kit.undo.history.get_history.md
# get_history ## get_history ``` ```python omni.kit.undo.history.get_history() ``` Get **Command** execution history. Returns a list of tuples: HistoryEntry(Command name, Arguments, Groupping level, Error status).
omni.kit.undo.history.get_history_item.md
# get_history_item ## get_history_item
omni.kit.undo.history.HistoryEntry.md
# HistoryEntry ## Attributes - **error** - Alias for field number 3 - **kwargs** - Alias for field number 1 - **level** - Alias for field number 2 - **name** - Alias for field number 0 ### Alias for field number 3 ### Alias for field number 1 ### Alias for field number 2 ### Alias for field number 0
omni.kit.undo.history.islice.md
# islice ## islice ```python class omni.kit.undo.history.islice ``` ### Description islice(iterable, stop) –> islice object islice(iterable, start, stop[, step]) –> islice object Return an iterator whose next() method returns selected values from an iterable. If start is specified, will skip all preceding elements; otherwise, start defaults to zero. Step defaults to one. If specified as another value, step determines how many values are skipped between successive calls. Works like a slice() on a list but returns an iterator. ### Methods ```python __init__() ``` ```
omni.kit.undo.history.md
# omni.kit.undo.history ## Classes Summary: | Class | Description | |-------|-------------| | [HistoryEntry](omni.kit.undo.history/omni.kit.undo.history.HistoryEntry.html) | HistoryEntry(name, kwargs, level, error) | | [OrderedDict](omni.kit.undo.history/omni.kit.undo.history.OrderedDict.html) | Dictionary that remembers insertion order | | [islice](omni.kit.undo.history/omni.kit.undo.history.islice.html) | islice(iterable, stop) –> islice object | ## Functions Summary: | Function | Description | |----------|-------------| | [add_history](omni.kit.undo.history/omni.kit.undo.history.add_history.html) | Add a **Command** execution to the history. | | [change_history](omni.kit.undo.history/omni.kit.undo.history.change_history.html) | Update the history entry for **key**. | | [clear_history](omni.kit.undo.history/omni.kit.undo.history.clear_history.html) | Clear **Command** execution history. | | [get_history](omni.kit.undo.history/omni.kit.undo.history.get_history.html) | Get **Command** execution history. | | [get_history_item](omni.kit.undo.history/omni.kit.undo.history.get_history_item.html) | | | [lru_cache](omni.kit.undo.history/omni.kit.undo.history.lru_cache.html) | Least-recently-used cache decorator. | | [namedtuple](omni.kit.undo.history/omni.kit.undo.history.namedtuple.html) | Returns a new subclass of tuple with named fields. | jQuery(function () { SphinxRtdTheme.Navigation.enable(true); });
omni.kit.undo.history.namedtuple.md
# namedtuple ## namedtuple ```python omni.kit.undo.history.namedtuple(typename, field_names, *, rename=False, defaults=None, module=None) ``` Returns a new subclass of tuple with named fields. ```python >>> Point = namedtuple('Point', ['x', 'y']) >>> Point.__doc__ # docstring for the new class 'Point(x, y)' >>> p = Point(11, y=22) # instantiate with positional args or keywords >>> p[0] + p[1] # indexable like a plain tuple 33 >>> x, y = p # unpack like a regular tuple >>> x, y (11, 22) >>> p.x + p.y # fields also accessible by name 33 >>> d = p._asdict() # convert to a dictionary >>> d['x'] ``` 11 >>> Point(**d) # convert from a dictionary Point(x=11, y=22) >>> p._replace(x=100) # _replace() is like str.replace() but targets named fields Point(x=100, y=22)
omni.kit.undo.history.OrderedDict.md
# OrderedDict ## Methods - `__init__(*args, **kwargs)` - `clear()` - `copy()` - `fromkeys([value])` - Create a new ordered dictionary with keys from iterable and values set to value. - `items()` - `keys()` - `move_to_end()` <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> move_to_end </span> </code> (key[, last]) Move an existing element to the end (or beginning if last is false). <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> pop </span> </code> (key[,default]) If the key is not found, return the default if given; otherwise, raise a KeyError. <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> popitem </span> </code> ([last]) Remove and return a (key, value) pair from the dictionary. <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> setdefault </span> </code> (key[, default]) Insert key with a value of default if key is not in the dictionary. <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> update </span> </code> ([E, ]**F) If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k] <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> values </span> </code> () <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.undo.history.OrderedDict.__init__"> <span class="sig-name descname"> <span class="pre"> __init__ </span> </span> <span class="sig-paren"> ( </span> <em class="sig-param"> <span class="o"> <span class="pre"> * </span> </span> <span class="n"> <span class="pre"> args </span> </span> </em> , <em class="sig-param"> <span class="o"> <span class="pre"> ** </span> </span> <span class="n"> <span class="pre"> kwargs </span> </span> </em> <span class="sig-paren"> ) </span> </dt> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.undo.history.OrderedDict.clear"> <span class="sig-name descname"> <span class="pre"> clear </span> </span> <span class="sig-paren"> ( </span> <span class="sig-paren"> ) </span> <span class="sig-return"> <span class="sig-return-icon"> → </span> <span class="sig-return-typehint"> <span class="pre"> None. </span> <span class="pre"> Remove </span> <span class="pre"> all </span> <span class="pre"> items </span> <span class="pre"> from </span> <span class="pre"> od. </span> </span> </span> </dt> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.undo.history.OrderedDict.copy"> <span class="sig-name descname"> <span class="pre"> copy </span> </span> <span class="sig-paren"> ( </span> <span class="sig-paren"> ) </span> <span class="sig-return"> <span class="sig-return-icon"> → </span> <span class="sig-return-typehint"> <span class="pre"> a </span> <span class="pre"> shallow </span> <span class="pre"> copy </span> <span class="pre"> of </span> <span class="pre"> od </span> </span> </span> </dt> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.undo.history.OrderedDict.fromkeys"> <span class="sig-name descname"> <span class="pre"> fromkeys </span> </span> <span class="sig-paren"> ( </span> <em class="sig-param"> <span class="n"> <span class="pre"> value </span> </span> <span class="o"> <span class="pre"> = </span> </span> <span class="default_value"> <span class="pre"> None </span> </span> </em> <span class="sig-paren"> ) </span> </dt> <dd> <p> Create a new ordered dictionary with keys from iterable and values set to value. </p> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.undo.history.OrderedDict.items"> <span class="sig-name descname"> <span class="pre"> items </span> </span> <span class="sig-paren"> ( </span> <span class="sig-paren"> ) </span> <span class="sig-return"> <span class="sig-return-icon"> → </span> <span class="sig-return-typehint"> <span class="pre"> a </span> <span class="pre"> set-like </span> <span class="pre"> object </span> <span class="pre"> providing </span> </span> </span> </dt> </dl> ### items - **Description**: Provides a view on D's items. ### keys - **Description**: Provides a set-like object providing a view on D's keys. ### move_to_end - **Parameters**: - `key` - `last = True` - **Description**: Move an existing element to the end (or beginning if last is false). Raise KeyError if the element does not exist. ### pop - **Parameters**: - `key` - `default` (optional) - **Description**: If the key is not found, return the default if given; otherwise, raise a KeyError. ### popitem - **Parameters**: - `last = True` - **Description**: Remove and return a (key, value) pair from the dictionary. Pairs are returned in LIFO order if last is true or FIFO order if false. ### setdefault - **Parameters**: - `key` - `default = None` - **Description**: Insert key with a value of default if key is not in the dictionary. Return the value for key if key is in the dictionary, else default. ### update - **Parameters**: - `E` (optional) - `**F` - **Description**: Update the dictionary with the key/value pairs from E and F, overwriting existing keys. ### Update D from dict/iterable E and F. If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k] ### values () → an object providing a view on D's values
omni.kit.undo.md
# omni.kit.undo ## Submodules Summary: - [omni.kit.undo.history](omni.kit.undo.history.html) - No submodule docstring provided ## Functions Summary: - [begin_disabled](omni.kit.undo/omni.kit.undo.begin_disabled.html) - Begin preventing **Commands** being added to the undo stack. - [begin_group](omni.kit.undo/omni.kit.undo.begin_group.html) - Begin group of **Commands**. - [can_redo](omni.kit.undo/omni.kit.undo.can_redo.html) - [can_repeat](omni.kit.undo/omni.kit.undo.can_repeat.html) - [can_undo](omni.kit.undo/omni.kit.undo.can_undo.html) - [clear_history](omni.kit.undo/omni.kit.undo.clear_history.html) - Clear **Command** execution history. - [clear_stack](omni.kit.undo/omni.kit.undo.clear_stack.html) - [disabled](omni.kit.undo/omni.kit.undo.disabled.html) - Prevent commands being added to the undo stack. - [end_disabled](omni.kit.undo/omni.kit.undo.end_disabled.html) - Stop preventing **Commands** being added to the undo stack. - [end_group](omni.kit.undo/omni.kit.undo.end_group.html) - End group of **Commands**. - [execute](omni.kit.undo/omni.kit.undo.execute.html) - [format_exception](omni.kit.undo/omni.kit.undo.format_exception.html) ## Table of Contents ### Functions - **format_exception** - Pretty format exception. Include exception info, call stack of exception itself and this function callstack. - **get_history** - Get **Command** execution history. - **get_redo_stack** - (No description provided) - **get_undo_stack** - (No description provided) - **group** - Group multiple commands in one. - **redo** - (No description provided) - **register_undo_commands** - (No description provided) - **repeat** - (No description provided) - **subscribe_on_change** - (No description provided) - **subscribe_on_change_detailed** - (No description provided) - **undo** - (No description provided) - **unsubscribe_on_change** - (No description provided) - **unsubscribe_on_change_detailed** - (No description provided)
omni.kit.undo.redo.md
# redo ## redo ```
omni.kit.undo.register_undo_commands.md
# register_undo_commands  ## register_undo_commands 
omni.kit.undo.repeat.md
# repeat ## repeat ```
omni.kit.undo.Submodules.md
# omni.kit.undo Submodules ## Submodules Summary - **omni.kit.undo.history** - No submodule docstring provided
omni.kit.undo.subscribe_on_change.md
# subscribe_on_change ## subscribe_on_change
omni.kit.undo.subscribe_on_change_detailed.md
# subscribe_on_change_detailed ## subscribe_on_change_detailed `omni.kit.undo.subscribe_on_change_detailed(on_change)`
omni.kit.undo.undo.md
# undo ## undo ```python omni.kit.undo.undo() ``` ```
omni.kit.undo.unsubscribe_on_change.md
# unsubscribe_on_change ## unsubscribe_on_change
omni.kit.undo.unsubscribe_on_change_detailed.md
# unsubscribe_on_change_detailed ## unsubscribe_on_change_detailed
omni.kit.usd.collect.Collector.md
# Collector ## Class Definition ```python class omni.kit.usd.collect.Collector(usd_path: str, collect_dir: str, usd_only: bool = False, flat_collection: bool = False, material_only: bool = False, failure_options=CollectorFailureOptions.SILENT, skip_existing: bool = False) ``` ## Description The Collector class is used to collect assets from a specified USD path into a directory, optionally filtering by USD-only, flat collection, material-only, and handling failures silently. It also allows skipping existing files. max_concurrent_tasks = 32 texture_option = FlatCollectionTextureOptions.BY_MDL force_non_read_only = True exclusion_rules = {} default_prim_only = False **kwargs Bases: object Collector provides API to collect USD file with its dependencies that are scattered around different places. ### Methods | Method | Description | |--------|-------------| | `__init__` (usd_path, collect_dir[, usd_only, ...]) | Constructor. | | `add_copy_task` (source, target[, skip_if_existed]) | Internal. | | `add_write_task` (target, content) | Internal. | | `cancel` () | Cancel the collector if it's in progress. | | `collect` ([progress_callback, finish_callback]) | Collects stage in an asynchronous way. | | `destroy` () | Destructor to release all resources. | | `get_source_target_url_mapping` () | Gets the mapping of all source files to target files. | | `get_status` () | Gets the collector status. | | `get_target_url` (source_url) | Gets the target url that the source url is collected to. | | `is_cancelled` () | Collector is cancelled or not. | | Attribute | Description | |-----------|-------------| | `is_copy_skipped` | Checkes if it skips copying source_url during collection. | | `is_finished` | Collect is done or not. | | `open_or_create_layer(layer_path[, clear])` | Deprecated. | | `wait_all_unfinished_tasks([all_completed])` | Internal. | ### Attributes | Attribute | Description | |-----------|-------------| | `collect_mapping_file_url` | The mapping file path. | | `source_stage_url` | The source url to be collected. | | `target_folder` | The target folder to collect assets into. | ### omni.kit.usd.collect.Collector.__init__ ```python __init__(usd_path: str, collect_dir: str, usd_only: bool = False, flat_collection: bool = False, material_only: bool = False, failure_options = CollectorFailureOptions.SILENT, skip_existing: bool) ``` | Parameter | Type | Default | |-----------|------|---------| | `usd_path` | str | None | | `collect_dir` | str | None | | `usd_only` | bool | False | | `flat_collection` | bool | False | | `material_only` | bool | False | | `failure_options` | CollectorFailureOptions | CollectorFailureOptions.SILENT | | `skip_existing` | bool | None | ``` Constructor. Parameters: - **usd_path** (str) – The usd stage to be collected. - **collect_dir** (str) – The target folder to collect the usd stage to. - **usd_only** (bool, Optional) – Collects usd files only or not. If it’s True, it will ignore all asset types except USD files. Default is False. - **flat_collection** (bool, Optional) – Collects stage without keeping the original dir structure. Default is False. - **material_only** (bool, Optional) – Collects material and textures only or not. If it’s True, it will ignore all other asset types. Default is False. If both `usd_only` and `material_only` are true, it will collect all asset types. - **skip_existing** (bool, Optional) – If files already exist in the target location, don’t copy them again. Default is False. - **max_concurrent_tasks** (int, Optional) – The maximum concurrent tasks to run at the same time. Default is 32. - **texture_option** (FlatCollectionTextureOptions, Optional) – Specifies how textures are grouped in flat collection mode. This is to avoid name collision which results in textures overwriting each other in the cases where textures for different assets are not uniquely named. - **force_non_read_only** (bool, Optional) – If it’s true and source file copied is read-only, it will set the target file writable. By default, it’s true, which means to make all copied files writable. For USD and MDL files, they will always be writable after copy as it needs to be modified during collecting. - **exclusion_rules** (Dict[str, str], Optional) – Collector will collect and re-map all dependencies if no exclusion rules are given. It allows you to specify the rules to exclude specified URLs so they won’t be collected, and provide options to map them to new locations. Here is an example. ```python { "s3://test-path/": "/mount/test-path/", } ``` { "s3://test-path/": None, "s3://another-path/": None } Here, it defines two rules to exclude the urls prefixed by the key. The first rule will map those URLs prefixed with “s3://test-path/” into location “/mount/test-path/”, and the second one will keep those URLs untouched in the collected file. - **default_prim_only** (bool, Optional) – If it’s True, it will only collect the assets under the default prim, and only save default prim in the main usd file. By default, it’s false, which means to collect all the assets. See DefaultPrimOnlyOptions for more customizations. - **default_prim_option** (DefaultPrimOnlyOptions, Optional) – Specifies how to collect default prims when default_prim_only is True. This option can be used to skip collecting assets that are not used in the stage composition. By default, it only collects default prim for root layer. REMINDER: When the option is to collect default prim only for all layers, it’s likely that non-default prims in a layer are referenced in any layers and they are removed which causes invalid references. - **convert_usda_to_usdc** (bool, Optional) – If it’s True, it will convert ascii USD files (.usda) to binary format (.usdc). By default, it is False and keeps the original format for all USD files. ### async add_copy_task(source: str, target: str, skip_if_existed=False) Internal. Adds a copy task that copies file from source to target. **Parameters:** - **source** (str) – The source url to copy. - **target** (str) – The target url to copy source url into. - **skip_if_existed** (bool, Optional) – If it should skip copy when the target file exists already. ### async add_write_task(target: str, content: Union[str, bytes]) Internal. Adds a write task that writes target file. ### Parameters - **target** (`str`) – The target url to write. - **content** – (`Union[str, bytes]`): The content to write. It could be str, or bytes. ### cancel() - Cancel the collector if it’s in progress. ### collect(progress_callback: Optional[Callable[[int, int], None] = None], finish_callback: Optional[Callable[[], None] = None]) -> Tuple[bool, str] - Collects stage in an asynchronous way. - **progress_callback** (`Callable[[int, int], None]`) – The progress callback that notifies the current progress in (current_step, total_steps) style. - **finish_callback** (`Callable[[], None]`) – Finish callback when task is done or cancelled. - Returns: The success status and the path of the collected stage root if it exists. ### destroy Destructor to release all resources. ### get_source_target_url_mapping Gets the mapping of all source files to target files. It returns valid value when collect task is done. See `get_status()` to query collector status. #### Returns A dict that key is the source url of files, and value is the target url of files. #### Return type Dict[str, str] ### get_status Gets the collector status. See `CollectorStatus` for more details. #### Returns The current status of the collector. #### Return type CollectorStatus ### get_target_url Gets the target url that the source url is collected to. It returns valid value when collect task is done. See `get_status()` to query collector status. #### Parameters - **source_url** (str) – The source url to query. #### Returns The corresponding target url that the source url has been collected to. #### Return type str ### is_cancelled Collector is cancelled or not. REMINDER: This function is DEPRECATED. See `get_status()` for more accurate status. #### Returns ### Collection Methods #### is_copy_skipped ```python is_copy_skipped(source_url) -> bool ``` Checkes if it skips copying `source_url` during collection. It returns valid value when collect task is done. See `get_status()` to query collector status. - **Returns**: Successful or not. - **Return type**: bool #### is_finished ```python is_finished() -> bool ``` Collect is done or not. It returns True no matter it’s cancelled or successfully done. REMINDER: This function is DEPRECATED. See `get_status()` for more accurate status. - **Returns**: Collection is finished or not. - **Return type**: bool #### open_or_create_layer ```python async open_or_create_layer(layer_path, clear=True) -> None ``` Deprecated. #### wait_all_unfinished_tasks ```python async wait_all_unfinished_tasks(all_completed=False) -> None ``` Internal. ### Properties #### collect_mapping_file_url ```python property collect_mapping_file_url -> str ``` The mapping file path. Mapping file records the collection history of this collector. It can help avoiding duplication in collection if the target file exists and is not changed. #### source_stage_url ```python property source_stage_url : str ``` The source url to be collected. #### target_folder ```python property target_folder : str ``` The target folder to collect assets into.
omni.kit.usd.collect.CollectorException.md
# CollectorException ## CollectorException ``` class omni.kit.usd.collect.CollectorException(error: str) ``` **Bases:** `Exception` General collector exception. See [CollectorFailureOptions](#) for options to customize exception behaviors. ``` def __init__(error: str) ``` ```
omni.kit.usd.collect.CollectorFailureOptions.md
# CollectorFailureOptions ## CollectorFailureOptions ```python class omni.kit.usd.collect.CollectorFailureOptions(value) ``` Bases: `IntFlag` Options to customize failure options for collector. ### Attributes | Attribute | Description | |-----------|-------------| | `SILENT` | Silent for all failures except root USD. | | `EXTERNAL_USD_REFERENCES` | Throws exception if any external USD file is not found. | | `OTHER_EXTERNAL_REFERENCES` | Throws exception if external references other than all above are missing. | ```python def __init__(self): pass ``` ```python EXTERNAL_USD_REFERENCES = 1 ``` ``` <dl class="py attribute"> <dt class="sig sig-object py" id="omni.kit.usd.collect.CollectorFailureOptions.ALL_EXTERNAL_REFERENCES"> <span class="sig-name descname"> <span class="pre"> ALL_EXTERNAL_REFERENCES </span> </span> <em class="property"> <span class="w"> </span> <span class="p"> <span class="pre"> = </span> </span> <span class="w"> </span> <span class="pre"> 1 </span> </em> </dt> <dd> <p> Throws exception if any external USD file is not found. </p> </dd> </dl> <dl class="py attribute"> <dt class="sig sig-object py" id="omni.kit.usd.collect.CollectorFailureOptions.OTHER_EXTERNAL_REFERENCES"> <span class="sig-name descname"> <span class="pre"> OTHER_EXTERNAL_REFERENCES </span> </span> <em class="property"> <span class="w"> </span> <span class="p"> <span class="pre"> = </span> </span> <span class="w"> </span> <span class="pre"> 4 </span> </em> </dt> <dd> <p> Throws exception if external references other than all above are missing. </p> </dd> </dl> <dl class="py attribute"> <dt class="sig sig-object py" id="omni.kit.usd.collect.CollectorFailureOptions.SILENT"> <span class="sig-name descname"> <span class="pre"> SILENT </span> </span> <em class="property"> <span class="w"> </span> <span class="p"> <span class="pre"> = </span> </span> <span class="w"> </span> <span class="pre"> 0 </span> </em> </dt> <dd> <p> Silent for all failures except root USD. </p> </dd> </dl>
omni.kit.usd.collect.CollectorStatus.md
# CollectorStatus ## CollectorStatus ```python class omni.kit.usd.collect.CollectorStatus(value) ``` Bases: `Enum` Collector status. ### Attributes | Attribute | Description | |-----------|-------------| | `NOT_STARTED` | Collection is not started yet. | | `IN_PROGRESS` | Collection is in progress. | | `FINISHED` | Collection is sucessfully done. | | `CANCELLED` | Collection is cancelled. | ```python def __init__(self): pass ``` ```python CANCELLED = ... ``` <dl class="py attribute"> <dt class="sig sig-object py" id="omni.kit.usd.collect.CollectorStatus.CANCELLED"> <span class="sig-name descname"> <span class="pre"> CANCELLED </span> </span> <em class="property"> <span class="w"> </span> <span class="p"> <span class="pre"> = </span> </span> <span class="w"> </span> <span class="pre"> 3 </span> </em> <dt> <dd> <p> Collection is cancelled. </p> </dd> </dt> </dl> <dl class="py attribute"> <dt class="sig sig-object py" id="omni.kit.usd.collect.CollectorStatus.FINISHED"> <span class="sig-name descname"> <span class="pre"> FINISHED </span> </span> <em class="property"> <span class="w"> </span> <span class="p"> <span class="pre"> = </span> </span> <span class="w"> </span> <span class="pre"> 2 </span> </em> <dt> <dd> <p> Collection is sucessfully done. </p> </dd> </dt> </dl> <dl class="py attribute"> <dt class="sig sig-object py" id="omni.kit.usd.collect.CollectorStatus.IN_PROGRESS"> <span class="sig-name descname"> <span class="pre"> IN_PROGRESS </span> </span> <em class="property"> <span class="w"> </span> <span class="p"> <span class="pre"> = </span> </span> <span class="w"> </span> <span class="pre"> 1 </span> </em> <dt> <dd> <p> Collection is in progress. </p> </dd> </dt> </dl> <dl class="py attribute"> <dt class="sig sig-object py" id="omni.kit.usd.collect.CollectorStatus.NOT_STARTED"> <span class="sig-name descname"> <span class="pre"> NOT_STARTED </span> </span> <em class="property"> <span class="w"> </span> <span class="p"> <span class="pre"> = </span> </span> <span class="w"> </span> <span class="pre"> 0 </span> </em> <dt> <dd> <p> Collection is not started yet. </p> </dd> </dt> </dl> </dd> </dl> </section> </div> </div> <footer> <hr/> </footer> </div> </div> </section> </div>
omni.kit.usd.collect.CollectorTaskType.md
# CollectorTaskType ## CollectorTaskType ```python class omni.kit.usd.collect.CollectorTaskType(value) ``` Bases: `Enum` Internal. Task type of collector. ### Attributes | Attribute | Description | |-----------------|-----------------------------------------------------------------------------| | `READ_TASK` | Read task that reads content of a file. | | `WRITE_TASK` | Write task that writes content to a target file. | | `COPY_TASK` | Copy task that copies a file to a target location. | | `RESOLVE_TASK` | Resolve task that re-maps external references in a USD layer to new locations. | ### `__init__` ```python __init__() ``` ``` ### COPY_TASK Copy task that copies a file to a target location. ### READ_TASK Read task that reads content of a file. ### RESOLVE_TASK Resolve task that re-maps external references in a USD layer to new locations. ### WRITE_TASK Write task that writes content to a target file.
omni.kit.usd.collect.DefaultPrimOnlyOptions.md
# DefaultPrimOnlyOptions ## DefaultPrimOnlyOptions ```python class omni.kit.usd.collect.DefaultPrimOnlyOptions(value) ``` Bases: `Enum` Options for collecting USD with 'default prim only' mode. ### Attributes | Attribute | Description | |-----------|-------------| | `ROOT_LAYER_ONLY` | Collects default prim only for root layer. | | `ALL_LAYERS` | Collects default prim only for all layers. | ### `__init__` ```python def __init__() ``` ### `ALL_LAYERS` ```python ALL_LAYERS = 1 ``` Collects default prim only for all layers. ### `ROOT_LAYER_ONLY` ```python ROOT_LAYER_ONLY = 0 ``` Collects default prim only for root layer. ## 定义标题 ### DefaultPrimOnlyOptions.ROOT_LAYER_ONLY Collects default prim only for root layer.
omni.kit.usd.collect.FlatCollectionTextureOptions.md
# FlatCollectionTextureOptions ## FlatCollectionTextureOptions ```python class omni.kit.usd.collect.FlatCollectionTextureOptions(value) ``` Bases: `Enum` Collection options for textures under ‘Flat Collection’ mode. ### Attributes | Attribute | Description | |-----------|-------------| | `BY_MDL` | Groups textures by MDL. | | `BY_USD` | Groups textures by USD. | | `FLAT` | All textures will be under the same hierarchy, flat. | ```python def __init__(self): pass ``` ```python BY_MDL = 0 ``` Groups textures by MDL. <dl class="py attribute"> <dt class="sig sig-object py" id="omni.kit.usd.collect.FlatCollectionTextureOptions.BY_USD"> <span class="sig-name descname"> <span class="pre"> BY_USD </span> </span> <em class="property"> <span class="w"> </span> <span class="p"> <span class="pre"> = </span> </span> <span class="w"> </span> <span class="pre"> 1 </span> </em> </dt> <dd> <p> Groups textures by USD. </p> </dd> </dl> <dl class="py attribute"> <dt class="sig sig-object py" id="omni.kit.usd.collect.FlatCollectionTextureOptions.FLAT"> <span class="sig-name descname"> <span class="pre"> FLAT </span> </span> <em class="property"> <span class="w"> </span> <span class="p"> <span class="pre"> = </span> </span> <span class="w"> </span> <span class="pre"> 2 </span> </em> </dt> <dd> <p> All textures will be under the same hierarchy, flat. </p> </dd> </dl>
omni.kit.usd.collect.FlatCollectionTextureOptions_omni.kit.usd.collect.FlatCollectionTextureOptions.md
# FlatCollectionTextureOptions ## FlatCollectionTextureOptions ```python class omni.kit.usd.collect.FlatCollectionTextureOptions(value) ``` Bases: `Enum` Collection options for textures under ‘Flat Collection’ mode. ### Attributes | Attribute | Description | |-----------|-------------| | `BY_MDL` | Groups textures by MDL. | | `BY_USD` | Groups textures by USD. | | `FLAT` | All textures will be under the same hierarchy, flat. | ### `__init__` ```python def __init__(self) ``` ### BY_MDL ```python BY_MDL = 0 ``` Groups textures by MDL. ``` - **BY_USD** = 1 - Groups textures by USD. - **FLAT** = 2 - All textures will be under the same hierarchy, flat.
omni.kit.usd.layers.AbstractLayerCommand.md
# AbstractLayerCommand ## AbstractLayerCommand ```python class omni.kit.usd.layers.AbstractLayerCommand(context_name_or_instance: Union[str, UsdContext] = '') ``` Bases: `Command` Abstract base class for layer commands. It’s mainly responsible to create a common class to save all states before command execution, and restore them in the undo function. ### Methods - `__init__(context_name_or_instance)`: - `do()`: - `do_impl()`: Abstract do function to be implemented. - `get_layers()`: - `get_specs_linking()`: | Function Name | Description | |---------------|-------------| | get_specs_locking | () | | undo | () | | undo_impl | Abstract undo function to be implemented. | ### __init__ ```python __init__(context_name_or_instance: Union[str, UsdContext] = '') ``` ### do_impl ```python do_impl() ``` Abstract do function to be implemented. ### undo_impl ```python undo_impl() ``` Abstract undo function to be implemented.
omni.kit.usd.layers.active_authoring_layer_context.md
# active_authoring_layer_context ## active_authoring_layer_context ``` Gets the edit context for edit target if it’s in non-auto authoring mode, or edit context for default edit layer if it’s in auto authoring mode. ``` omni.kit.usd.layers.active_authoring_layer_context(usd_context) → EditContext ``` Gets the edit context for edit target if it’s in non-auto authoring mode, or edit context for default edit layer if it’s in auto authoring mode.
omni.kit.usd.layers.AutoAuthoring.md
# AutoAuthoring ## AutoAuthoring ```python class omni.kit.usd.layers.AutoAuthoring(layers_instance: ILayersInstance, usd_context) ``` (Experimental) USD supports switching edit targets so that all authoring will take place in that specified layer. When it’s working with multiple sublayers, this kind of freedom may cause experience issues. The user has to be aware the changes made are not overridden in any stronger layer. We extend a new mode called Auto Authoring to improve it. In this mode, all changes will firstly go into a middle delegate layer and it will then distribute edits (per frame) into their corresponding layers where the edits have the strongest opinions. So it cannot switch edit targets freely, and users do not need to be aware of the existence of multi-sublayers and how USD will compose the changes. ### Methods - **`__init__(layers_instance, usd_context)`** - - **`get_default_layer()`** - Gets the default layer. - **`is_auto_authoring_layer(layer_identifier)`** - Checks if a layer is an auto authoring layer. - **`is_enabled()`** - Checks if UsdContext is in Auto Authoring mode. ``` <p> <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> set_default_layer </span> </code> (layer_identifier) </p> <p> Sets the default layer to receive the newly created opinions. </p> <p> <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> usd_context </span> </code> </p> <dl> <dt> <span class="pre"> __init__ </span> (layers_instance: ILayersInstance, usd_context) → None </dt> </dl> <dl> <dt> <span class="pre"> get_default_layer </span> () → str </dt> <dd> <p> Gets the default layer. </p> </dd> </dl> <dl> <dt> <span class="pre"> is_auto_authoring_layer </span> (layer_identifier: str) → bool </dt> <dd> <p> Checks if a layer is an auto authoring layer. </p> </dd> </dl> <dl> <dt> <span class="pre"> is_enabled </span> () → bool </dt> <dd> <p> Checks if UsdContext is in Auto Authoring mode. </p> </dd> </dl> <dl> <dt> <span class="pre"> set_default_layer </span> (layer_identifier: str) </dt> <dd> <p> Sets the default layer to receive the newly created opinions. </p> </dd> </dl>
omni.kit.usd.layers.Classes.md
# omni.kit.usd.layers Classes ## Classes Summary: | Class Name | Description | |------------|-------------| | AbstractLayerCommand | Abstract base class for layer commands. | | AutoAuthoring | (Experimental) USD supports switching edit targets so that all authoring will take place in that specified layer. When it’s working | | CreateLayerReferenceCommand | Create reference in specific layer. | | CreateSublayerCommand | Creates or inserts a sublayer. | | Extension | Extension Class. | | FlattenLayersCommand | Flatten Layers. | | LayerEditMode | Layer edit mode. | | LayerErrorType | Layer error type. | | LayerEventPayload | LayerEventPayload is a wrapper to carb.events.IEvent sent from module omni.kit.usd.layers. | | LayerEventType | Layer event types. | | LayerUtils | LayerUtils provides utilities for operating layers. | - **Layers** Layers is the Python container of ILayersInstance, through which you can access all interfaces. For each UsdContext, - **LayersState** - **LinkSpecsCommand** Links spec paths to layers. - **LiveSession** Python instance of ILayersInstance for the convenience of accessing - **LiveSessionUser** LiveSessionUser represents an peer client instance that joins - **LiveSyncing** Live Syncing includes the interfaces to management Live Sessions of all layers in the bound UsdContext. - **LockLayerCommand** Sets lock state for layer. - **LockSpecsCommand** Locks spec paths in the UsdContext. - **MergeLayersCommand** Merges two layers. - **MovePrimSpecsToLayerCommand** Merge prim spec from src layer to dst layer and remove it from src layer. - **MoveSublayerCommand** Moves sublayer from one location to the other. - **RemovePrimSpecCommand** Removes prim spec from a layer. - **RemoveSublayerCommand** Removes a sublayer from parent layer. - **ReplaceSublayerCommand** Replaces sublayer with a new layer. - **SetEditTargetCommand** Sets layer as Edit Target. - **SetLayerMutenessCommand** Sets mute state for layer. - **SpecsLinking** - **SpecsLocking** - **StitchPrimSpecsToLayer** Flatten specific prims in the stage. It will remove original prim specs after flatten. - **UnlinkSpecsCommand** Unlinks spec paths to layers. - **UnlockSpecsCommand** Unlocks spec paths in the UsdContext
omni.kit.usd.layers.CreateLayerReferenceCommand.md
# CreateLayerReferenceCommand ## 概述 ```python class omni.kit.usd.layers.CreateLayerReferenceCommand: def __init__(self, layer_identifier: str, path_to: Path, asset_path: Optional[str] = None, prim_path: Optional[Path] = None, usd_context: Union[str, UsdContext] = ''): pass ``` ### 参数说明 - `layer_identifier`: 层标识符,类型为 `str`。 - `path_to`: 目标路径,类型为 `Path`。 - `asset_path`: 资产路径,类型为 `Optional[str]`,默认值为 `None`。 - `prim_path`: 基本路径,类型为 `Optional[Path]`,默认值为 `None`。 - `usd_context`: USD上下文,类型为 `Union[str, UsdContext]`,默认值为空字符串。 ``` ## CreateLayerReferenceCommand **Bases:** [AbstractLayerCommand](#) **Create reference in specific layer.** It creates a new prim and adds the asset and path as references in specific layer. **Parameters** - **layer_identifier** – str: Layer identifier to create prim inside. - **path_to** – Sdf.Path: Path to create a new prim. - **asset_path** – str: The asset it’s necessary to add to references. - **prim_path** – Sdf.Path: The prim in asset to reference. - **usd_context** – Union[str, omni.usd.UsdContext]: Usd context name or instance. It uses default context if it’s empty. **Methods** - **__init__(layer_identifier, path_to[, ...])** - **do_impl()** - Abstract do function to be implemented. - **undo_impl()** - Abstract undo function to be implemented. **__init__(layer_identifier: str, path_to: Path, asset_path: Optional[str] = None, prim_path: Optional[Path] = None, usd_context: Union[str, omni.usd.UsdContext] = None)** ## omni.kit.usd.layers.CreateLayerReferenceCommand ### `__init__` ```python def __init__(self, context: UsdContext): pass ``` ### `do_impl` ```python def do_impl(): pass ``` Abstract do function to be implemented. ### `undo_impl` ```python def undo_impl(): pass ``` Abstract undo function to be implemented.
omni.kit.usd.layers.CreateSublayerCommand.md
# CreateSublayerCommand ## CreateSublayerCommand ```python class omni.kit.usd.layers.CreateSublayerCommand(layer_identifier: str, sublayer_position: int, new_layer_path: str, transfer_root_content: bool, create_or_insert: bool, layer_name: str = '', usd_context: Union[str, UsdContext] = '') ``` ### 参数说明 - `layer_identifier`: str - `sublayer_position`: int - `new_layer_path`: str - `transfer_root_content`: bool - `create_or_insert`: bool - `layer_name`: str, 默认值 '' - `usd_context`: Union[str, UsdContext], 默认值 '' ``` ### CreateSublayerCommand Bases: `AbstractLayerCommand` Creates or inserts a sublayer. #### Methods - `__init__(layer_identifier, sublayer_position, new_layer_path, transfer_root_content, create_or_insert, layer_name='', usd_context='')` - Constructor. - Keyword arguments: - layer_identifier (str): The identifier of layer to create sublayer. It should be found by Sdf.Find. - sublayer_position (int): Sublayer position that the new sublayer is created before. - If position_before == -1, it will create layer at the end of sublayer list. - If position_before >= total_number_of_sublayers, it will create layer at the end of sublayer list. - new_layer_path (str): Absolute path of new layer. If it’s empty, it will create anonymous layer if create_or_insert == True. - If create_or_insert == False and it’s empty, it will fail to insert layer. - transfer_root_content (bool): True if we should move the root contents to the new layer. - `do_impl()` - Abstract do function to be implemented. - `undo_impl()` - Abstract undo function to be implemented. <p> create_or_insert (bool): If it’s true, it will create layer from this path. It’s insert, otherwise. </p> <p> layer_name (str, optional): If it’s to create anonymous layer (new_layer_path is empty), this name is used. </p> <p> usd_context (Union[str, omni.usd.UsdContext]): Usd context name or instance. It uses default context if it’s empty. </p> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.usd.layers.CreateSublayerCommand.do_impl"> <span class="sig-name descname"> <span class="pre"> do_impl </span> </span> <span class="sig-paren"> ( </span> <span class="sig-paren"> ) </span> </dt> <dd> <p> Abstract do function to be implemented. </p> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.usd.layers.CreateSublayerCommand.undo_impl"> <span class="sig-name descname"> <span class="pre"> undo_impl </span> </span> <span class="sig-paren"> ( </span> <span class="sig-paren"> ) </span> </dt> <dd> <p> Abstract undo function to be implemented. </p> </dd> </dl>
omni.kit.usd.layers.Extension.md
# Extension ## Extension Class Bases: `IExt` Extension Class. ### Methods | Method | Description | |--------------|-------------| | `on_shutdown()` | | | `on_startup()` | | #### `__init__(self: omni.ext._extensions.IExt) -> None` ```
omni.kit.usd.layers.FlattenLayersCommand.md
# FlattenLayersCommand ## Class: omni.kit.usd.layers.FlattenLayersCommand Constructor. ### Methods - **__init__(usd_context='')** - Constructor. - **do_impl()** - Abstract do function to be implemented. - **undo_impl()** - Abstract undo function to be implemented. ( usd_context : Union [ str , omni.usd.UsdContext ] = '' ) Constructor. **Keyword Arguments** * **usd_context** (Union[str, omni.usd.UsdContext]) – Usd context name or instance. It uses default context if it’s empty. **do_impl**() Abstract do function to be implemented. **undo_impl**() Abstract undo function to be implemented.
omni.kit.usd.layers.Functions.md
# omni.kit.usd.layers Functions ## Functions Summary | Function | Description | |----------|-------------| | active_authoring_layer_context | Gets the edit context for edit target if it’s in non-auto authoring mode. | | get_all_locked_specs | | | get_all_spec_links | | | get_auto_authoring | Gets the Auto Authoring interface from Layers instance bound to the specified UsdContext. | | get_last_error_string | Gets the error string of the API call bound to specified UsdContext. | | get_last_error_type | Gets the error status of the API call bound to specified UsdContext. Any API calls to Layers interface will change. | | get_layer_event_payload | Gets the payload of layer events by populating them into an instance of LayerEventPayload. | | get_layers | Gets Layers instance bound to the context. For each UsdContext, it has unique Layers instance. | | get_layers_state | Gets the Layers State interface from Layers instance bound to the specified UsdContext. | | get_live_session_name_from_shared_link | Gets the name of Live Session from the url. | | Method Name | Description | |-------------|-------------| | get_live_syncing_interface | Gets the Live Syncing interface from Layers instance bound to the specified UsdContext. | | get_short_user_name | Gets short name with capitalized first letters of each word. | | get_spec_layer_links | | | get_spec_links_for_layers | | | is_spec_linked | | | is_spec_locked | | | link_specs | | | lock_specs | | | unlink_all_specs | | | unlink_specs | | | unlink_specs_from_all_layers | | | unlink_specs_to_layers | | | unlock_all_specs | | | unlock_specs | |
omni.kit.usd.layers.get_all_locked_specs.md
# get_all_locked_specs ## get_all_locked_specs
omni.kit.usd.layers.get_all_spec_links.md
# get_all_spec_links ## get_all_spec_links ```python def get_all_spec_links(usd_context) -> Dict[str, List[str]]: ``` This function returns a dictionary where each key is a string and each value is a list of strings. ```
omni.kit.usd.layers.get_auto_authoring.md
# get_auto_authoring  ## get_auto_authoring  ### get_auto_authoring Gets the Auto Authoring interface from Layers instance bound to the specified UsdContext. REMINDER: Auto Authoring interface is still in experimental stage, which is used to reduce the burden of managing deltas inside multi-sublayers, so authoring to stage will be auto-targeted to the layers that has its strongest opinions.
omni.kit.usd.layers.get_last_error_string.md
# get_last_error_string ## get_last_error_string ```python omni.kit.usd.layers.get_last_error_string(context_name_or_instance: Union[str, UsdContext] = '') -> str ``` Gets the error string of the API call bound to specified UsdContext. ``` ```
omni.kit.usd.layers.get_last_error_type.md
# get_last_error_type ## get_last_error_type ```python omni.kit.usd.layers.get_last_error_type(context_name_or_instance: Union[str, UsdContext] = '') -> LayerErrorType ``` Gets the error status of the API call bound to specified UsdContext. Any API calls to Layers interface will change the error state. When you want to get the detailed error of your last call, you can use this function to fetch the detailed error type.
omni.kit.usd.layers.get_layers.md
# get_layers ## get_layers ```python omni.kit.usd.layers.get_layers(context_name_or_instance: Union[str, UsdContext] = '') -> Optional[Layers] ``` Gets Layers instance bound to the context. For each UsdContext, it has unique Layers instance, through which, you can access all the interfaces supported. ```
omni.kit.usd.layers.get_layers_state.md
# get_layers_state  ## get_layers_state  ```python omni.kit.usd.layers.get_layers_state(context_name_or_instance: Union[str, UsdContext] = '') -> Optional[LayersState] ``` Gets the Layers State interface from Layers instance bound to the specified UsdContext. Layers State interface extends the USD interfaces to access more states of layers, and provides utilities for layer operations and event subscription. ```
omni.kit.usd.layers.get_layer_event_payload.md
# get_layer_event_payload ## get_layer_event_payload ```python def get_layer_event_payload(event: IEvent) -> LayerEventPayload: ``` Gets the payload of layer events by populating them into an instance of LayerEventPayload.
omni.kit.usd.layers.get_live_session_name_from_shared_link.md
# get_live_session_name_from_shared_link ## get_live_session_name_from_shared_link ```python def get_live_session_name_from_shared_link(shared_session_link: str) -> str: ``` Gets the name of Live Session from the url. ```
omni.kit.usd.layers.get_live_syncing.md
# get_live_syncing ## get_live_syncing ```python omni.kit.usd.layers.get_live_syncing(context_name_or_instance: Union[str, UsdContext] = '') -> Optional[LiveSyncing] ``` Gets the Live Syncing interface from Layers instance bound to the specified UsdContext. Live Syncing interface is the core of supporting Live Session in Kit, which provides all functionalities to manage Live Sessions. ```
omni.kit.usd.layers.get_short_user_name.md
# get_short_user_name ## get_short_user_name ```python def get_short_user_name(user_name: str) -> str: """ Gets short name with capitalized first letters of each word. """ ``` ```
omni.kit.usd.layers.get_spec_layer_links.md
# get_spec_layer_links ## get_spec_layer_links
omni.kit.usd.layers.get_spec_links_for_layers.md
# get_spec_links_for_layers ## get_spec_links_for_layers ```python omni.kit.usd.layers.get_spec_links_for_layers(usd_context, layer_identifiers: Union[str, List[str]]) -> Dict[str, List[str]] ``` - **Parameters**: - `usd_context` - `layer_identifiers`: Union of `str` or `List[str]` - **Returns**: - A dictionary where keys are strings and values are lists of strings.
omni.kit.usd.layers.is_spec_linked.md
# is_spec_linked ## is_spec_linked ```python omni.kit.usd.layers.is_spec_linked(usd_context, spec_path: Union[str, Path], layer_identifier: str = '') -> bool ``` Checks if a specification is linked in a USD layer. **Parameters:** - `usd_context`: The USD context. - `spec_path`: The path of the specification. - `layer_identifier` (optional): The identifier of the layer. Default is an empty string. **Returns:** - `bool`: True if the specification is linked, False otherwise.
omni.kit.usd.layers.is_spec_locked.md
# is_spec_locked ## is_spec_locked
omni.kit.usd.layers.LayerEditMode.md
# LayerEditMode ## Overview Layer edit mode. ### Members - NORMAL : Normal authoring mode. - AUTO_AUTHORING : Auto authoring mode. - SPECS_LINKING : Specs Linking mode. ### Methods - `__init__(self, value)` ### Attributes - `AUTO_AUTHORING` - `NORMAL` - `SPECS_LINKING` - `name` - `value` ### omni.kit.usd.layers.LayerEditMode #### __init__(self, value: int) -> None - **value**: int #### name - **property**: name
omni.kit.usd.layers.LayerErrorType.md
# LayerErrorType ## LayerErrorType ```python class omni.kit.usd.layers.LayerErrorType ``` Bases: `pybind11_object` Layer error type. Members: - SUCCESS : Success. - NOT_FOUND : Object (layer, file, or session, etc) is not found. - ALREADY_EXISTS : Object exists already. - READ_ONLY : File, layer or folder is read-only. - INVALID_STAGE : No valid stage opened. - INVALID_PARAM : Invalid parameters passed into function. - LIVE_SESSION_NOT_JOINED : Live Session is not joined. - LIVE_SESSOIN_INVALID : Live Session is invalid. - LIVE_SESSION_JOINED_ALREADY : Live Session is joined already. - LIVE_SESSION_NO_MERGE_PERMISSION : Live Session cannot be merged due to permission. - LIVE_SESSION_VERSION_MISMATCH : Live Session version does not match. - LIVE_SESSION_BASE_LAYER_MISMATCH : Base layer of Live Session does not match. - LIVE_SESSION_NOT_SUPPORTED : Live Session cannot be created under the domain. - UNKNOWN : Unknown error. ### Methods - `__init__(self, value)` ### Attributes - `ALREADY_EXISTS` - `INVALID_PARAM` - `INVALID_STAGE` - `LIVE_SESSION_BASE_LAYER_MISMATCH` | LIVE_SESSION_JOINED_ALREADY | |------------------------------| | LIVE_SESSION_NOT_JOINED | |------------------------------| | LIVE_SESSION_NOT_SUPPORTED | |------------------------------| | LIVE_SESSION_NO_MERGE_PERMISSION | |------------------------------| | LIVE_SESSION_VERSION_MISMATCH | |------------------------------| | LIVE_SESSION_INVALID | |------------------------------| | NOT_FOUND | |------------------------------| | READ_ONLY | |------------------------------| | SUCCESS | |------------------------------| | UNKNOWN | |------------------------------| | name | |------------------------------| | value | |------------------------------| __init__(self: omni.kit.usd.layers._omni_kit_usd_layers.LayerErrorType, value: int) -> None property name
omni.kit.usd.layers.LayerEventPayload.md
# LayerEventPayload LayerEventPayload is a wrapper to carb.events.IEvent sent from module omni.kit.usd.layers. Through which, you can query event payload easier with properties. ## Methods - **`__init__(event)`** - **`is_layer_influenced(layer_identifier_or_handle)`** - Checks if specific layer is influenced by the event. ## Attributes - **`event_type`** - Layer event type, it's None when the event type is unknown. - **`identifiers_or_spec_paths`** - The influenced layers or prim specs if any. - **`layer_identifier`** - The identifier of the layer that triggered the event. | Property | Description | |----------|-------------| | layer_identifier | This property is non-empty when any layers are influenced. | | layer_info_data | It is non-empty if event type is INFO_CHANGED, of which key is the layer identifier that its metadata has changed, and value is the set of strings that represent the metadata tokens that's modified. | | layer_spec_paths | The influenced spec paths for each layer. | | success | It's useful if event type is LIVE_SESSION_MERGE_STARTED or LIVE_SESSION_MERGE_ENDED, which means if merge of a Live Session is successful or not. | | user_id | It's non-empty if event type is LIVE_SESSION_USER_JOINED or LIVE_SESSION_USER_LEFT. | | user_name | It's non-empty if event type is LIVE_SESSION_USER_JOINED or LIVE_SESSION_USER_LEFT. | ### __init__ - **Parameters**: - `event : IEvent` - **Returns**: `None` ### is_layer_influenced - **Parameters**: - `layer_identifier_or_handle : Union[str, Layer]` - **Returns**: `bool` - **Description**: Checks if specific layer is influenced by the event. ### event_type - **Type**: `LayerEventType` - **Description**: Layer event type, it’s None when the event type is unknown. ### identifiers_or_spec_paths - **Type**: `List[str]` - **Description**: List of identifiers or spec paths. ### identifiers_or_spec_paths The influenced layers or prim specs if any. When event type is LayerEventType.SPECS_LOCKING_CHANGED, it hosts all influenced prim specs. Otherwise, it hosts all influenced layers for the event. ### layer_identifier This property is non-empty when any layers are influenced. If multiple layers are influenced, it’s the first one of identifiers_or_spec_paths to keep compatibility. ### layer_info_data It is non-empty if event type is INFO_CHANGED, of which key is the layer identifier that its metadata has changed, and value is the set of strings that represent the metadata tokens that’s modified. Currently, only the following tokens are notified when they are modified: - UsdGeom.Tokens.upAxis - UsdGeom.Tokens.metersPerUnit - Sdf.Layer.StartTimeCodeKey - Sdf.Layer.EndTimeCodeKey - Sdf.Layer.FramesPerSecond - Sdf.Layer.TimeCodesPerSecond - Sdf.Layer.CommentKey - Sdf.Layer.Documentation - “subLayerOffsets_offset” # String as there is no python binding from USD. - “subLayerOffsets_scale” ### layer_spec_paths The influenced spec paths for each layer. It’s non-empty if event type is PRIM_SPECS_CHANGED or SPECS_LINKING_CHANGED, of which, the key is the layer identifier, and value is the list of spec paths. ### success It’s useful if event type is LIVE_SESSION_MERGE_STARTED or LIVE_SESSION_MERGE_ENDED, which means if merge of a Live Session is successful or not. ### user_id It’s non-empty if event type is LIVE_SESSION_USER_JOINED or LIVE_SESSION_USER_LEFT. ### user_name <section> <div> <div> <div> <div> <dl> <dt> <em> <span class="pre"> str </span> </em> </dt> <dd> <p> It’s non-empty if event type is LIVE_SESSION_USER_JOINED or LIVE_SESSION_USER_LEFT. </p> </dd> </dl> </div> </div> <footer> <hr/> </footer> </div> </div> </section>
omni.kit.usd.layers.LayerEventType.md
# LayerEventType ## LayerEventType ```python class omni.kit.usd.layers.LayerEventType(value) ``` Bases: `IntEnum` Layer event types. Members: - INFO_CHANGED : Layer metadata changed. - DIRTY_STATE_CHANGED : Layers’ dirty state changed. - LOCK_STATE_CHANGED : Layers’ lock state changed. - MUTENESS_SCOPE_CHANGED : Layers’ mute scope changed. - MUTENESS_STATE_CHANGED : Layers’ mute state changed. - OUTDATE_STATE_CHANGED : Layers’ outdate state changed. - PRIM_SPECS_CHANGED : Layers’ prim specs changed. - SUBLAYERS_CHANGED : Layers’ sublayer list changed. - EDIT_TARGET_CHANGED : Stage’s edit target changed. - SPECS_LOCKING_CHANGED : Stage’s locking specs changed. - SPECS_LINKING_CHANGED : Stage’s linking specs changed. - EDIT_MODE_CHANGED : Stage’s edit mode changed. - DEFAULT_LAYER_CHANGED : Stage’s default layer changed when it’s in Auto Authoring mode. - LIVE_SESSION_STATE_CHANGED : Layers’ Live Session state changed. - LIVE_SESSION_JOINING : Layers are joining Live Session. - LIVE_SESSION_LIST_CHANGED : Layers’ Live Session list changed. - LIVE_SESSION_USER_JOINED : New User joined the Live Session. - LIVE_SESSION_USER_LEFT : New User left the Live Session. - LIVE_SESSION_MERGE_STARTED : Merging Live Session started. - LIVE_SESSION_MERGE_ENDED : Merging Live Session ended. - USED_LAYERS_CHANGED : Stage’s used layers changed. - LAYER_FILE_PERMISSION_CHANGED : Layer’s file permisison changed on file system. ### Attributes - `INFO_CHANGED` - `DIRTY_STATE_CHANGED` - `LOCK_STATE_CHANGED` MUTENESS_SCOPE_CHANGED MUTENESS_STATE_CHANGED OUTDATE_STATE_CHANGED PRIM_SPECS_CHANGED SUBLAYERS_CHANGED EDIT_TARGET_CHANGED SPECS_LOCKING_CHANGED SPECS_LINKING_CHANGED EDIT_MODE_CHANGED DEFAULT_LAYER_CHANGED LIVE_SESSION_STATE_CHANGED LIVE_SESSION_JOINING LIVE_SESSION_LIST_CHANGED LIVE_SESSION_USER_JOINED LIVE_SESSION_USER_LEFT LIVE_SESSION_MERGE_STARTED LIVE_SESSION_MERGE_ENDED USED_LAYERS_CHANGED LAYER_FILE_PERMISSION_CHANGED AUTO_RELOAD_LAYERS_CHANGED __init__()
omni.kit.usd.layers.Layers.get_last_error_string_omni.kit.usd.layers.Layers.md
# Layers ## Layers Bases: `object` Layers is the Python container of ILayersInstance, through which you can access all interfaces. For each UsdContext, it has a separate Layers instance. ### Methods - `__init__(layers_instance, usd_context)` - `get_auto_authoring()` - Gets AutoAuthoring interface. - `get_edit_mode()` - Gets the current edit mode. - `get_event_stream()` - Gets event stream of Layers instance. - `get_last_error_string()` - Gets the last error string. | Method | Description | | ------ | ----------- | | `get_last_error_type()` | Gets the last error type. | | `get_layers_state()` | Gets LayersState interface. | | `get_live_syncing()` | Gets LiveSyncing interface. | | `get_specs_linking()` | Gets SpecsLinking interface. | | `get_specs_locking()` | Gets SpecsLocking interface. | | `set_edit_mode(edit_mode)` | Sets the current edit mode. | ### Attributes | Attribute | Description | | --------- | ----------- | | `usd_context` | The UsdContext this instance is bound to. | ### Methods ```python __init__(layers_instance, usd_context: UsdContext) -> None ``` ```python get_auto_authoring() -> AutoAuthoring ``` - Gets AutoAuthoring interface. ```python get_edit_mode() -> LayerEditMode ``` - Gets the current edit mode. ```python get_event_stream() ``` - Gets event stream of Layers instance. ```python get_last_error_string() ``` - (Description not provided in the HTML) ``` ### get_last_error_string Gets the last error string. ### get_last_error_type Gets the last error type. ### get_layers_state Gets LayersState interface. ### get_live_syncing Gets LiveSyncing interface. ### get_specs_linking Gets SpecsLinking interface. ### get_specs_locking Gets SpecsLocking interface. ### set_edit_mode Sets the current edit mode. ### usd_context The UsdContext this instance is bound to.
omni.kit.usd.layers.LayersState.md
# LayersState ## Methods - `__init__(layers_instance, usd_context)` - `add_auto_reload_layer(layer_identifier)` - Adds layer into auto-reload list. - `get_all_outdated_layer_identifiers()` - Gets all layer identifiers in the stage that are outdated currently while skipping any live-sessions - `get_auto_reload_layers()` - Returns a list of layer identifiers that are configured as auto-reload when they are outdated. - `get_dirty_layer_identifiers(not_in_session)` | | | |---|---| | | Gets all layer identifiers that have pending edits that are not saved. | | | `get_layer_name` (layer_identifier) | | | | | | `get_layer_owner` (layer_identifier) | | | Gets file owner of layer file. | | | `get_local_layer_identifiers` (...) | | | Gets layer identifiers in the local layer stack of the current stage. | | | `get_outdated_non_sublayer_identifiers` (...) | | | Ges all layer identifiers except ones in the local layer stack of the stage that are outdated currently. | | | `get_outdated_sublayer_identifiers` (...) | | | Ges all sublayer identifiers in the local layer stack of the stage that are outdated currently. | | | `has_local_layer` (layer_identifier) | | | Layer is in the local layer stack of current stage. | | | `has_used_layer` (layer_identifier) | | | Layer is in the used layers of current stage. | | | `is_auto_reload_layer` (layer_identifier) | | | Whether layer will be auto-reloaded when it's outdated or not. | | | `is_layer_globally_muted` (layer_identifier) | | | Checks if layer is globally muted or not in this usd context. | | | `is_layer_locally_muted` (layer_identifier) | | | | | | `is_layer_locked` (layer_identifier) | | | | | | `is_layer_outdated` (layer_identifier) | | | If layer is out of sync. | | | `is_layer_readonly_on_disk` (layer_identifier) | | | Checks if this layer is physically read-only on disk. | | | `is_layer_savable` (layer_identifier) | | | Checks if this layer is savable. | | | `is_layer_writable` (layer_identifier) | | | Checks if layer is writable. | | 方法 | 描述 | | --- | --- | | `is_muteness_global()` | Global muteness is an extended concept for Omniverse so muteness can be authored into USD for persistence. | | `reload_all_outdated_layers([not_in_session, ...])` | Reloads all outdated layers to fetch latest updates. | | `reload_outdated_non_sublayers([...])` | Reloads all outdated non-sublayers in the stage to fetch latest changes. | | `reload_outdated_sublayers([not_in_session, ...])` | Reloads all outdated sublayers that are in the stage's local layer stack to fetch latest changes. | | `remove_auto_reload_layer(layer_identifier)` | Remove layer from auto-reload list. | | `set_layer_lock_state(layer_identifier, locked)` | Layer lock is an extended concept in Omniverse that works for lock this layer temporarily without real change the file permission of this layer. | | `set_layer_name(layer_identifier, name)` | | | `set_muteness_scope(global_scope)` | | ### Attributes | 属性 | 描述 | | --- | --- | | `usd_context` | | ### Methods #### `__init__(layers_instance: ILayersInstance, usd_context)` - Initializes the LayersState object. #### `add_auto_reload_layer(layer_identifier: str)` - Adds layer into auto-reload list. So if layer is outdated, it will be auto-reloaded. #### `get_all_outdated_layer_identifiers(not_in_session=False)` - Retrieves all outdated layer identifiers. ### get_all_outdated_layer_identifiers Gets all layer identifiers in the stage that are outdated currently while skipping any live-sessions. ### get_auto_reload_layers Returns a list of layer identifiers that are configured as auto-reload when they are outdated. ### get_dirty_layer_identifiers Gets all layer identifiers that have pending edits that are not saved. ### get_layer_owner Gets file owner of layer file. It’s empty if file system does not support it. ### get_local_layer_identifiers Gets layer identifiers in the local layer stack of the current stage. ### get_outdated_non_sublayer_identifiers <span class="pre"> not_in_session </span> <span class="o"> <span class="pre"> = </span> </span> <span class="default_value"> <span class="pre"> False </span> </span> , <em class="sig-param"> <span class="n"> <span class="pre"> not_auto </span> </span> <span class="o"> <span class="pre"> = </span> </span> <span class="default_value"> <span class="pre"> False </span> </span> </em> <span class="sig-paren"> ) </span> <span class="sig-return"> <span class="sig-return-icon"> → </span> <span class="sig-return-typehint"> <span class="pre"> List </span> <span class="p"> <span class="pre"> [ </span> </span> <span class="pre"> str </span> <span class="p"> <span class="pre"> ] </span> </span> </span> </span> </dt> <dd> <p> Gets all layer identifiers except ones in the local layer stack of the stage that are outdated currently. Those layers include ones that are inserted as references or payloads. </p> </dd> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.usd.layers.LayersState.get_outdated_sublayer_identifiers"> <span class="sig-name descname"> <span class="pre"> get_outdated_sublayer_identifiers </span> </span> <span class="sig-paren"> ( </span> <em class="sig-param"> <span class="n"> <span class="pre"> not_in_session </span> </span> <span class="o"> <span class="pre"> = </span> </span> <span class="default_value"> <span class="pre"> False </span> </span> </em> , <em class="sig-param"> <span class="n"> <span class="pre"> not_auto </span> </span> <span class="o"> <span class="pre"> = </span> </span> <span class="default_value"> <span class="pre"> False </span> </span> </em> <span class="sig-paren"> ) </span> <span class="sig-return"> <span class="sig-return-icon"> → </span> <span class="sig-return-typehint"> <span class="pre"> List </span> <span class="p"> <span class="pre"> [ </span> </span> <span class="pre"> str </span> <span class="p"> <span class="pre"> ] </span> </span> </span> </span> </dt> <dd> <p> Gets all sublayer identifiers in the local layer stack of the stage that are outdated currently. </p> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.usd.layers.LayersState.has_local_layer"> <span class="sig-name descname"> <span class="pre"> has_local_layer </span> </span> <span class="sig-paren"> ( </span> <em class="sig-param"> <span class="n"> <span class="pre"> layer_identifier </span> </span> </em> <span class="sig-paren"> ) </span> <span class="sig-return"> <span class="sig-return-icon"> → </span> <span class="sig-return-typehint"> <span class="pre"> bool </span> </span> </span> </dt> <dd> <p> Layer is in the local layer stack of current stage. </p> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.usd.layers.LayersState.has_used_layer"> <span class="sig-name descname"> <span class="pre"> has_used_layer </span> </span> <span class="sig-paren"> ( </span> <em class="sig-param"> <span class="n"> <span class="pre"> layer_identifier </span> </span> </em> <span class="sig-paren"> ) </span> <span class="sig-return"> <span class="sig-return-icon"> → </span> <span class="sig-return-typehint"> <span class="pre"> bool </span> </span> </span> </dt> <dd> <p> Layer is in the used layers of current stage. </p> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.usd.layers.LayersState.is_auto_reload_layer"> <span class="sig-name descname"> <span class="pre"> is_auto_reload_layer </span> </span> <span class="sig-paren"> ( </span> <em class="sig-param"> <span class="n"> <span class="pre"> layer_identifier </span> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="n"> <span class="pre"> str </span> </span> </em> <span class="sig-paren"> ) </span> <span class="sig-return"> <span class="sig-return-icon"> → </span> <span class="sig-return-typehint"> <span class="pre"> bool </span> </span> </span> </dt> <dd> <p> Whether layer will be auto-reloaded when it’s outdated or not. </p> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.usd.layers.LayersState.is_layer_globally_muted"> <span class="sig-name descname"> <span class="pre"> is_layer_globally_muted </span> </span> <span class="sig-paren"> ( </span> <em class="sig-param"> <span class="n"> <span class="pre"> layer_identifier </span> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="n"> <span class="pre"> str </span> </span> </em> <span class="sig-paren"> ) </span> <span class="sig-return"> <span class="sig-return-icon"> → </span> <span class="sig-return-typehint"> <span class="pre"> bool </span> </span> </span> </dt> <dd> <p> Whether layer will be auto-reloaded when it’s outdated or not. </p> </dd> </dl> <dl> <dt> <p> Checks if layer is globally muted or not in this usd context. Global muteness is a customize concept in Kit that’s not from USD. It’s used for complement the USD muteness, that works for two purposes: 1. It’s stage bound. So a layer is globally muted in this stage will not influence others. 2. It’s persistent. Right now, it’s saved inside the custom data of root layer. </p> <p> After stage load, it will be read to initialize the muteness of layers. Also, global muteness only takes effective when it’s in global state mode. See omni.usd.UsdContext.set_layer_muteness_scope about how to switch muteness scope. When it’s not in global state mode, authoring global muteness will not influence layer’s muteness in stage. </p> </dt> </dl> <dl class="py method"> <dt> <span class="pre">is_layer_outdated</span> (<span class="pre">layer_identifier</span>: <span class="pre">str</span>) → <span class="pre">bool</span> </dt> <dd> <p> If layer is out of sync. This only works for layer inside Nucleus server but not local disk. </p> </dd> </dl> <dl class="py method"> <dt> <span class="pre">is_layer_readonly_on_disk</span> (<span class="pre">layer_identifier</span>: <span class="pre">str</span>) → <span class="pre">bool</span> </dt> <dd> <p> Checks if this layer is physically read-only on disk. </p> </dd> </dl> <dl class="py method"> <dt> <span class="pre">is_layer_savable</span> (<span class="pre">layer_identifier</span>: <span class="pre">str</span>) → <span class="pre">bool</span> </dt> <dd> <p> Checks if this layer is savable. If it’s savable means it’s true by checking is_layer_writable and not anonymous. </p> </dd> </dl> <dl class="py method"> <dt> <span class="pre">is_layer_writable</span> (<span class="pre">layer_identifier</span>: <span class="pre">str</span>) → <span class="pre">bool</span> </dt> <dd> <p> Checks if layer is writable. A layer is writable means it can be set as edit target, which should satisfy: 1. It’s not read-only on disk. 2. It’s not locked by set_layer_lock_state. 3. It’s not muted. It still can be set as edit target with scripts, while this can be used for guardrails. </p> </dd> </dl> <dl class="py method"> <dt> <span class="pre">is_muteness_global</span> () → <span class="pre">bool</span> </dt> <dd> <p> Global muteness is an extended concept for Omniverse so muteness can be authored into USD for persistence. When you set muteness scope as global with set_muteness_scope, all muteness of sublayers will be stored to root layer’s custom data and it will be loaded for next stage open. </p> </dd> </dl> <dl class="py method"> <dt> <span class="pre">reload_all_outdated_layers</span> (<span class="pre">not_in_session</span>=<span class="pre">True</span>, <span class="pre">not_auto</span>=<span class="pre">False</span>) </dt> </dl> ### reload_all_outdated_layers Reloads all outdated layers to fetch latest updates. We only want to reload layers that are not in session. ### reload_outdated_non_sublayers Reloads all outdated non-sublayers in the stage to fetch latest changes. If a layer is both inserted as sublayer and reference, it will be treated as sublayer only and will not be reloaded in this function. ### reload_outdated_sublayers Reloads all outdated sublayers that are in the stage’s local layer stack to fetch latest changes. ### remove_auto_reload_layer Remove layer from auto-reload list. ### set_layer_lock_state Layer lock is an extended concept in Omniverse that works for lock this layer temporarily without real change the file permission of this layer. It’s just authored as a meta inside layer’s custom data section, and read by UI.
omni.kit.usd.layers.LayersState_omni.kit.usd.layers.LayersState.md
# LayersState ## Class Definition ```python class omni.kit.usd.layers.LayersState(layers_instance: ILayersInstance, usd_context) ``` ### Methods - **`__init__(layers_instance, usd_context)`** - No description provided. - **`add_auto_reload_layer(layer_identifier)`** - Adds layer into auto-reload list. - **`get_all_outdated_layer_identifiers()`** - Gets all layer identifiers in the stage that are outdated currently while skipping any live-sessions. - **`get_auto_reload_layers()`** - Returns a list of layer identifiers that are configured as auto-reload when they are outdated. - **`get_dirty_layer_identifiers(not_in_session=None)`** - No description provided. ``` | 方法 | 描述 | | --- | --- | | get_layer_name(layer_identifier) | 获取层名称 | | get_layer_owner(layer_identifier) | 获取层文件的所有者 | | get_local_layer_identifiers(...) | 获取当前阶段本地层堆栈中的层标识符 | | get_outdated_non_sublayer_identifiers(...) | 获取除当前阶段本地层堆栈中的层标识符外的所有过时的层标识符 | | get_outdated_sublayer_identifiers(...) | 获取当前阶段本地层堆栈中的所有过时的子层标识符 | | has_local_layer(layer_identifier) | 层是否在当前阶段的本地层堆栈中 | | has_used_layer(layer_identifier) | 层是否在当前阶段使用的层中 | | is_auto_reload_layer(layer_identifier) | 层是否会在过时时自动重新加载 | | is_layer_globally_muted(layer_identifier) | 检查层是否在此usd上下文中全局静音 | | is_layer_locally_muted(layer_identifier) | | | is_layer_locked(layer_identifier) | | | is_layer_outdated(layer_identifier) | 如果层不同步 | | is_layer_readonly_on_disk(layer_identifier) | 检查层是否在磁盘上物理只读 | | is_layer_savable(layer_identifier) | 检查层是否可保存 | | is_layer_writable(layer_identifier) | 检查层是否可写 | | Method/Attribute | Description | | --- | --- | | `is_muteness_global()` | Global muteness is an extended concept for Omniverse so muteness can be authored into USD for persistence. | | `reload_all_outdated_layers([not_in_session, ...])` | Reloads all outdated layers to fetch latest updates. | | `reload_outdated_non_sublayers([...])` | Reloads all outdated non-sublayers in the stage to fetch latest changes. | | `reload_outdated_sublayers([not_in_session, ...])` | Reloads all outdated sublayers that are in the stage's local layer stack to fetch latest changes. | | `remove_auto_reload_layer(layer_identifier)` | Remove layer from auto-reload list. | | `set_layer_lock_state(layer_identifier, locked)` | Layer lock is an extended concept in Omniverse that works for lock this layer temporarily without real change the file permission of this layer. | | `set_layer_name(layer_identifier, name)` | | | `set_muteness_scope(global_scope)` | | | `usd_context` | | ### Attributes | Attribute | Description | | --- | --- | | `usd_context` | | ### Methods #### `__init__(layers_instance: ILayersInstance, usd_context)` #### `add_auto_reload_layer(layer_identifier: str)` Adds layer into auto-reload list. So if layer is outdated, it will be auto-reloaded. #### `get_all_outdated_layer_identifiers(not_in_session=False)` ### get_all_outdated_layer_identifiers ```python get_all_outdated_layer_identifiers(not_auto=False) -> List[str] ``` Gets all layer identifiers in the stage that are outdated currently while skipping any live-sessions ### get_auto_reload_layers ```python get_auto_reload_layers() -> List[str] ``` Returns a list of layer identifiers that are configured as auto-reload when they are outdated. ### get_dirty_layer_identifiers ```python get_dirty_layer_identifiers(not_in_session=False) -> List[str] ``` Gets all layer identifiers that have pending edits that are not saved. ### get_layer_owner ```python get_layer_owner(layer_identifier: str) -> str ``` Gets file owner of layer file. It’s empty if file system does not support it. ### get_local_layer_identifiers ```python get_local_layer_identifiers(include_session_layers=False, include_anonymous_layers=True, include_invalid_layers=False) -> List[str] ``` Gets layer identifiers in the local layer stack of the current stage. ### get_outdated_non_sublayer_identifiers ```python get_outdated_non_sublayer_identifiers(not_in_session=False, not_auto=False) -> List[str] ``` Ges all layer identifiers except ones in the local layer stack of the stage that are outdated currently. Those layers include ones that are inserted as references or payloads. ### get_outdated_sublayer_identifiers ```python get_outdated_sublayer_identifiers(not_in_session=False, not_auto=False) -> List[str] ``` Ges all sublayer identifiers in the local layer stack of the stage that are outdated currently. ### has_local_layer ```python has_local_layer(layer_identifier: str) -> bool ``` Layer is in the local layer stack of current stage. ### has_used_layer ```python has_used_layer(layer_identifier: str) -> bool ``` Layer is in the used layers of current stage. ### is_auto_reload_layer ```python is_auto_reload_layer(layer_identifier: str) -> bool ``` Whether layer will be auto-reloaded when it’s outdated or not. ### is_layer_globally_muted ```python is_layer_globally_muted(layer_identifier: str) -> bool ``` Whether layer is globally muted or not. <dl> <dt> <p> Checks if layer is globally muted or not in this usd context. Global muteness is a customize concept in Kit that’s not from USD. It’s used for complement the USD muteness, that works for two purposes: 1. It’s stage bound. So a layer is globally muted in this stage will not influence others. 2. It’s persistent. Right now, it’s saved inside the custom data of root layer. </p> <p> After stage load, it will be read to initialize the muteness of layers. Also, global muteness only takes effective when it’s in global state mode. See omni.usd.UsdContext.set_layer_muteness_scope about how to switch muteness scope. When it’s not in global state mode, authoring global muteness will not influence layer’s muteness in stage. </p> </dt> </dl> <dl class="py method"> <dt> <span class="pre"> is_layer_outdated </span> <em> <span class="pre"> layer_identifier </span> : <span class="pre"> str </span> </em> <span class="pre"> → </span> <span class="pre"> bool </span> </dt> <dd> <p> If layer is out of sync. This only works for layer inside Nucleus server but not local disk. </p> </dd> </dl> <dl class="py method"> <dt> <span class="pre"> is_layer_readonly_on_disk </span> <em> <span class="pre"> layer_identifier </span> : <span class="pre"> str </span> </em> <span class="pre"> → </span> <span class="pre"> bool </span> </dt> <dd> <p> Checks if this layer is physically read-only on disk. </p> </dd> </dl> <dl class="py method"> <dt> <span class="pre"> is_layer_savable </span> <em> <span class="pre"> layer_identifier </span> : <span class="pre"> str </span> </em> <span class="pre"> → </span> <span class="pre"> bool </span> </dt> <dd> <p> Checks if this layer is savable. If it’s savable means it’s true by checking is_layer_writable and not anonymous. </p> </dd> </dl> <dl class="py method"> <dt> <span class="pre"> is_layer_writable </span> <em> <span class="pre"> layer_identifier </span> : <span class="pre"> str </span> </em> <span class="pre"> → </span> <span class="pre"> bool </span> </dt> <dd> <p> Checks if layer is writable. A layer is writable means it can be set as edit target, which should satisfy: 1. It’s not read-only on disk. 2. It’s not locked by set_layer_lock_state. 3. It’s not muted. It still can be set as edit target with scripts, while this can be used for guardrails. </p> </dd> </dl> <dl class="py method"> <dt> <span class="pre"> is_muteness_global </span> <span class="pre"> → </span> <span class="pre"> bool </span> </dt> <dd> <p> Global muteness is an extended concept for Omniverse so muteness can be authored into USD for persistence. When you set muteness scope as global with set_muteness_scope, all muteness of sublayers will be stored to root layer’s custom data and it will be loaded for next stage open. </p> </dd> </dl> <dl class="py method"> <dt> <span class="pre"> reload_all_outdated_layers </span> <em> <span class="pre"> not_in_session </span> = <span class="pre"> True </span> </em> , <em> <span class="pre"> not_auto </span> = <span class="pre"> True </span> </em> </dt> </dl> ### reload_all_outdated_layers Reloads all outdated layers to fetch latest updates. We only want to reload layers that are not in session. ### reload_outdated_non_sublayers Reloads all outdated non-sublayers in the stage to fetch latest changes. If a layer is both inserted as sublayer and reference, it will be treated as sublayer only and will not be reloaded in this function. ### reload_outdated_sublayers Reloads all outdated sublayers that are in the stage’s local layer stack to fetch latest changes. ### remove_auto_reload_layer Remove layer from auto-reload list. ### set_layer_lock_state Layer lock is an extended concept in Omniverse that works for lock this layer temporarily without real change the file permission of this layer. It’s just authored as a meta inside layer’s custom data section, and read by UI.
omni.kit.usd.layers.Layers_omni.kit.usd.layers.Layers.md
# Layers ## Layers ### Class Definition ```python class omni.kit.usd.layers.Layers(layers_instance, usd_context: UsdContext) ``` **Description:** Layers is the Python container of ILayersInstance, through which you can access all interfaces. For each UsdContext, it has a separate Layers instance. ### Methods - **`__init__(layers_instance, usd_context)`** - No description provided. - **`get_auto_authoring()`** - Gets AutoAuthoring interface. - **`get_edit_mode()`** - Gets the current edit mode. - **`get_event_stream()`** - Gets event stream of Layers instance. - **`get_last_error_string()`** - Gets the last error string. ``` | Method | Description | |--------|-------------| | `get_last_error_type()` | Gets the last error type. | | `get_layers_state()` | Gets LayersState interface. | | `get_live_syncing()` | Gets LiveSyncing interface. | | `get_specs_linking()` | Gets SpecsLinking interface. | | `get_specs_locking()` | Gets SpecsLocking interface. | | `set_edit_mode(edit_mode)` | Sets the current edit mode. | ### Attributes | Attribute | Description | |-----------|-------------| | `usd_context` | The UsdContext this instance is bound to. | ### Methods #### `__init__(layers_instance, usd_context: UsdContext)` - **Parameters**: - `layers_instance` - `usd_context: UsdContext` - **Returns**: `None` #### `get_auto_authoring()` - **Returns**: `AutoAuthoring` - **Description**: Gets AutoAuthoring interface. #### `get_edit_mode()` - **Returns**: `LayerEditMode` - **Description**: Gets the current edit mode. #### `get_event_stream()` - **Description**: Gets event stream of Layers instance. #### `get_last_error_string()` - **Description**: Gets the last error string. ## Methods ### get_last_error_string Gets the last error string. ### get_last_error_type Gets the last error type. ### get_layers_state Gets LayersState interface. ### get_live_syncing Gets LiveSyncing interface. ### get_specs_linking Gets SpecsLinking interface. ### get_specs_locking Gets SpecsLocking interface. ### set_edit_mode Sets the current edit mode. ## Properties ### usd_context The UsdContext this instance is bound to.
omni.kit.usd.layers.LayerUtils.md
# LayerUtils LayerUtils provides utilities for operating layers. ## Methods - `create_checkpoint(layer_identifier, comment)` - `create_checkpoint_async(layer_identifier, ...)` - `create_checkpoint_for_stage_async(stage, comment)` - `create_sublayer(layer, sublayer_position, ...)` - Creates new sublayer at specific position. - `get_all_sublayers(stage[, ...])` - `get_custom_layer_name(layer)` - Gets the custom name of layer. - `get_dirty_layers(stage[, ...])` - `get_edit_target(stage)` ```code get_layer_global_muteness ``` (root_layer, ...) ```code get_layer_lock_status ``` (root_layer, ...) ```code get_sublayer_identifier ``` (layer_identifier, ...) Gets the sublayer identifier at specific postion with validality. ```code get_sublayer_position_in_parent ``` (...) Gets the sublayer position in the parent layer. ```code has_prim_spec ``` (layer_identifier, prim_spec_path) ```code insert_sublayer ``` (layer, sublayer_position, ...) Inserts new sublayer at specific position. ```code is_layer_writable ``` (layer_identifier) Checks if layer is a writable format or writable on the file system. ```code move_layer ``` (from_parent_layer_identifier, ...) Move sublayer from source parent to position of target parent. ```code reload_all_layers ``` (layer_identifiers) Reloads all layers in batch. ```code remove_layer_global_muteness ``` (root_layer, ...) ```code remove_layer_lock_status ``` (root_layer, ...) ```code remove_prim_spec ``` (layer, prim_spec_path) Utility to remove prim spec from layer. ```code remove_sublayer ``` (layer, position) ```code replace_sublayer ``` (layer, sublayer_position, ...) Replaces new sublayer at specific position. ```code resolve_paths ``` (base_layer, target_layer[, ...]) Resolve all paths from References, Sublayers and AssetPaths of target layer based on source layer. ```code restore_authoring_layer_from_custom_data ``` (stage) ```code restore_muteness_from_custom_data ``` (stage) ## Functions - `save_authoring_layer_to_custom_data` (stage) - `set_custom_layer_name` (layer, name) - Sets the custom name of layer, or clear it if name is empty or None. - `set_edit_target` (stage, layer_identifier) - `set_layer_global_muteness` (root_layer, ...) - `set_layer_lock_status` (root_layer, ...) - `transfer_layer_content` (source_layer, ...[, ...]) - Transfer layer content from source layer to target layer with re-pathing all external dependencies. ## Attributes - `LAYER_AUTHORING_LAYER_CUSTOM_KEY` - `LAYER_LOCK_STATUS_CUSTOM_KEY` - `LAYER_MUTENESS_CUSTOM_KEY` - `LAYER_NAME_CUSTOM_KEY` - `LAYER_OMNI_CUSTOM_KEY` ## Methods ### `__init__()` ### `create_sublayer(layer: Layer, sublayer_position: int, layer_identifier: str)` - Creates new sublayer at specific position. - Parameters: - `layer` (Sdf.Layer) – Layer handle. - `sublayer_position` – Position to create the new layer. Position should be -1 (the last position) or above 0. If position == -1 or position > len(layer.subLayerPaths), it will create the sublayer at the end. Any other position will be treated as invalid index. - `layer_identifier` – New layer path. If it’s empty or None, it will create anonymous layer. - Returns: New sublayer handle or None if sublayer_position is not valid. ### get_custom_layer_name **static** `get_custom_layer_name(layer: Layer) -> str` Gets the custom name of layer. This name is saved inside the custom data of layer. ### get_sublayer_identifier **static** `get_sublayer_identifier(layer_identifier: str, sublayer_position: int) -> str` Gets the sublayer identifier at specific position with validity. **Parameters:** - **layer_identifier** (str) – Parent layer identifier. - **sublayer_position** (int) – Position of sublayer. It must be -1, which means to return the last item. Or it should be equal or above. **Returns:** None if sublayer_position is invalid or overflow. Or sublayer identifier otherwise. ### get_sublayer_position_in_parent **static** `get_sublayer_position_in_parent(parent_layer_identifier: str, layer_identifier: str) -> int` Gets the sublayer position in the parent layer. **Parameters:** - **parent_layer_identifier** (str) – Parent layer identifier. - **layer_identifier** (str) – Layer identifier to query. **Returns:** Position of layer in the subLayerPaths of the parent, or -1 if it cannot be found. ### insert_sublayer **static** `insert_sublayer(layer: Layer, sublayer_position: int) -> None` Insert a sublayer at a specific position. **Parameters:** - **layer** (Layer) – The layer to insert into. - **sublayer_position** (int) – The position to insert the sublayer. ### insert_sublayer Inserts new sublayer at specific position. #### Parameters - **layer** (`Sdf.Layer`) – Layer handle. - **sublayer_position** – Position to insert the new layer. Position should be -1 (the last position) or above 0. If position == -1 or position > len(layer.subLayerPaths), it will insert the sublayer at the end. Any other position will be treated as invalid index. - **layer_identifier** – New layer path. #### Returns Sublayer handle or None if sublayer_position is not valid or layer_identifier is empty or inserted layer is not existed. ### is_layer_writable Checks if layer is a writable format or writable on the file system. ### move_layer Move sublayer from source parent to position of target parent. #### Parameters - **from_parent_layer_identifier** – The parent of source sublayer. - **from_sublayer_position** – The sublayer position to be moved. - **to_parent_layer_identifier** – The parent of target sublayer. - **to_sublayer_position** – The sublayer position in target parent that source moves to. - **remove_source** – Removes the source sublayer or not from source parent after move. If from_parent_layer_identifier == to_parent_layer_layer_identifier, it will always be True. #### Returns True if it’s successful, False otherwise. ### reload_all_layers ### LayerUtils.reload_all_layers Reloads all layers in batch. ### LayerUtils.remove_prim_spec Utility to remove prim spec from layer. #### Parameters - **layer** (`Sdf.Layer`) – Layer handle. - **prim_spec_path** (`Union[str, Sdf.Path]`) – Path of prim spec. #### Returns True if success, or False otherwise. ### LayerUtils.replace_sublayer Replaces new sublayer at specific position. #### Parameters - **layer** (`Sdf.Layer`) – Layer handle. - **sublayer_position** – Position to insert the new layer. Position should be less than len(layer.subLayerPaths). Any other position will be treated as invalid index. - **layer_identifier** – New layer path. #### Returns Sublayer handle or None if sublayer_position is not valid or layer_identifier is empty or replaced layer is not existed. ### LayerUtils.resolve_paths ### resolve_paths Resolve all paths from References, Sublayers and AssetPaths of target layer based on source layer. This function is used normally when you transfer the content from source layer to target layer that are not in the same directory. So it needs to resolve all references so that they point to correct location. #### Parameters - **base_layer** (`Sdf.Layer`) – Source layer that references in target layer based on. - **target_layer** (`Sdf.Layer`) – Target layer to resolve. - **store_relative_path** (`bool`) – True to store relative path, or False to store absolute path. if relative path cannot be computed (like source layer and target are not in the same domain), it will save absolute paths. - **relative_to_base_layer** (`bool`) – True if the relative path is computed against the target_layer. False otherwise. - **copy_sublayer_offsets** (`bool`) – True to copy sublayer offsets and scales from base to target. ### set_custom_layer_name Sets the custom name of layer, or clear it if name is empty or None. The name is saved inside the custom data of layer and can only be consumed by Kit application. #### Parameters - **layer** (`Layer`) - **name** (`str`) ### transfer_layer_content Transfer layer content from source layer to target layer with re-pathing all external dependencies. #### Parameters - **source_layer** (`Layer`) - **target_layer** (`Layer`) - **copy_custom_data** (`bool`) – True to copy custom data. - **skip_sublayers** (`bool`) – True to skip copying sublayers. - **source_layer** (`Sdf.Layer`) – Source layer handle. - **target_layer** (`Sdf.Layer`) – Target layer handle. - **copy_custom_data** (`bool`) – Whether copying layer metadata or not. - **skip_sublayers** (`bool`) – Whether skipping to copy sublayers or not if copy_custom_data is True.
omni.kit.usd.layers.LinkSpecsCommand.md
# LinkSpecsCommand ## Overview The `LinkSpecsCommand` class is a part of the `omni.kit.usd.layers` module. It is used to link specifications to layers in a USD (Universal Scene Description) context. ## Class Definition ```python class omni.kit.usd.layers.LinkSpecsCommand( spec_paths: Union[str, List[str]], layer_identifiers: Union[str, List[str]], additive: bool = True, hierarchy: bool = False, usd_context: bool = False ) ``` ### Parameters - `spec_paths`: A string or a list of strings representing the paths to the specifications. - `layer_identifiers`: A string or a list of strings identifying the layers. - `additive`: A boolean indicating whether the linking should be additive. Default is `True`. - `hierarchy`: A boolean indicating whether to respect the hierarchy. Default is `False`. - `usd_context`: A boolean indicating the USD context. Default is `False`. ``` ### Union Bases: ```python AbstractLayerCommand ``` Links spec paths to layers. #### Methods | Method | Description | | --- | --- | | `__init__(spec_paths, layer_identifiers[, ...])` | Constructor. | | `do()` | | | `undo()` | | #### `__init__(spec_paths, layer_identifiers, additive=True, hierarchy=False, usd_context=None)` - `spec_paths`: Union[str, List[str]] - `layer_identifiers`: Union[str, List[str]] - `additive`: bool = True - `hierarchy`: bool = False - `usd_context`: Union[str, UsdContext] = None Constructor. **Keyword Arguments** * **spec_paths** (Union[str, List[str]]) – List of spec paths or single spec path to be linked. * **layer_identifiers** (Union[str, List[str]]) – List of layer identifiers or single layer identifier. * **additive** (bool) – Clearing existing links or not. * **hierarchy** (bool) – Linking descendant specs or not. * **usd_context** (Union[str, omni.usd.UsdContext]) – Usd context name or instance. It uses default context if it’s empty.
omni.kit.usd.layers.link_specs.md
# link_specs ## link_specs [ str ] ]
omni.kit.usd.layers.LiveSession.md
# LiveSession ## Class Definition ```python class omni.kit.usd.layers.LiveSession(handle, session_channel, live_syncing) ``` Bases: `object` Python instance of ILayersInstance for the convenience of accessing and querying properties and states of a Live Session. ### Methods | Method | Description | |--------|-------------| | `__init__(handle, session_channel, live_syncing)` | Internal constructor. | | `get_last_modified_time()` | Gets the last modified time of the Live Session. | | `get_peer_user_info(user_id)` | Gets the info of peer user by user id if this session is joined. | ### Attributes | Attribute | Description | |-----------|-------------| | `base_layer_identifier` | The base layer identifier of the Live Session. | | `channel_url` | The channel URL of the Live Session. | | Property | Description | |----------|-------------| | channel_url | The channel url of the Live Session that shares by all users to do communication. | | joined | Returns True if this session is joined locally. | | logged_user | The user that connects the server of base layer. | | logged_user_id | The user id that connects the server of base layer. | | logged_user_name | The user name that connects the server of base layer. | | merge_permission | Whether local user has permission to merge the Live Session or not. | | name | The name of the Live Session. | | owner | The owner name of the Live Session. | | peer_users | All peer users in the Live Session if the session is joined. | | root | The url of the root.live layer for the Live Session in the server. | | shared_link | The session link to be shared. | | url | The physical url of the Live Session in the server. | | valid | Returns true if the session is valid. | ### omni.kit.usd.layers.LiveSession.__init__ ```python __init__(handle, session_channel, live_syncing) ``` Internal constructor. ### omni.kit.usd.layers.LiveSession.get_last_modified_time ```python get_last_modified_time() ``` ### get_last_modified_time Gets the last modified time of the Live Session. The modified time is fetched from the session config file. It can be used to sort the Live Session list in access order. ### get_peer_user_info(user_id) → LiveSessionUser Gets the info of peer user by user id if this session is joined. ### base_layer_identifier : str The base layer identifier of the Live Session. ### channel_url : str The channel url of the Live Session that shares by all users to do communication. ### joined : bool Returns True if this session is joined locally. ### logged_user : LiveSessionUser The user that connects the server of base layer. It’s also the user that joins the Live Session, and can be uniquely identified in the Live Session with user id. ### logged_user_id : str The user id that connects the server of base layer. And it’s also the user that joins the Live Session. ### logged_user_name : str The user name that connects the server of base layer. And it’s also the user that joins the Live Session. ### merge_permission : bool <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.usd.layers.LiveSession.merge_permission"> <em class="property"> <span class="pre"> property </span> <span class="w"> </span> </em> <span class="sig-name descname"> <span class="pre"> merge_permission </span> </span> <em class="property"> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="pre"> bool </span> </em> </dt> <dd> <p> Whether local user has permission to merge the Live Session or not. It’s possible that the local user is the owner but this returns False as if multiple instances of the same user join the same session, only one of them will be the runtime owner. </p> </dd> </dl> <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.usd.layers.LiveSession.name"> <em class="property"> <span class="pre"> property </span> <span class="w"> </span> </em> <span class="sig-name descname"> <span class="pre"> name </span> </span> <em class="property"> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="pre"> str </span> </em> </dt> <dd> <p> The name of the Live Session. </p> </dd> </dl> <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.usd.layers.LiveSession.owner"> <em class="property"> <span class="pre"> property </span> <span class="w"> </span> </em> <span class="sig-name descname"> <span class="pre"> owner </span> </span> <em class="property"> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="pre"> str </span> </em> </dt> <dd> <p> The owner name of the Live Session. It returns the static owner name of the session only. If it has multiple instances of the same user join the same session, only one of the owner has the real merge_permission. </p> </dd> </dl> <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.usd.layers.LiveSession.peer_users"> <em class="property"> <span class="pre"> property </span> <span class="w"> </span> </em> <span class="sig-name descname"> <span class="pre"> peer_users </span> </span> <em class="property"> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="pre"> List </span> <span class="p"> <span class="pre"> [ </span> </span> <span class="pre"> LiveSessionUser </span> <span class="p"> <span class="pre"> ] </span> </span> </em> </dt> <dd> <p> All peer users in the Live Session if the session is joined. </p> </dd> </dl> <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.usd.layers.LiveSession.root"> <em class="property"> <span class="pre"> property </span> <span class="w"> </span> </em> <span class="sig-name descname"> <span class="pre"> root </span> </span> <em class="property"> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="pre"> str </span> </em> </dt> <dd> <p> The url of the root.live layer for the Live Session in the server. </p> </dd> </dl> <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.usd.layers.LiveSession.shared_link"> <em class="property"> <span class="pre"> property </span> <span class="w"> </span> </em> <span class="sig-name descname"> <span class="pre"> shared_link </span> </span> <em class="property"> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="pre"> str </span> </em> </dt> <dd> <p> The session link to be shared. Shared link is different as url, so url points to the physical location of the Live Session that local user can get access to, while session link is the URL that you can share to others, and can be launched from Omniverse launcher and other apps could parse it and decide the action from it. The session name is passed as the query parameter to the base layer url, for example, omniverse://localhost/test/stage.usd?live_session_name=my_session. </p> </dd> </dl> <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.usd.layers.LiveSession.url"> <em class="property"> <span class="pre"> property </span> <span class="w"> </span> </em> <span class="sig-name descname"> <span class="pre"> url </span> </span> <em class="property"> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="pre"> str </span> </em> </dt> <dd> <p> The physical url of the Live Session in the server. </p> </dd> </dl> <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.usd.layers.LiveSession.valid"> <em class="property"> <span class="pre"> property </span> <span class="w"> </span> </em> <span class="sig-name descname"> <span class="pre"> valid </span> </span> <em class="property"> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="pre"> bool </span> </em> </dt> <dd> <p> Returns true if the session is valid. Or it’s removed. </p> </dd> </dl>
omni.kit.usd.layers.LiveSessionUser.md
# LiveSessionUser ## LiveSessionUser ```python class omni.kit.usd.layers.LiveSessionUser(user_name, user_id, from_app) ``` Bases: `object` LiveSessionUser represents an peer client instance that joins the same Live Session. ### Methods | Method | Description | |--------|-------------| | `__init__(user_name, user_id, from_app)` | | ### Attributes | Attribute | Description | |-----------|-------------| | `from_app` | | | `user_color` | Tuple of RGB color with each channel ranging from [0, 255]. | | `user_id` | | | `user_name` | | ``` ### LiveSessionUser Class Initialization ```python def __init__( self, user_id, from_app ): ``` ### LiveSessionUser.user_color Property ```python property user_color: Tuple[int, int, int] ``` - **Description**: Tuple of RGB color with each channel ranging from [0, 255]. ```
omni.kit.usd.layers.LiveSyncing.join_live_session_omni.kit.usd.layers.LiveSyncing.md
# LiveSyncing ## LiveSyncing ``` ```markdown Bases: object Live Syncing includes the interfaces to management Live Sessions of all layers in the bound UsdContext. A Live Session is a concept that extends non-destructive live workflow for USD layers so all connectors can join the session to co-work together. Each Live Session is bound to an USD file with unique URL to be identified. And it has only unique instance in the same UsdContext for each layer, which means the Live Sessions can be joined multiple times. User can only join the Live Sessions that belong to the used layers in the bound UsdContext, either those layers are added as sublayers or references/payloads. If a layer is added as both a local sublayer or reference/payload, the sublayer and reference/payload cannot join the same Live Session at the same time. However, a Live Session can be joined multiple times if the corresponding layer is added as multiple references/payloads. Thread Safety: All interfaces of LiveSyncing are not thread-safe. And It’s recommended to call those interfaces in the same loop thread as UsdContext. ### Methods - `__init__(layers_instance, usd_context, ...)` - `broadcast_merge_done_message_async(...)` - Broadcasts merge finished message to other peer clients. - `broadcast_merge_started_message_async(...)` - Broadcasts merge started message to other peer clients. Broadcasts merge started message to other peer clients. create_live_session (name[, layer_identifier]) : Creates a named Live Session. find_live_session_by_name (layer_identifier, ...) : Finds the Live Session with name specified by `session_name`. get_all_current_live_sessions ([prim_path]) : Gets all Live Sessions that are joined for all sublayers of the stage or a specific prim. get_all_live_sessions ([layer_identifier]) : Gets all existing Live Sessions on disk (including joined and not joined ones) for a specific layer. get_current_live_session ([layer_identifier]) : Gets the current Live Session of the base layer joined. get_current_live_session_layers ([...]) : [DEPRECATED] Returns the Live Session layers attached to this Live Session of specific base layer. get_current_live_session_peer_users ([...]) : [DEPRECATED] Returns the list of users that joined in this Live Session. get_live_session_by_url (session_url) : Gets the Live Session by the url. get_live_session_for_live_layer (...) : Gets the Live Session that the live layer is attached to. is_in_live_session () : [DEPRECATED] If root layer is in a Live Session. is_layer_in_live_session ([layer_identifier, ...]) : Checks if the given layer is in a Live Session or not. is_live_session_layer (layer_identifier) : Checks if the layer is the live layer (.live layer) of a Live Session. is_live_session_merge_notice_muted (...) : Checks if layer identifier is in the mute list. is_prim_in_live_session | Function Name | Description | |---------------|-------------| | is_prim_in_live_session (prim_path[, ...]) | If the prim is in any Live Session. | | is_stage_in_live_session () | Checks if any layers that are in the used layers of the current stage are in a Live Session. | | join_live_session (live_session[, prim_path]) | Joins the Live Session. | | join_live_session_by_url (layer_identifier, ...) | Joins the Live Session specified by the Live Session URL. | | merge_and_stop_live_session_async ([...]) | Saves changes of Live Session to their base layer if it's in live mode. | | merge_changes_to_base_layers (stop_session) | [DEPRECATED] Merges changes of root layer's Live Session to its base layer. | | merge_changes_to_specific_layer (...) | [DEPRECATED] Merges changes of root layer's Live Session to specified layer. | | merge_live_session_changes (layer_identifier, ...) | Merge Live Session for base layer. | | merge_live_session_changes_to_specific_layer (...) | Merge Live Session for base layer to specified target layer. | | mute_live_session_merge_notice (layer_identifier) | By default, when session owner merges the session, it will notify peer clients to leave the session by showing a prompt. | | open_stage_with_live_session_async (stage_url) | Opens stage with Live Session joined. | | register_open_stage_addon (callback) | | | stop_all_live_sessions () | Stops all the Live Sessions that are enabled for the current stage. | | stop_live_session ([layer_identifier, prim_path]) | Stops the Live Session for specified layer or prim. | | try_cancelling_live_session_join | | | Description | Text | |-------------|------| | Try to cancel the Live Session when LayerEventType.LIVE_SESSION_JOINING is received. | Try to cancel the Live Session when LayerEventType.LIVE_SESSION_JOINING is received. | | Remove layer identifier from mute list. | Remove layer identifier from mute list. | ### Attributes | Attribute | Description | |-----------|-------------| | layers_instance | Native handle of Layers instance that's bound to an UsdContext. | | permission_to_merge_current_session | [DEPRECATED] Checks to see if it can merge the current Live Session of specified layer. | | usd_context | Instance of UsdContext. | ### Methods #### `__init__(layers_instance: ILayersInstance, usd_context, layers_state)` #### `async broadcast_merge_done_message_async(destroy: bool = True, layer_identifier: Optional[str] = None)` Broadcasts merge finished message to other peer clients. This is normally called after merging the Live Session to its base layer. **Args:** - `destroy (bool): If it needs to destroy the session channel after merging.` - `layer_identifier (str): The base layer of the Live Session.` #### `async broadcast_merge_started_message_async(layer_identifier: Optional[str])` ### Broadcasts merge started message to other peer clients. This is normally called before merging the Live Session to its base layer. ### create_live_session ```python create_live_session(name: str, layer_identifier: Optional[str] = None) -> LiveSession ``` Creates a named Live Session. **Parameters:** - **name** (str) – Name of the session. Currently, name should be unique across all Live Sessions. - **layer_identifier** (str) – The base layer to create a Live Session. If it’s not provided, it will be root layer by default. **Returns:** The Live Session handle if it’s success, or None otherwise. See Layers.get_last_error_type to get more details. ### find_live_session_by_name ```python find_live_session_by_name(layer_identifier: str, session_name: str) -> LiveSession ``` Finds the Live Session with name specified by `session_name`. If it has multiple sessions that has the same name, it will return the first one found. **Parameters:** - **layer_identifier** (str) – The base layer to search Live Sessions. - **session_name** (str) – The session name. ### get_all_current_live_sessions Gets all Live Sessions that are joined for all sublayers of the stage or a specific prim. #### Parameters - **prim_spec** (`Sdf.Path`) – Specified prim to query. If prim_path is not None, it will return all live sessions joined for this prim. If it’s None, it will return the live sessions joined for all sublayers of the current stage. ### get_all_live_sessions Gets all existing Live Sessions on disk (including joined and not joined ones) for a specific layer. See `get_current_live_session` to query joined session for a specific layer. #### Parameters - **layer_identifier** (`str`) – The base layer to query Live Sessions. If it’s empty, it will be root layer by default. #### Returns - A list of Live Sessions. ### get_current_live_session Gets the current Live Session of the base layer joined. #### Parameters - **layer_identifier** (`str`) – Base layer identifier. It’s root layer if it’s not provided. ### get_current_live_session_layers ### get_current_live_session_layers [DEPRECATED] Returns the Live Session layers attached to this Live Session of specific base layer. ### get_current_live_session_peer_users [DEPRECATED] Returns the list of users that joined in this Live Session. **Parameters** - **layer_identifier** (str) – It’s root layer if it’s not provided. ### get_live_session_by_url Gets the Live Session by the url. It can only get the Live Session belongs to one of the used layers in the current stage. ### get_live_session_for_live_layer Gets the Live Session that the live layer is attached to. **Parameters** - **live_layer_identifier** (str) – The .live layer that’s in the Live Session. ### is_in_live_session Returns whether the current context is in a Live Session. [DEPRECATED] If root layer is in a Live Session. ```python is_layer_in_live_session(layer_identifier: Optional[str] = None, live_prim_only: bool = False) -> bool ``` Checks if the given layer is in a Live Session or not. Parameters: - **layer_identifier** (str) – Base layer identifier. Root layer by default. - **live_prim_only** (bool) – When live_prim_only is True, it will only check the Live Sessions that are bound to reference/payload prims for the base layer. Otherwise, it will check all. False by default. ```python is_live_session_layer(layer_identifier: str) -> bool ``` Checks if the layer is the live layer (.live layer) of a Live Session. ```python is_live_session_merge_notice_muted(layer_identifier: str) -> bool ``` Checks if layer identifier is in the mute list. ```python is_prim_in_live_session(prim_path: Path, layer_identifier: Optional[str] = None) -> bool ``` Checks if the given prim path is in a Live Session. ### is_prim_in_live_session If the prim is in any Live Session. #### Parameters - **prim_path** (Sdf.Path) – Prim path to check. - **layer_identifier** (str) – If layer identifier is specified, it will check if prim is in the Live Session of that layer only. - **from_reference_or_payload_only** (bool) – If it’s True, it will check only references and payloads to see if the same Live Session is enabled already. Otherwise, it checks both the prim specified by primPath and its references and payloads. This is normally used to check if the Live Session can be stopped as the prim that is in the Live Session may not own the Live Session, which is owned by its references or payloads, so it cannot stop the Live Session with the specified prim. ### is_stage_in_live_session Checks if any layers that are in the used layers of the current stage are in a Live Session. ### join_live_session Joins the Live Session. #### Parameters - **live_session** (LiveSession) – The Live Session to join. The base layer of the Live Session must be in the used layers of the current stage. - **prim_path** (Union[Sdf.Path, str]) – If prim path is provided, it means to join a Live Session for a reference or payload prim. #### Returns True if it joins the session successfully. False otherwise. See Layers.get_last_error_type to get more details. ### join_live_session_by_url **Parameters** - **layer_identifier** (`str`) – The base layer of the Live Session. - **live_session_url** (`str`) – The unique URL of the Live Session. The Live Session must be created against with the base layer, otherwise, it will fail to join. - **create_if_not_existed** (`bool`) – Creates the Live Session if it does not exist. **Returns** - `bool` – True if it joins the session successfully. False otherwise. See Layers.get_last_error_type to get more details. ### merge_and_stop_live_session_async **Parameters** - **target_layer** (`Optional[str]` = `None`) - **comment** (`str` = `''`) - **pre_merge** (`Optional[Callable[[LiveSession], Awaitable]]` = `None`) - **post_merge** (`Optional[Callable[[bool], Awaitable]]` = `None`) ### merge_and_stop_live_session_async ```python async def merge_and_stop_live_session_async( target_layer: str = None, comment: str = None, pre_merge: Optional[Callable[[LiveSession], Awaitable]] = None, post_merge: Optional[Callable[[bool, str], Awaitable]] = None, layer_identifier: Optional[str] = None ) -> bool ``` Saves changes of Live Session to their base layer if it’s in live mode. #### Parameters - **target_layer** (str) – Target layer to merge all live changes to. - **comment** (str) – The checkpoint comments. - **pre_merge** (Callable[[LiveSession], Awaitable]) – It will be called before merge. - **post_merge** (Callable[[bool, str], Awaitable]) – It will be called after merge is done. The first param means if it’s successful, and the second includes the error message if it’s not. - **layer_identifier** (str) – The base layer of the Live Session. It’s root layer if it’s not provided. ### merge_changes_to_base_layers ```python def merge_changes_to_base_layers(stop_session: bool) -> bool ``` [DEPRECATED] Merges changes of root layer’s Live Session to its base layer. ### merge_changes_to_specific_layer ```python def merge_changes_to_specific_layer( target_layer_identifier: str, stop_session: bool, clear_target_layer: bool ) -> bool ``` [DEPRECATED] Merges changes of root layer’s Live Session to specified layer. ```python merge_live_session_changes(layer_identifier: str, stop_session: bool) -> bool ``` Merge Live Session for base layer. **Parameters** - **layer_identifier** (`str`) – The base layer to merge Live Session. - **stop_session** (`bool`) – Stops the Live Session or not after merging. **Returns** - `True` if successful, `False` otherwise. If `False`, it might be due to the layer not being in the used layers of the current stage, having no Live Session joined, or lacking permissions to merge the Live Session. See `Layers.get_last_error_type` for more details. ```python merge_live_session_changes_to_specific_layer(layer_identifier: str, target_layer_identifier: str, stop_session: bool, clear_target_layer: bool) -> bool ``` Merge Live Session for base layer to specified target layer. **Parameters** - **layer_identifier** (`str`) – The base layer to merge Live Session. - **target_layer_identifier** (`str`) – The target layer to merge the Live Session. - **stop_session** (`bool`) – Stops the Live Session or not after merging. - **clear_target_layer** (`bool`) – If it needs to clear the target layer before merging. **Returns** - `True` if successful, `False` otherwise. If `False`, it might be due to the layer not being in the used layers of the current stage, having no Live Session joined, or lacking permissions to merge the Live Session. See `Layers.get_last_error_type` for more details. ### mute_live_session_merge_notice By default, when session owner merges the session, it will notify peer clients to leave the session by showing a prompt. This is used to disable the prompt and stop session directly so it will not be disruptive especially for applications that don’t have layer window and manages all layers’ Live Sessions with scripting and don’t want to receive prompt for leaving sessions. ### open_stage_with_live_session_async Opens stage with Live Session joined. This function is used to reduce the composition cost of opening a stage, then joining a Live Session by preparing the Live Session in the session layer before opening the stage. It supports to pass the name of Live Session as query string, for example, `omniverse://localhost/test/stage.usd?live_session_name=my_session`. #### Parameters - **stage_url** (str) – The stage url to open. - **session_name** (str) – If the session name is not provided in the stage url, this param will be used. If both stage url and this param don’t include a valid session, it will return false. #### Returns A (bool, str) tuple, where the first element means if it’s success, and the error string in the second. ### stop_all_live_sessions Stops all the Live Sessions that are enabled for the current stage. ### stop_live_session Stops the Live Session for specified layer or prim. #### Parameters - **layer_identifier** (str) – The base layer to stop its current Live Session. If it’s None and prim_path is None, it’s root layer by default. - **prim_path** (Sdf.Path) – The specified prim to stop the Live Session. If prim_path is given, and layer_identifier is None, it will stop all joined Live Sessions for this prim. Or if layer_identifier is not None, it will stop only the Live Session for the layer. ### try_cancelling_live_session_join ```python try_cancelling_live_session_join(layer_identifier: str) -> Optional[LiveSession] ``` Try to cancel the Live Session when LayerEventType.LIVE_SESSION_JOINING is received. **Parameters:** - **layer_identifier** (str) – The base layer to cancel. **Returns:** - Instance of Live Session if it’s cancelled successfully. Or None otherwise. ### unmute_live_session_merge_notice ```python unmute_live_session_merge_notice(layer_identifier: str) ``` Remove layer identifier from mute list. ### layers_instance ```python property layers_instance: ILayersInstance ``` Native handle of Layers instance that’s bound to an UsdContext. ### permission_to_merge_current_session ```python property permission_to_merge_current_session: bool ``` [DEPRECATED] Checks to see if it can merge the current Live Session of specified layer. **Parameters:** - **layer_identifier** (str) – The base layer of the Live Session. It’s root layer if it’s not provided. ### usd_context ```python property usd_context: UsdContext ``` Instance of UsdContext.
omni.kit.usd.layers.LockLayerCommand.md
# LockLayerCommand ## Summary Class `LockLayerCommand` in `omni.kit.usd.layers` sets the lock state for a layer. ### Constructor `__init__(layer_identifier: str, locked: bool, usd_context: Union[str, UsdContext] = '')` ### Methods - `__init__(layer_identifier, locked[, usd_context])`: Constructor. - `do_impl()`: Abstract do function to be implemented. | Description | | --- | | `undo_impl()` | | Abstract undo function to be implemented. | | Description | | --- | | `__init__(layer_identifier: str, locked: bool, usd_context: Union[str, UsdContext] = '')` | | Constructor. REMINDER: Locking root layer is not permitted. | | **Keyword Arguments** | | - **layer_identifier** (str) – The identifier of layer to be muted/unmuted. | | - **locked** (bool) – Muted or not of this layer. | | - **usd_context** (Union[str, UsdContext]) – Usd context name or instance. It uses default context if it’s empty. | | Description | | --- | | `do_impl()` | | Abstract do function to be implemented. | | Description | | --- | | `undo_impl()` | | Abstract undo function to be implemented. |
omni.kit.usd.layers.LockSpecsCommand.md
# LockSpecsCommand ## Class: omni.kit.usd.layers.LockSpecsCommand ### Constructor ```python __init__(spec_paths: Union[str, List[str]], hierarchy: bool = False, usd_context: Union[str, UsdContext] = '') ``` **Bases:** `AbstractLayerCommand` **Description:** Locks spec paths in the UsdContext. **Methods:** - `__init__(spec_paths[, hierarchy, usd_context])` | Constructor. | | --- | | `do`() | | `undo`() | ### __init__ Constructor. **Keyword Arguments** - **spec_paths** (Union[str, List[str]]) – List of spec paths or single spec path to be locked. - **hierarchy** (bool) – Locking descendant specs or not. - **usd_context** (Union[str, omni.usd.UsdContext]) – Usd context name or instance. It uses default context if it’s empty.
omni.kit.usd.layers.lock_specs.md
# lock_specs ## lock_specs ```python omni.kit.usd.layers.lock_specs(usd_context, spec_paths: Union[str, Path, List[Union[str, Path]]], hierarchy = False) -> List[str] ``` - **usd_context** - **spec_paths**: Union[str, Path, List[Union[str, Path]]] - **hierarchy**: default is False - **Returns**: List[str] ```
omni.kit.usd.layers.MergeLayersCommand.md
# MergeLayersCommand ## MergeLayersCommand ```python class omni.kit.usd.layers.MergeLayersCommand( dst_parent_layer_identifier: str, dst_layer_identifier, src_parent_layer_identifier: str, src_layer_identifier: str, dst_stronger_than_src: bool, usd_context: Union[str, UsdContext] = '', src_layer_offset: LayerOffset = Sdf.LayerOffset() ) ``` Bases: AbstractLayerCommand Merges two layers. ### Methods | Method | Description | |--------|-------------| | `__init__(dst_parent_layer_identifier, dst_layer_identifier, src_parent_layer_identifier, src_layer_identifier, dst_stronger_than_src: bool = True, usd_context: Union[str, UsdContext] = '', src_layer_offset: LayerOffset = Sdf.LayerOffset())` | Constructor. | | `do_impl()` | Abstract do function to be implemented. | | `undo_impl()` | Abstract undo function to be implemented. | #### `__init__(dst_parent_layer_identifier, dst_layer_identifier, src_parent_layer_identifier, src_layer_identifier, dst_stronger_than_src: bool = True, usd_context: Union[str, UsdContext] = '', src_layer_offset: LayerOffset = Sdf.LayerOffset())` Constructor. **Keyword Arguments:** - **dst_parent_layer_identifier** – The parent of target layer. - **dst_layer_identifier** – The target layer that source layer is merged to. - **src_parent_layer_identifier** – The parent of source layer. - **src_layer_identifier** – The source layer. - **dst_stronger_than_src** (bool) – If target layer is stronger than source, which will decide how to merge opinions that appear in both layers. - **usd_context** (Union[str, UsdContext]) – - **src_layer_offset** (LayerOffset) – - **context** ([str, omni.usd.UsdContext]) – Usd context name or instance. It uses default context if it’s empty. - **src_layer_offset** (Sdf.LayerOffset) – The source layer offset to target layer. By default, it’s identity. ### do_impl() Abstract do function to be implemented. ### undo_impl() Abstract undo function to be implemented.
omni.kit.usd.layers.MovePrimSpecsToLayerCommand.md
# MovePrimSpecsToLayerCommand ## MovePrimSpecsToLayerCommand <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> __init__ </span> </code> </a> (dst_layer_identifier, ...[, ...]) </p> </td> <td> <p> Constructor. </p> </td> </tr> <tr class="row-even"> <td> <p> <a class="reference internal" href="#omni.kit.usd.layers.MovePrimSpecsToLayerCommand.do_impl" title="omni.kit.usd.layers.MovePrimSpecsToLayerCommand.do_impl"> <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> do_impl </span> </code> </a> ()</p> </td> <td> <p> Abstract do function to be implemented. </p> </td> </tr> <tr class="row-odd"> <td> <p> <a class="reference internal" href="#omni.kit.usd.layers.MovePrimSpecsToLayerCommand.undo_impl" title="omni.kit.usd.layers.MovePrimSpecsToLayerCommand.undo_impl"> <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> undo_impl </span> </code> </a> ()</p> </td> <td> <p> Abstract undo function to be implemented. </p> </td> </tr> </tbody> </table> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.usd.layers.MovePrimSpecsToLayerCommand.__init__"> <span class="sig-name descname"> <span class="pre"> __init__ </span> </span> <span class="sig-paren"> ( </span> <em class="sig-param"> <span class="n"> <span class="pre"> dst_layer_identifier </span> </span> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="n"> <span class="pre"> str </span> </span> </em> , <em class="sig-param"> <span class="n"> <span class="pre"> src_layer_identifier </span> </span> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="n"> <span class="pre"> str </span> </span> </em> , <em class="sig-param"> <span class="n"> <span class="pre"> prim_spec_path </span> </span> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="n"> <span class="pre"> str </span> </span> </em> , <em class="sig-param"> <span class="n"> <span class="pre"> dst_stronger_than_src </span> </span> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="n"> <span class="pre"> bool </span> </span> </em> , <em class="sig-param"> <span class="n"> <span class="pre"> usd_context </span> </span> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="n"> <span class="pre"> Union </span> <span class="p"> <span class="pre"> [ </span> </span> <span class="pre"> str </span> <span class="p"> <span class="pre"> , </span> </span> <span class="w"> </span> <span class="pre"> UsdContext </span> <span class="p"> <span class="pre"> ] </span> </span> </span> <span class="w"> </span> <span class="o"> <span class="pre"> = </span> </span> <span class="w"> </span> <span class="default_value"> <span class="pre"> '' </span> </span> </em> <span class="sig-paren"> ) </span> <a class="headerlink" href="#omni.kit.usd.layers.MovePrimSpecsToLayerCommand.__init__" title="Permalink to this definition">  </a> </dt> <dd> <p> Constructor. </p> <dl class="field-list simple"> <dt class="field-odd"> Keyword Arguments </dt> <dd class="field-odd"> <ul class="simple"> <li> <p> <strong> dst_layer_identifier </strong> ( <em> str </em> ) – The identifier of target layer. </p> </li> <li> <p> <strong> src_layer_identifier </strong> ( <em> str </em> ) – The identifier of source layer. </p> </li> <li> <p> <strong> prim_spec_path </strong> ( <em> str </em> ) – The prim spec path to be merged. </p> </li> <li> <p> <strong> dst_stronger_than_src </strong> ( <em> bool </em> ) – Target layer is stronger than source layer in stage. </p> </li> <li> <p> <strong> usd_context </strong> ( <em> Union </em> <em> [ </em> <em> str </em> <em> , </em> <em> omni.usd.UsdContext </em> <em> ] </em> ) – Usd context name or instance. It uses default context if it’s empty. </p> </li> </ul> </dd> </dl> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.usd.layers.MovePrimSpecsToLayerCommand.do_impl"> <span class="sig-name descname"> <span class="pre"> do_impl </span> </span> <span class="sig-paren"> ( </span> <span class="sig-paren"> ) </span> <a class="headerlink" href="#omni.kit.usd.layers.MovePrimSpecsToLayerCommand.do_impl" title="Permalink to this definition">  </a> </dt> <dd> <p> Abstract do function to be implemented. </p> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.usd.layers.MovePrimSpecsToLayerCommand.undo_impl"> <span class="sig-name descname"> <span class="pre"> undo_impl </span> </span> <span class="sig-paren"> ( </span> <span class="sig-paren"> ) </span> <a class="headerlink" href="#omni.kit.usd.layers.MovePrimSpecsToLayerCommand.undo_impl" title="Permalink to this definition">  </a> </dt> <dd> <p> Abstract undo function to be implemented. </p> </dd> </dl> </dd> </dl> </section> </div> </div> <footer> <hr/> </footer> </div> </div> </section> </div> ``` 请注意,上述Markdown代码实际上是无效的,因为它直接复制了HTML的结束标签,这在Markdown中是不被识别的。为了提供一个有效的转换示例,我需要具体的HTML内容。例如,如果HTML中有段落和链接,转换可能如下: ```html <p>这是一个包含 <a href="http://example.com">链接</a> 的段落。</p> ``` 转换为Markdown: ```markdown 这是一个包含 [链接] 的段落。 ``` 在这个例子中,链接的URL被删除,但链接文本被保留。如果HTML中有图片,例如: ```html <img src="image.jpg" alt="描述图片的文本"> ``` 转换为Markdown时,图片会被删除: ```markdown 描述图片的文本
omni.kit.usd.layers.MoveSublayerCommand.md
# MoveSublayerCommand ## MoveSublayerCommand ```python class omni.kit.usd.layers.MoveSublayerCommand: def __init__(self, from_parent_layer_identifier: str, from_sublayer_position: int, to_parent_layer_identifier: str, to_sublayer_position: int, remove_source: bool = False, usd_context: Union[str, UsdContext] = ''): pass ``` This class is a part of the `omni.kit.usd.layers` module. AbstractLayerCommand Moves sublayer from one location to the other. ### Methods | Method | Description | |--------|-------------| | `__init__(from_parent_layer_identifier, from_sublayer_position, to_parent_layer_identifier, to_sublayer_position, remove_source=False, usd_context='')` | Constructor. | | `do_impl()` | Abstract do function to be implemented. | | `undo_impl()` | Abstract undo function to be implemented. | #### `__init__(from_parent_layer_identifier, from_sublayer_position, to_parent_layer_identifier, to_sublayer_position, remove_source=False, usd_context='')` Constructor. **Keyword Arguments:** - **from_parent_layer_identifier** (str) – The identifier of source parent layer. - **from_sublayer_position** (int) – The sublayer position in source parent layer to move. - **to_parent_layer_identifier** (str) – The identifier of target parent layer. - **to_sublayer_position** (int) – The sublayer position in target parent layer that layers moves to. If this position is -1, it means the last position of sublayer array. If this position is beyond the end of sublayer array, it means to move this layer to the end of that array. Otherwise, it’s invalid if it’s below 0. - **remove_source** (bool) – Remove source sublayer after moving to target or not. **usd_context** (**Union** [**str**, **omni.usd.UsdContext**]) – Usd context name or instance. It uses default context if it’s empty. ### do_impl Abstract do function to be implemented. ### undo_impl Abstract undo function to be implemented.
omni.kit.usd.layers.RemovePrimSpecCommand.md
# RemovePrimSpecCommand ## RemovePrimSpecCommand ``` class omni.kit.usd.layers.RemovePrimSpecCommand(layer_identifier: str, prim_spec_path: Union[Path, List[Path]], usd_context: Union[str, UsdContext] = '') ``` Bases: `Command` Removes prim spec from a layer. ### Methods - `__init__(layer_identifier, prim_spec_path[, ...])` - Constructor. ``` | do | | --- | | undo | ### omni.kit.usd.layers.RemovePrimSpecCommand.__init__ __init__(layer_identifier: str, prim_spec_path: Union[Path, List[Path]], usd_context: Union[str, UsdContext] = '') Constructor. **Keyword Arguments** - **layer_identifier** (str) – The identifier of layer to remove prim. - **prim_spec_path** (Union[Sdf.Path, List[Sdf.Path]]) – The prim paths to be removed. - **usd_context** (Union[str, omni.usd.UsdContext]) – Usd context name or instance. It uses default context if it’s empty.
omni.kit.usd.layers.RemoveSublayerCommand.md
# RemoveSublayerCommand ## RemoveSublayerCommand ``` ```markdown class omni.kit.usd.layers.RemoveSublayerCommand(layer_identifier: str, sublayer_position: int, usd_context: Union[str, UsdContext] = '') ``` ```markdown Bases: AbstractLayerCommand ``` ```markdown Removes a sublayer from parent layer. ``` ```markdown ## Methods ``` ```markdown __init__(layer_identifier, sublayer_position) Constructor. ``` ```markdown do_impl() Abstract do function to be implemented. ``` <table> <tbody> <tr class="row-even"> <td> <p> <a class="reference internal" href="#omni.kit.usd.layers.RemoveSublayerCommand.do_impl" title="omni.kit.usd.layers.RemoveSublayerCommand.do_impl"> <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> do_impl </span> </code> </a> () </p> </td> <td> <p> Abstract do function to be implemented. </p> </td> </tr> <tr class="row-odd"> <td> <p> <a class="reference internal" href="#omni.kit.usd.layers.RemoveSublayerCommand.undo_impl" title="omni.kit.usd.layers.RemoveSublayerCommand.undo_impl"> <code class="xref py py-obj docutils literal notranslate"> <span class="pre"> undo_impl </span> </code> </a> () </p> </td> <td> <p> Abstract undo function to be implemented. </p> </td> </tr> </tbody> </table> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.usd.layers.RemoveSublayerCommand.__init__"> <span class="sig-name descname"> <span class="pre"> __init__ </span> </span> <span class="sig-paren"> ( </span> <em class="sig-param"> <span class="n"> <span class="pre"> layer_identifier </span> </span> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="n"> <span class="pre"> str </span> </span> </em> , <em class="sig-param"> <span class="n"> <span class="pre"> sublayer_position </span> </span> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="n"> <span class="pre"> int </span> </span> </em> , <em class="sig-param"> <span class="n"> <span class="pre"> usd_context </span> </span> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="n"> <span class="pre"> Union </span> <span class="p"> <span class="pre"> [ </span> </span> <span class="pre"> str </span> <span class="p"> <span class="pre"> , </span> </span> <span class="w"> </span> <span class="pre"> UsdContext </span> <span class="p"> <span class="pre"> ] </span> </span> </span> <span class="w"> </span> <span class="o"> <span class="pre"> = </span> </span> <span class="w"> </span> <span class="default_value"> <span class="pre"> '' </span> </span> </em> <span class="sig-paren"> ) </span> </dt> <dd> <p> Constructor. </p> <dl class="field-list simple"> <dt class="field-odd"> Keyword Arguments </dt> <dd class="field-odd"> <ul class="simple"> <li> <p> <strong> layer_identifier </strong> ( <em> str </em> ) – The identifier of layer to remove sublayer. </p> </li> <li> <p> <strong> sublayer_position </strong> ( <em> int </em> ) – The sublayer position to be removed. </p> </li> <li> <p> <strong> usd_context </strong> ( <em> Union </em> <em> [ </em> <em> str </em> <em> , </em> <em> omni.usd.UsdContext </em> <em> ] </em> ) – Usd context name or instance. It uses default context if it’s empty. </p> </li> </ul> </dd> </dl> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.usd.layers.RemoveSublayerCommand.do_impl"> <span class="sig-name descname"> <span class="pre"> do_impl </span> </span> <span class="sig-paren"> ( </span> <span class="sig-paren"> ) </span> </dt> <dd> <p> Abstract do function to be implemented. </p> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.usd.layers.RemoveSublayerCommand.undo_impl"> <span class="sig-name descname"> <span class="pre"> undo_impl </span> </span> <span class="sig-paren"> ( </span> <span class="sig-paren"> ) </span> </dt> <dd> <p> Abstract undo function to be implemented. </p> </dd> </dl>
omni.kit.usd.layers.ReplaceSublayerCommand.md
# ReplaceSublayerCommand ## Class Definition ```python class omni.kit.usd.layers.ReplaceSublayerCommand(layer_identifier: str, sublayer_position: int, new_layer_path: str, usd_context: Union[str, UsdContext] = '') ``` **Bases:** [`AbstractLayerCommand`](omni.kit.usd.layers._impl.layer_commands.AbstractLayerCommand) **Description:** Replaces sublayer with a new layer. ## Methods | Method | Description | |--------|-------------| | `__init__(layer_identifier, sublayer_position, new_layer_path, [usd_context])` | Constructor. | | `do_impl()` | | ``` | Method | Description | |--------|-------------| | `do_impl()` | Abstract do function to be implemented. | | `undo_impl()` | Abstract undo function to be implemented. | ### `__init__(layer_identifier: str, sublayer_position: int, new_layer_path: str, usd_context: Union[str, UsdContext] = '')` Constructor. **Keyword Arguments:** - **layer_identifier** (str) – The identifier of layer to replace sublayer. - **sublayer_position** (int) – The sublayer position to be replaced. - **new_layer_path** (str) – The path of new layer. - **usd_context** (Union[str, UsdContext]) – Usd context name or instance. It uses default context if it’s empty. ### `do_impl()` Abstract do function to be implemented. ### `undo_impl()` Abstract undo function to be implemented.
omni.kit.usd.layers.SetEditTargetCommand.md
# SetEditTargetCommand ## SetEditTargetCommand ```python class omni.kit.usd.layers.SetEditTargetCommand(layer_identifier: str, usd_context: Union[str, UsdContext] = '') ``` **Bases:** [AbstractLayerCommand](omni.kit.usd.layers._impl.layer_commands.AbstractLayerCommand) **Description:** Sets layer as Edit Target. ### Methods - **__init__(layer_identifier[, usd_context])** - **Description:** Constructor. - **do_impl()** - **Description:** Abstract do function to be implemented. - **undo_impl()** - **Description:** Abstract undo function to be implemented. ``` | Abstract undo function to be implemented. | | --- | | Constructor. | | Keyword Arguments | | - **layer_identifier** (str) – Layer identifier. | | - **usd_context** (Union[str, omni.usd.UsdContext]) – Usd context name or instance. It uses default context if it’s empty. | | Abstract do function to be implemented. | | Abstract undo function to be implemented. |
omni.kit.usd.layers.SetLayerMutenessCommand.md
# SetLayerMutenessCommand ## SetLayerMutenessCommand ```python class omni.kit.usd.layers.SetLayerMutenessCommand(layer_identifier: str, muted: bool, usd_context: Union[str, UsdContext] = '') ``` Bases: `AbstractLayerCommand` Sets mute state for layer. ### Methods | Method | Description | | --- | --- | | `__init__(layer_identifier, muted[, usd_context])` | Constructor. | | `do_impl()` | Abstract do function to be implemented. | ``` <table> <tbody> <tr class="row-odd"> <td> <p> <code>undo_impl</code> () </p> </td> <td> <p> Abstract undo function to be implemented. </p> </td> </tr> </tbody> </table> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.usd.layers.SetLayerMutenessCommand.__init__"> <span class="sig-name descname"> <span class="pre"> __init__ </span> </span> <span class="sig-paren"> ( </span> <em class="sig-param"> <span class="n"> <span class="pre"> layer_identifier </span> </span> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="n"> <span class="pre"> str </span> </span> </em> , <em class="sig-param"> <span class="n"> <span class="pre"> muted </span> </span> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="n"> <span class="pre"> bool </span> </span> </em> , <em class="sig-param"> <span class="n"> <span class="pre"> usd_context </span> </span> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="n"> <span class="pre"> Union </span> <span class="p"> <span class="pre"> [ </span> </span> <span class="pre"> str </span> <span class="p"> <span class="pre"> , </span> </span> <span class="w"> </span> <span class="pre"> UsdContext </span> <span class="p"> <span class="pre"> ] </span> </span> </span> <span class="w"> </span> <span class="o"> <span class="pre"> = </span> </span> <span class="w"> </span> <span class="default_value"> <span class="pre"> '' </span> </span> </em> <span class="sig-paren"> ) </span> </dt> <dd> <p> Constructor. </p> <dl class="field-list simple"> <dt class="field-odd"> Keyword Arguments </dt> <dd class="field-odd"> <ul class="simple"> <li> <p> <strong> layer_identifier </strong> ( <em> str </em> ) – The identifier of layer to be muted/unmuted. </p> </li> <li> <p> <strong> muted </strong> ( <em> bool </em> ) – Muted or not of this layer. </p> </li> <li> <p> <strong> usd_context </strong> ( <em> Union </em> <em> [ </em> <em> str </em> <em> , </em> <em> omni.usd.UsdContext </em> <em> ] </em> ) – Usd context name or instance. It uses default context if it’s empty. </p> </li> </ul> </dd> </dl> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.usd.layers.SetLayerMutenessCommand.do_impl"> <span class="sig-name descname"> <span class="pre"> do_impl </span> </span> <span class="sig-paren"> ( </span> <span class="sig-paren"> ) </span> </dt> <dd> <p> Abstract do function to be implemented. </p> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.usd.layers.SetLayerMutenessCommand.undo_impl"> <span class="sig-name descname"> <span class="pre"> undo_impl </span> </span> <span class="sig-paren"> ( </span> <span class="sig-paren"> ) </span> </dt> <dd> <p> Abstract undo function to be implemented. </p> </dd> </dl>
omni.kit.usd.layers.SpecsLinking.md
# SpecsLinking ## Methods - `__init__(layers_instance, usd_context)` - `get_all_spec_links()` - `get_spec_layer_links(spec_path[, hierarchy])` - `get_spec_links_for_layer(layer_identifier)` - `is_enabled()` - `is_spec_linked(spec_path[, layer_identifier])` - `link_spec(spec_path, layer_identifier[, ...])` ```code unlink_all_specs ``` ```code unlink_spec (spec_path, layer_identifier[, ...]) ``` ```code unlink_spec_from_all_layers (spec_path[, ...]) ``` ```code unlink_specs_to_layer (layer_identifier) ``` ```code usd_context ``` ```python __init__(layers_instance: ILayersInstance, usd_context) -> None ```
omni.kit.usd.layers.SpecsLocking.md
# SpecsLocking ## Methods ### `__init__(layers_instance, usd_context)` ### `get_all_locked_specs()` ### `is_spec_locked(spec_path)` ### `lock_spec(spec_path[, hierarchy])` ### `unlock_all_specs()` ### `unlock_spec(spec_path[, hierarchy])` ## Attributes ### `usd_context` ``` __init__ ( layers_instance : ILayersInstance, usd_context ) → None ```
omni.kit.usd.layers.SpecsLocking_omni.kit.usd.layers.SpecsLocking.md
# SpecsLocking ## Methods - `__init__(layers_instance, usd_context)` - `get_all_locked_specs()` - `is_spec_locked(spec_path)` - `lock_spec(spec_path[, hierarchy])` - `unlock_all_specs()` - `unlock_spec(spec_path[, hierarchy])` ## Attributes - `usd_context`
omni.kit.usd.layers.StitchPrimSpecsToLayer.md
# StitchPrimSpecsToLayer ## StitchPrimSpecsToLayer ```python class omni.kit.usd.layers.StitchPrimSpecsToLayer(prim_paths: List[str], target_layer_identifier: str, usd_context: Union[str, UsdContext] = '') ``` Bases: `AbstractLayerCommand` Flatten specific prims in the stage. It will remove original prim specs after flatten. ### Methods - `__init__(prim_paths, target_layer_identifier)` - Constructor. - `do_impl()` - (Method description not provided in HTML) ``` <table> <tbody> <tr class="row-even"> <td> <p> <code>do_impl</code>() </p> </td> <td> <p> Abstract do function to be implemented. </p> </td> </tr> <tr class="row-odd"> <td> <p> <code>undo_impl</code>() </p> </td> <td> <p> Abstract undo function to be implemented. </p> </td> </tr> </tbody> </table> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.usd.layers.StitchPrimSpecsToLayer.__init__"> <span class="sig-name descname"> <span class="pre">__init__</span> </span> <span class="sig-paren">(</span> <em class="sig-param"> <span class="n">prim_paths</span> <span class="p">:</span> <span class="n">List[str]</span> </em> , <em class="sig-param"> <span class="n">target_layer_identifier</span> <span class="p">:</span> <span class="n">str</span> </em> , <em class="sig-param"> <span class="n">usd_context</span> <span class="p">:</span> <span class="n">Union[str, UsdContext]</span> <span class="o">=</span> <span class="default_value">''</span> </em> <span class="sig-paren">)</span> </dt> <dd> <p>Constructor.</p> <dl class="field-list simple"> <dt class="field-odd">Keyword Arguments</dt> <dd class="field-odd"> <ul class="simple"> <li> <p> <strong>prim_paths</strong> (List[str]) – A list of prim_paths to flatten with. </p> </li> <li> <p> <strong>target_layer_identifier</strong> (str) – The target layer to store the flatten results. </p> </li> <li> <p> <strong>usd_context</strong> (Union[str, omni.usd.UsdContext]) – Usd context name or instance. It uses default context if it’s empty. </p> </li> </ul> </dd> </dl> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.usd.layers.StitchPrimSpecsToLayer.do_impl"> <span class="sig-name descname"> <span class="pre">do_impl</span> </span> <span class="sig-paren">()</span> </dt> <dd> <p>Abstract do function to be implemented.</p> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.usd.layers.StitchPrimSpecsToLayer.undo_impl"> <span class="sig-name descname"> <span class="pre">undo_impl</span> </span> <span class="sig-paren">()</span> </dt> <dd> <p>Abstract undo function to be implemented.</p> </dd> </dl>
omni.kit.usd.layers.UnlinkSpecsCommand.md
# UnlinkSpecsCommand ## UnlinkSpecsCommand ```python class omni.kit.usd.layers.UnlinkSpecsCommand: def __init__(self, spec_paths: Union[str, List[str]], layer_identifiers: Union[str, List[str]], hierarchy=False, usd_context: Union[str, UsdContext] = ''): pass ``` ``` Bases: ``` ``` AbstractLayerCommand ``` ```markdown Unlinks spec paths to layers. ``` ```markdown Methods ``` ```markdown | | | | ---- | --------------------------------------------------------------- | | __init__ (spec_paths, layer_identifiers[, ...]) | Constructor. | | do () | | | undo () | | ``` ```markdown __init__ (spec_paths: Union[str, List[str]], layer_identifiers: Union[str, List[str]], hierarchy: bool = False, usd_context: Union[str, UsdContext] = '') ``` ```markdown Constructor. ``` ```markdown Keyword Arguments ``` ```markdown * spec_paths (Union[str, List[str]]) – List of spec paths or single spec path to be unlinked. * layer_identifiers (Union[str, List[str]]) – List of layer identifiers or single layer identifier. ``` ```markdown - **hierarchy** (**bool**) – Unlinking descendant specs or not. - **usd_context** (**Union[str, omni.usd.UsdContext]**) – Usd context name or instance. It uses default context if it’s empty.
omni.kit.usd.layers.unlink_all_specs.md
# unlink_all_specs ## unlink_all_specs
omni.kit.usd.layers.unlink_specs.md
# unlink_specs ## unlink_specs ``` ```markdown omni.kit.usd.layers.unlink_specs(usd_context, spec_paths: Union[str, Path, List[Union[str, Path]]], layer_identifiers: Union[str, List[str]], hierarchy = False) -> Dict[str, List[str]] ``` ```markdown Description: This function unlinks specified specifications from all layers in the USD context. Parameters: - usd_context: The USD context to operate on. - spec_paths: The paths of the specifications to unlink. Can be a string, a Path object, or a list of strings or Path objects. - layer_identifiers: The identifiers of the layers to unlink the specifications from. Can be a string or a list of strings. - hierarchy (optional): If set to True, also unlink the specifications from the parent layers. Default is False. Returns: - A dictionary where the keys are the layer identifiers and the values are lists of the paths of the unlinked specifications. ``` ```markdown Example usage: ``` ```python from omni.kit.usd.layers import unlink_specs # Unlink a single specification result = unlink_specs("my_usd_context", "/path/to/spec", "layer1") # Unlink multiple specifications result = unlink_specs("my_usd_context", ["/path/to/spec1", "/path/to/spec2"], ["layer1", "layer2"]) # Unlink with hierarchy result = unlink_specs("my_usd_context", "/path/to/spec", "layer1", hierarchy=True) ``` ```markdown Note: The function operates on the specified USD context and unlinks the specified specifications from the specified layers. If hierarchy is enabled, it also unlinks the specifications from the parent layers. [str]
omni.kit.usd.layers.unlink_specs_from_all_layers.md
# unlink_specs_from_all_layers ## unlink_specs_from_all_layers
omni.kit.usd.layers.unlink_specs_to_layers.md
# unlink_specs_to_layers ## unlink_specs_to_layers
omni.kit.usd.layers.UnlockSpecsCommand.md
# UnlockSpecsCommand ## Class: omni.kit.usd.layers.UnlockSpecsCommand ### Constructor ```python class omni.kit.usd.layers.UnlockSpecsCommand: def __init__(spec_paths: Union[str, List[str]], hierarchy=False, usd_context: Union[str, UsdContext] = '') ``` **Bases:** `AbstractLayerCommand` **Description:** Unlocks spec paths in the UsdContext **Methods:** - `__init__(spec_paths: Union[str, List[str]], hierarchy=False, usd_context: Union[str, UsdContext] = '')` | Constructor. | | --- | | `do`() | | `undo`() | ### `__init__` **Keyword Arguments** - **spec_paths** (`Union`[`str`, `List`[`str`]]) – List of spec paths or single spec path to be unlocked. - **hierarchy** (`bool`) – Unlocking descendant specs or not. - **usd_context** (`Union`[`str`, `omni.usd.UsdContext`]) – Usd context name or instance. It uses default context if it’s empty.
omni.kit.usd.layers.unlock_all_specs.md
# unlock_all_specs ## unlock_all_specs
omni.kit.usd.layers.unlock_specs.md
# unlock_specs ## unlock_specs ```python omni.kit.usd.layers.unlock_specs(usd_context, spec_paths: Union[str, List[str]], hierarchy=False) -> List[str] ``` - **Parameters**: - `usd_context` - `spec_paths`: Union[str, List[str]] - `hierarchy`: bool = False - **Returns**: List[str] ```
omni.kit.usd_undo.Classes.md
# omni.kit.usd_undo Classes ## Classes Summary: | Class Name | Description | |------------|-------------| | [UsdEditTargetUndo](#) | A class for managing undo operations on a USD edit target. | | [UsdLayerUndo](#) | A class for managing undo operations on USD layers. |
omni.kit.usd_undo.layer_undo.UsdEditTargetUndo.md
# UsdEditTargetUndo ## UsdEditTargetUndo ```python class omni.kit.usd_undo.layer_undo.UsdEditTargetUndo(edit_target: EditTarget) ``` Bases: `UsdLayerUndo` A class for managing undo operations on a USD edit target. This class provides methods to reserve and undo changes made to a USD layer through an edit target. **Parameters** - **edit_target** – Usd.EditTarget The edit target to be managed for undo operations. **Methods** - `__init__(edit_target)` - Initializes a UsdEditTargetUndo instance with the given edit target. - `reserve(path[, info])` - Reserves the specified path and info for undo, mapped to the edit target's namespace. ### UsdEditTargetUndo Class #### `__init__(edit_target)` Initializes a UsdEditTargetUndo instance with the given edit target. **Parameters:** - **edit_target** (`Usd.EditTarget`) – The edit target to be managed for undo operations. #### `reserve(path, info=None)` Reserves the specified path and info for undo, mapped to the edit target’s namespace. **Parameters:** - **path** (`Sdf.Path`) – The path to be reserved. - **info** (`str`, optional) – The info key to be reserved. If None, the entire spec is reserved.
omni.kit.usd_undo.layer_undo.UsdLayerUndo.md
# UsdLayerUndo ## UsdLayerUndo ```python class omni.kit.usd_undo.layer_undo.UsdLayerUndo(layer: Layer) ``` A class for managing undo operations on USD layers. This class encapsulates the functionality to reserve changes, perform undo operations, and reset the undo stack for a USD layer. It is designed to work with Sdf.Layer objects, allowing for precise control over the changes made to the layer. **Parameters** - **layer** – Sdf.Layer The Sdf.Layer object on which the undo operations are performed. ### Methods - **__init__(layer)** Initializes the UsdLayerUndo instance. - **reserve(path[, info])** Reserves the changes made to the path in the USD layer to allow undo operations. - **reset()** Resets the internal state of the UsdLayerUndo instance, clearing any changes reserved. - **undo()** Undoes the last reserved change on the USD layer. ``` ## UsdLayerUndo Methods ### reserve Reserves the changes made to the path in the USD layer to allow undo operations. **Parameters:** - **path** (Sdf.Path) – The path in the USD layer to reserve. - **info** (optional) – Additional information about the reservation, default is None. ### reset Resets the internal state of the UsdLayerUndo instance, clearing any changes reserved. ### undo Undoes the last set of changes reserved by the reserve method. **Raises:** - **Exception** – If the layer cannot be found. ## UsdLayerUndo Class ### __init__ Initializes the UsdLayerUndo instance. **Parameters:** - **layer** (Sdf.Layer) – The USD layer to be managed by this undo instance. ### Key A class to represent a key in the undo system for USD layers. **Parameters:** - **path** – Sdf.Path The path associated with the change to be undone. - **info** – Any Optional information associated with the path, such as a specific attribute or metadata key.
omni.kit.usd_undo.md
# omni.kit.usd_undo ## Submodules Summary: - [omni.kit.usd_undo.layer_undo](omni.kit.usd_undo.layer_undo.html) - Contains the class of UsdLayerUndo and UsdEditTargetUndo ## Classes Summary: - [UsdEditTargetUndo](omni.kit.usd_undo/omni.kit.usd_undo.UsdEditTargetUndo.html) - A class for managing undo operations on a USD edit target. - [UsdLayerUndo](omni.kit.usd_undo/omni.kit.usd_undo.UsdLayerUndo.html) - A class for managing undo operations on USD layers.
omni.kit.usd_undo.Submodules.md
# omni.kit.usd_undo Submodules ## omni.kit.usd_undo Submodules ### Submodules Summary: | Module | Description | |--------|-------------| | [omni.kit.usd_undo.layer_undo](omni.kit.usd_undo.layer_undo.html) | Contains the class of UsdLayerUndo and UsdEditTargetUndo |
omni.kit.usd_undo.UsdEditTargetUndo.md
# UsdEditTargetUndo ## UsdEditTargetUndo A class for managing undo operations on a USD edit target. This class provides methods to reserve and undo changes made to a USD layer through an edit target. ### Parameters - **edit_target** – Usd.EditTarget The edit target to be managed for undo operations. ### Methods - **__init__(edit_target)** Initializes a UsdEditTargetUndo instance with the given edit target. - **reserve(path[, info])** Reserves the specified path and info for undo, mapped to the edit target's namespace. ## Parameters - **edit_target** (`Usd.EditTarget`) – The edit target to be managed for undo operations. ## reserve Reserves the specified path and info for undo, mapped to the edit target’s namespace. ### Parameters - **path** (`Sdf.Path`) – The path to be reserved. - **info** (`str`, optional) – The info key to be reserved. If None, the entire spec is reserved.
omni.kit.viewport.docs.Classes.md
# omni.kit.viewport.docs Classes ## Classes Summary - **ViewportDocsExtension** - [ViewportDocsExtension Documentation](./omni.kit.viewport.docs/omni.kit.viewport.docs.ViewportDocsExtension.html)
omni.kit.viewport.docs.extension.Classes.md
# omni.kit.viewport.docs.extension Classes ## Classes Summary: - **ViewportDocsExtension**
omni.kit.viewport.docs.extension.ViewportDocsExtension.md
# ViewportDocsExtension ## ViewportDocsExtension ``` class omni.kit.viewport.docs.extension.ViewportDocsExtension ``` Bases: `IExt` ### Methods | Method | Description | |---------------|-------------| | `on_shutdown()` | | | `on_startup(ext_id)` | | ```python def __init__(self: omni.ext._extensions.IExt) -> None: pass ``` ```
omni.kit.viewport.docs.md
# omni.kit.viewport.docs ## Submodules Summary: - **omni.kit.viewport.docs.extension** - No submodule docstring provided - **omni.kit.viewport.docs.window** - No submodule docstring provided ## Classes Summary: - **ViewportDocsExtension**
omni.kit.viewport.docs.Submodules.md
# omni.kit.viewport.docs Submodules ## Submodules Summary - **omni.kit.viewport.docs.extension** - No submodule docstring provided - **omni.kit.viewport.docs.window** - No submodule docstring provided
omni.kit.viewport.docs.window.Classes.md
# omni.kit.viewport.docs.window Classes ## Classes Summary - **ViewportDocsWindow** - The window with the documentation