CreateSublayerCommand#
- 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: str | UsdContext = '',
Bases:
AbstractLayerCommandCreates or inserts a sublayer.
Methods
__init__(layer_identifier, ...[, ...])Constructor.
do_impl()Abstract do function to be implemented.
Abstract undo function to be implemented.
- __init__(
- layer_identifier: str,
- sublayer_position: int,
- new_layer_path: str,
- transfer_root_content: bool,
- create_or_insert: bool,
- layer_name: str = '',
- usd_context: str | UsdContext = '',
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.
create_or_insert (bool): If it’s true, it will create layer from this path. It’s insert, otherwise.
layer_name (str, optional): If it’s to create anonymous layer (new_layer_path is empty), this name is used.
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.