Navigation
API > API/Plugins > API/Plugins/USDExporter
Wraps the UnrealToUsd component conversion functions from the USDUtilities module so that they can be used by scripting languages.
This is an instanceable object instead of just static functions so that the USDStage to use for the conversions can be provided and cached between function calls, which is helpful because we're forced to provide at most prim and layer file paths (as opposed to direct pxr::UsdPrim objects).
We can't provide the pxr::UsdPrim object directly because USD types can't be part of C++ function signatures that are automatically exposed to scripting languages. Lucikly we can use UsdUtils' stage cache to make sure that C++ and e.g. Python are still referencing the same USD Stage in memory, so that we can e.g. use these functions to convert data within stages created via Python.
| Name | UUsdConversionBlueprintContext |
| Type | class |
| Header File | /Engine/Plugins/Importers/USDImporter/Source/USDExporter/Public/USDConversionBlueprintContext.h |
| Include Path | #include "USDConversionBlueprintContext.h" |
Syntax
UCLASS (Meta=(ScriptName="UsdConversionContext"))
class UUsdConversionBlueprintContext : public UObject
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UUsdConversionBlueprintContext
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~UUsdConversionBlueprintContext() |
USDConversionBlueprintContext.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bEraseFromStageCache | bool | Whether we will erase our current stage from the stage cache when we Cleanup(). | USDConversionBlueprintContext.h | |
| Stage | UE::FUsdStage | Stage to use when converting components | USDConversionBlueprintContext.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void Cleanup () |
Discards the currently opened stage. | USDConversionBlueprintContext.h |
|
bool ConvertAudioComponent
(
const UAudioComponent* Component, |
USDConversionBlueprintContext.h |
|
|
bool ConvertCineCameraComponent
(
const UCineCameraComponent* Component, |
USDConversionBlueprintContext.h |
|
|
bool ConvertDirectionalLightComponent
(
const UDirectionalLightComponent* Component, |
USDConversionBlueprintContext.h |
|
|
bool ConvertDrawModeComponent
(
const UUsdDrawModeComponent* Component, |
USDConversionBlueprintContext.h |
|
|
bool ConvertHismComponent
(
const UHierarchicalInstancedStaticMeshComponent* Component, |
USDConversionBlueprintContext.h |
|
|
bool ConvertInstancedFoliageActor
(
const AInstancedFoliageActor* Actor, |
USDConversionBlueprintContext.h |
|
|
bool ConvertIsmComponent
(
const UInstancedStaticMeshComponent* Component, |
USDConversionBlueprintContext.h |
|
|
bool ConvertLandscapeProxyActorMaterial
(
ALandscapeProxy* Actor, |
USDConversionBlueprintContext.h |
|
|
bool ConvertLandscapeProxyActorMesh
(
const ALandscapeProxy* Actor, |
USDConversionBlueprintContext.h |
|
|
bool ConvertLightComponent
(
const ULightComponentBase* Component, |
Note: We use FLT_MAX on these functions because Usd.TimeCode.Default().GetValue() is actually a nan, and nan arguments are automatically sanitized to 0.0f. | USDConversionBlueprintContext.h |
|
bool ConvertMaterialOverrides
(
const UObject* MeshAsset, |
USDConversionBlueprintContext.h |
|
|
bool ConvertMeshComponent
(
const UMeshComponent* Component, |
USDConversionBlueprintContext.h |
|
|
bool ConvertPointLightComponent
(
const UPointLightComponent* Component, |
USDConversionBlueprintContext.h |
|
|
bool ConvertRectLightComponent
(
const URectLightComponent* Component, |
USDConversionBlueprintContext.h |
|
|
bool ConvertSceneComponent
(
const USceneComponent* Component, |
USDConversionBlueprintContext.h |
|
|
bool ConvertSkyLightComponent
(
const USkyLightComponent* Component, |
USDConversionBlueprintContext.h |
|
|
bool ConvertSpotLightComponent
(
const USpotLightComponent* Component, |
USDConversionBlueprintContext.h |
|
|
FFilePath GetEditTarget() |
Gets the filepath of the current edit target layer of our internal stage | USDConversionBlueprintContext.h |
|
FUsdUnrealAssetInfo GetPrimAssetInfo
(
const FString& PrimPath |
Retrieves from Prim the assetInfo metadata values that we use as export metadata, when exporting Unreal assets | USDConversionBlueprintContext.h |
|
FUsdCombinedPrimMetadata GetPrimMetadata
(
const FString& PrimPath, |
Extracts metadata from the prim at PrimPath using the provided filters and returns it | USDConversionBlueprintContext.h |
|
FFilePath GetStageRootLayer() |
Gets the file path of the root layer of our current stage | USDConversionBlueprintContext.h |
|
int32 GetUsdStageNumFrames() |
Returns how many frames of animation the stage would generate if imported | USDConversionBlueprintContext.h |
|
bool RemoveUnrealSurfaceOutput
(
const FString& PrimPath, |
Clears any opinions for the 'unreal' render context surface output of MaterialPrim within LayerToAuthorIn. | USDConversionBlueprintContext.h |
|
| Traverses the context's stage and authors material binding attributes for all `unrealMaterials_ that were baked into USD material assets. | USDConversionBlueprintContext.h |
|
|
void SetEditTarget
(
FFilePath EditTargetLayerPath |
Sets the current edit target of our internal stage. | USDConversionBlueprintContext.h |
|
void SetPrimAssetInfo
(
const FString& PrimPath, |
Adds to Prim the assetInfo metadata the values described in Info | USDConversionBlueprintContext.h |
|
void SetPrimMetadata
(
const FString& PrimPath, |
Applies Metadata to the prim specified at PrimPath, using the provided filters | USDConversionBlueprintContext.h |
|
void SetPrimMetadataFromUserData
(
const FString& PrimPath, |
Applies all the metadata contained in UserData to the prim specified at PrimPath, using the provided filters | USDConversionBlueprintContext.h |
|
void SetStageRootLayer
(
FFilePath StageRootLayerPath |
Opens or creates a USD stage using `StageRootLayerPath_ as root layer, creating the root layer if needed. | USDConversionBlueprintContext.h |
|