unreal.UsdConversionLibrary
¶
- class unreal.UsdConversionLibrary(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
BlueprintFunctionLibrary
Wrapped static conversion functions from the UsdUtilities module, so that they can be used via scripting
C++ Source:
Plugin: USDImporter
Module: USDExporter
File: USDConversionBlueprintLibrary.h
- classmethod add_payload(referencing_stage_path, referencing_prim_path, target_stage_path) None ¶
Add Payload
- classmethod can_export_to_layer(target_file_path) bool ¶
Checks whether we can create a USD Layer with “TargetFilePath” as identifier and export to it
- classmethod can_paste_prims() bool ¶
Returns true if we have prims that we can paste within our clipboard stage
- Return type:
- classmethod copy_prims(stage_root_layer, prim_paths) bool ¶
Copies flattened versions of the input prims onto the clipboard stage. These copied prims can then be pasted with PastePrims.
- classmethod cut_prims(stage_root_layer, prim_paths) bool ¶
Copies flattened versions of the input prims onto the clipboard stage and removes all the prim specs for Prims from their stages. These cut prims can then be pasted with PastePrims.
- classmethod duplicate_prims(stage_root_layer, prim_paths, duplicate_type, target_layer) Array[str] ¶
Duplicates all provided Prims one-by-one, performing the requested DuplicateType. See the documentation on EUsdDuplicateType for the different operation types.
The duplicated prims may be renamed in order to have valid names for the target location, which is why this function returns the pasted prim paths. This function returns just paths instead of actual prims because USD needs to respond to the notices about the created prim specs before the prims are fully created, which means we wouldn’t be able to return the created prims yet, in case this function was called from within an SdfChangeBlock.
- Parameters:
stage_root_layer (str) – Path to the root layer of the stage from which we should fetch the Prims
duplicate_type (UsdDuplicateType) – Type of prim duplication to perform
target_layer (str) – Target layer to use when duplicating, if relevant for that duplication type
- Returns:
Paths to the duplicated prim specs, after they were added as children of ParentPrim.
- Return type:
- classmethod generate_object_version_string(object_to_export, export_options) str ¶
Generates a unique identifier string that involves ObjectToExport’s package’s persistent guid, the corresponding file save date and time, and the number of times the package has been dirtied since last being saved. Optionally it can also combine that hash with a hash of the export options being used for the export, if available. This can be used to track the version of exported assets and levels, to prevent reexporting of actors and components.
- classmethod get_analytics_attributes(options) Array[AnalyticsEventAttr] ¶
Retrieves the analytics attributes to send for the provided options object
- Parameters:
options (LevelExporterUSDOptions) –
- Return type:
- classmethod get_instance_transforms(actor, foliage_type, instances_level=None) Array[Transform] ¶
Returns the transforms of all instances of a particular UFoliageType on a given level. If no level is provided all instances will be returned. Use GetUsedFoliageTypes() to retrieve all foliage types managed by a particular actor.
- Parameters:
actor (InstancedFoliageActor) –
foliage_type (FoliageType) –
instances_level (Level) –
- Return type:
- classmethod get_instanced_foliage_actor_for_level(create_if_none=False, level=None) InstancedFoliageActor ¶
Wraps AInstancedFoliageActor::GetInstancedFoliageActorForLevel, and allows retrieving the current AInstancedFoliageActor for a level. Will default to the current editor level if Level is left nullptr. This function is useful because it’s difficult to retrieve this actor otherwise, as it will be filtered from the results of functions like EditorLevelLibrary.get_all_level_actors()
- Parameters:
- Return type:
- classmethod get_loaded_level_names(world) Array[str] ¶
Returns the path name (e.g. “/Game/Maps/MyLevel”) of levels that are loaded on World. We use these to revert the World to its initial state after we force-stream levels in for exporting
- classmethod get_prim_path_for_object(actor_or_component, parent_prim_path='', use_actor_folders=False) str ¶
Get Prim Path for Object
- classmethod get_schema_name_for_component(component) str ¶
Get Schema Name for Component
- Parameters:
component (SceneComponent) –
- Return type:
- classmethod get_source(foliage_type) Object ¶
Returns the source asset for a UFoliageType. It can be a UStaticMesh in case we’re dealing with a UFoliageType_InstancedStaticMesh, but it can be other types of objects.
- Parameters:
foliage_type (FoliageType) –
- Return type:
- classmethod get_used_foliage_types(actor) Array[FoliageType] ¶
Returns all the different types of UFoliageType assets that a particular AInstancedFoliageActor uses. This function exists because we want to retrieve all instances of all foliage types on an actor, but we can’t return nested containers from UFUNCTIONs, so users of this API should call this, and then GetInstanceTransforms.
- Parameters:
actor (InstancedFoliageActor) –
- Return type:
- classmethod get_visible_in_editor_level_names(world) Array[str] ¶
Returns the path name (e.g. “/Game/Maps/MyLevel”) of levels that checked to be visible in the editor within World. We use these to revert the World to its initial state after we force-stream levels in for exporting
- classmethod make_path_relative_to_layer(anchor_layer_path, path_to_make_relative) str ¶
Make Path Relative to Layer
- classmethod paste_prims(stage_root_layer, parent_prim_path) Array[str] ¶
Pastes the prims from the clipboard stage as children of ParentPrim.
The pasted prims may be renamed in order to have valid names for the target location, which is why this function returns the pasted prim paths. This function returns just paths instead of actual prims because USD needs to respond to the notices about the created prim specs before the prims are fully created, which means we wouldn’t be able to return the created prims yet, in case this function was called from within an SdfChangeBlock.
- classmethod reapply_sequencer_animations() None ¶
If we used ReverseSequencerAnimations to undo the effect of an opened sequencer before export, this function can be used to re-apply the sequencer state back to the level after the export is complete
- classmethod remove_all_prim_specs(stage_root_layer, prim_path, target_layer) None ¶
Removes all the prim specs for Prim on the given Layer.
This function is useful in case the prim is inside a variant set: In that case, just calling FUsdStage::RemovePrim() will attempt to remove the “/Root/Example/Child”, which wouldn’t remove the “/Root{Varset=Var}Example/Child” spec, meaning the prim may still be left on the stage. Note that it’s even possible to have both of those specs at the same time: for example when we have a prim inside a variant set, but outside of it we have overrides to the same prim. This function will remove both.
- classmethod revert_sequencer_animations() None ¶
If we have the Sequencer open with a level sequence animating the level before export, this function can revert any actor or component to its unanimated state
- classmethod send_analytics(attrs, event_name, automated, elapsed_seconds, number_of_frames, extension) None ¶
Defer to the USDClasses module to actually send analytics information
- Parameters:
attrs (Array[AnalyticsEventAttr]) –
event_name (str) –
automated (bool) –
elapsed_seconds (double) –
number_of_frames (double) –
extension (str) –