CopyPrimCommand

class omni.usd.commands.CopyPrimCommand(path_from: str, path_to: Optional[str] = None, duplicate_layers: bool = False, combine_layers: bool = False, exclusive_select: bool = True, usd_context_name: str = '', flatten_references: bool = False, copy_to_introducing_layer: bool = False)

Bases: Command

Copy primitive undoable Command.

Parameters
  • path_from (str) – Path to copy from.

  • path_to (str) – Path to copy to. If `None` next free path is generated.

  • duplicate_layers (bool) – Duplicate layers on copy.

  • combine_layers (bool) – Combine layers on copy. When it’s in omni.usd.LayerEditMode.AUTO_AUTHORING mode, this will always be true.

  • exclusive_select (bool) – If to exclusively select (clear old selections) the newly create object.

  • flatten_references (bool) – Flatten references during copy. It’s only valid when combine_layers is True, and not in AUTO_AUTHORING mode.

  • copy_to_introducing_layer (bool) – If to copy it to the introducing layer, or the current edit target. By default, it’s current edit target.

Methods

__init__(path_from[, path_to, ...])

do()

modify_callback_info(cb_type, cmd_args)

Returns a dictionary of information to be passed to callbacks of the given type.

undo()

__init__(path_from: str, path_to: Optional[str] = None, duplicate_layers: bool = False, combine_layers: bool = False, exclusive_select: bool = True, usd_context_name: str = '', flatten_references: bool = False, copy_to_introducing_layer: bool = False)
modify_callback_info(cb_type: str, cmd_args: Dict[str, Any]) Dict[str, Any]

Returns a dictionary of information to be passed to callbacks of the given type.

By default callbacks are passed a copy of the arguments which were passed to execute() when the command was invoked. This method can be overridden to modify that information for specific callback types.

Parameters
  • cb_type – Type of callback the information will be passed to.

  • args – A dictionary containing a copy of the arguments with which the command was invoked. This is a shallow copy so implementations may add, remove or replace dictionary elements but should not modify any of the objects contained within it.

Returns

A dictionary of information to be passed to callbacks of the specified type.