unreal.UsdStageEditorLibrary

class unreal.UsdStageEditorLibrary(outer: Object | None = None, name: Name | str = 'None')

Bases: BlueprintFunctionLibrary

Library of functions that can be used from scripting to interact with the USD Stage Editor UI

C++ Source:

  • Plugin: USDImporter

  • Module: USDStageEditor

  • File: USDStageEditorBlueprintLibrary.h

classmethod actions_import(output_content_folder, options) None

Imports the currently opened USD Stage into persistent UE assets, actors and components on the level. Corresponds to the “Actions -> Import” action on the USD Stage Editor menu bar. papam: Options - Options object to use for the import.

Parameters:
  • output_content_folder (str) – Content path (e.g. “/Game/Imports”) to receive the imported assets. If this path is the empty string a dialog will be shown to let the user pick the folder.

  • options (UsdStageImportOptions) –

classmethod close_stage_editor() bool

Closes the USD Stage Editor window if it is opened. Does nothing in case it is already closed.

Returns:

True if a stage editor window was closed by this action.

Return type:

bool

classmethod export_selected_layers(output_directory) None

Exports the currently selected layers on the USD Stage Editor to brand new files in a new location. Corresponds to right-clicking selected layers on the USD Stage Editor and picking “Export”.

Parameters:

output_directory (str) – Directory path (e.g. “C:/ExportFolder/”) to receive the exported files. If this path is the empty string a dialog will be shown to let the user pick the directory.

classmethod file_close() None

Closes the currently opened USD Stage (by clearing the attached Stage Actor’s RootLayer property). Corresponds to the “File -> Close” action on the USD Stage Editor menu bar.

classmethod file_export_all_layers(output_directory) None

Exports all layers of the currently opened USD Stage to brand new files in a new location. Corresponds to the “File -> Export -> All Layers” action on the USD Stage Editor menu bar.

Parameters:

output_directory (str) – Directory path (e.g. “C:/ExportFolder/”) to receive the exported files. If this path is the empty string a dialog will be shown to let the user pick the directory.

classmethod file_export_flattened_stage(output_layer) None

Exports the currently opened USD Stage to a single “flattened” USD layer. Corresponds to the “File -> Export -> All Layers” action on the USD Stage Editor menu bar.

Parameters:

output_layer (str) – File path (e.g. “C:/ExportFolder/out.usda”) to export the flattened layer to. If this path is the empty string a dialog will be shown to let the user pick the file.

classmethod file_new() None

Creates a new memory-only layer and opens an USD Stage with that layer as its root. Corresponds to the “File -> New” action on the USD Stage Editor menu bar.

classmethod file_open(file_path) None

Opens an USD Stage from a file on disk. Corresponds to the “File -> Open” action on the USD Stage Editor menu bar.

Parameters:

file_path (str) – File path to the USD layer to open (e.g. “C:/Folder/MyFile.usda”). If this path is the empty string a dialog will be shown to let the user pick the file.

classmethod file_reload() None

Reloads all layers of the current USD Stage. Corresponds to the “File -> Reload” action on the USD Stage Editor menu bar.

classmethod file_reset() None

Resets the state of the current USD Stage (which layers are muted, the current edit target, etc.). Corresponds to the “File -> Reset state” action on the USD Stage Editor menu bar.

classmethod file_save(output_file_path_if_unsaved) None

Saves the currently opened USD Stage back to disk, or to a new file in case it hasn’t been saved yet. Corresponds to the “File -> Save” action on the USD Stage Editor menu bar.

Parameters:

output_file_path_if_unsaved (str) – File path (e.g. “C:/Folder/MyFile.usda”) to use when the currently opened stage hasn’t been saved yet. If this path is the empty string a dialog will be shown to let the user pick the file.

classmethod get_attached_stage_actor() UsdStageActor

Gets which actor is currently attached to the USD Stage Editor, if any. May return nullptr in case no actor is attached.

Returns:

The attached stage actor.

Return type:

UsdStageActor

classmethod get_selected_layer_identifiers() Array[str]

Returns the full identifiers of all layers that are currently selected on the USD Stage Editor.

Returns:

The list of identifiers (e.g. [“c:/MyFolder/root.usda”, “c:/MyFolder/sublayer.usda”])

Return type:

Array[str]

classmethod get_selected_prim_paths() Array[str]

Returns the full paths to all prims currently selected on the USD Stage Editor.

Returns:

The paths of selected prims (e.g. [“/ParentPrim/Mesh”, “/Root”])

Return type:

Array[str]

classmethod get_selected_property_metadata_names() Array[str]

Returns the names of the currently selected property metadata entries on the right panel of the USD Stage Editor.

Returns:

The names of selected metadata (e.g. [“documentation”, “typeName”])

Return type:

Array[str]

classmethod get_selected_property_names() Array[str]

Returns the names of the currently selected properties on the right panel of the USD Stage Editor.

Returns:

The names of selected properties (e.g. [“points”, “displayColor”])

Return type:

Array[str]

classmethod is_stage_editor_opened() bool

Checks to see if an USD Stage Editor window is currently opened.

Returns:

True if a stage editor window is now opened and available.

Return type:

bool

classmethod open_stage_editor() bool

Opens the the USD Stage Editor window, or focus it in case it is already open.

Returns:

True if a stage editor window is now opened and available.

Return type:

bool

classmethod set_attached_stage_actor(new_actor) bool

Sets which actor is currently attached to the USD Stage Editor. Provide None/nullptr to clear the attached stage actor.

Parameters:

new_actor (UsdStageActor) – The actor to select

Returns:

True in case the new actor was attached to the USD Stage Editor.

Return type:

bool

classmethod set_selected_layer_identifiers(new_selection) None

Sets the USD Stage Editor layer selection to all occurences of the layers with identifiers in NewSelection. Provide an empty array to clear the selection.

Parameters:

new_selection (Array[str]) – The list of identifiers to select (e.g. [“c:/MyFolder/root.usda”, “c:/MyFolder/sublayer.usda”])

classmethod set_selected_prim_paths(new_selection) None

Sets the USD Stage Editor prim selection to the prims with paths contained in NewSelection. Provide an empty array to clear the selection.

Parameters:

new_selection (Array[str]) – The list of prim paths to select (e.g. [“/ParentPrim/Mesh”, “/Root”])

classmethod set_selected_property_metadata_names(new_selection) None

Sets the USD Stage Editor property metadata selection to the entries with names contained in NewSelection. Provide an empty array to clear the selection.

Parameters:

new_selection (Array[str]) – The list of property names to select (e.g. [“documentation”, “typeName”])

classmethod set_selected_property_names(new_selection) None

Sets the USD Stage Editor property selection to the properties with names contained in NewSelection. Provide an empty array to clear the selection.

Parameters:

new_selection (Array[str]) – The list of property names to select (e.g. [“points”, “displayColor”])