Navigation
API > API/Plugins > API/Plugins/USDClasses > API/Plugins/USDClasses/UUsdAssetCache3 > API/Plugins/USDClasses/UUsdAssetCache3/GetOrCreateCachedAsset
References
| Module | USDClasses |
| Header | /Engine/Plugins/Runtime/USDCore/Source/USDClasses/Public/USDAssetCache3.h |
| Include | #include "USDAssetCache3.h" |
| Source | /Engine/Plugins/Runtime/USDCore/Source/USDClasses/Private/USDAssetCache3.cpp |
UFUNCTION (BlueprintCallable, Category="USD", Meta=(CallInEditor="true"))
UObject * GetOrCreateCachedAsset
(
const FString & Hash,
UClass * Class,
const FString & DesiredName,
int32 DesiredFlags,
bool & bOutCreatedAsset,
const UObject * Referencer
)
Remarks
Returns the cached UObject of the provided Class for the provided Hash if one exists. Otherwise, finds a new package for it on the cache's AssetDirectory and creates the asset via a NewObject
WARNING: As this may try loading a package from disk or call NewObject, this can only be called from the game thread! The asset that was returned or created
Parameters
| Name | Description |
|---|---|
| Hash | The string key to check with |
| Class | The class of the object that we want to retrieve or create from the asset cache |
| DesiredName | The name we want the created object to have (the actual name may have additional suffixes) |
| DesiredFlags | The flags we want the created object to have (the actual applied flags may differ depending on context) |
| bOutCreatedAsset | Set to true if we created the asset that was return, but false if we returned an existing asset |
| Referencer | The asset will not be deleted or untracked until this referencer is removed (via any of the RemoveAssetReferencer member functions) |