Navigation
API > API/Plugins > API/Plugins/USDClasses > API/Plugins/USDClasses/UUsdAssetCache3 > API/Plugins/USDClasses/UUsdAssetCache3/GetOrCreateCustomCachedAsset
References
| Module | USDClasses |
| Header | /Engine/Plugins/Runtime/USDCore/Source/USDClasses/Public/USDAssetCache3.h |
| Include | #include "USDAssetCache3.h" |
template<typename T>
T * GetOrCreateCustomCachedAsset
(
const FString & Hash,
FString DesiredName,
EObjectFlags DesiredFlags,
TFunctionRef < UObject * *PackageOuter, FName SanitizedName, EObjectFlags FlagsToUse)> ObjectCreationFunc,
bool * bOutCreatedAsset,
const UObject * Referencer
)
Remarks
Templated version of GetOrCreateCachedAsset for convenience
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 |
| 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) |
| ObjectCreationFunc | Lambda that will be called to actually create the UObject. The lambda should internally use the PackageOuter parameter as its outer, and the provided SanitizeName and FlagsToUse. |
| 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) |