Navigation
API > API/Plugins > API/Plugins/USDClasses > API/Plugins/USDClasses/UUsdAssetCache3
Overloads
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
T * GetOrCreateCustomCachedAsset
(
const FString& Hash, |
Templated version of GetOrCreateCachedAsset for convenience | USDAssetCache3.h | |
UObject * GetOrCreateCustomCachedAsset
(
const FString& Hash, |
For most asset types GetOrCreateCachedAsset should suffice: It will internally call NewObject |
USDAssetCache3.h |
GetOrCreateCustomCachedAsset(const FString &, FString, EObjectFlags, TFunctionRef< UObject (UPackage PackageOuter, FName SanitizedName, EObjectFlags FlagsToUse)>, bool , const UObject )
Description
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!
| Name | GetOrCreateCustomCachedAsset |
| Type | function |
| Header File | /Engine/Plugins/Runtime/USDCore/Source/USDClasses/Public/USDAssetCache3.h |
| Include Path | #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
)
The asset that was returned or created
Parameters
| Name | Remarks |
|---|---|
| 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) |
GetOrCreateCustomCachedAsset(const FString &, UClass , const FString &, EObjectFlags, TFunctionRef< UObject (UPackage PackageOuter, FName SanitizedName, EObjectFlags FlagsToUse)>, bool , const UObject *)
Description
For most asset types GetOrCreateCachedAsset should suffice: It will internally call NewObject
Some asset types or workflows have different ways of instantiating the assets though, like textures which must go through the UTextureFactory, MIDs that must be constructed via UMaterialInstanceDynamic::Create, and others. For those cases you can call this function, and provide a lambda that actually creates the UObject* itself based on the provided package Outer and sanitized FName.
WARNING: As this may try loading a package from disk or call NewObject, this can only be called from the game thread!
| Name | GetOrCreateCustomCachedAsset |
| Type | function |
| Header File | /Engine/Plugins/Runtime/USDCore/Source/USDClasses/Public/USDAssetCache3.h |
| Include Path | #include "USDAssetCache3.h" |
| Source | /Engine/Plugins/Runtime/USDCore/Source/USDClasses/Private/USDAssetCache3.cpp |
UObject * GetOrCreateCustomCachedAsset
(
const FString & Hash,
UClass * Class,
const FString & DesiredName,
EObjectFlags DesiredFlags,
TFunctionRef < UObject * *PackageOuter, FName SanitizedName, EObjectFlags FlagsToUse)> ObjectCreationFunc,
bool * bOutCreatedAsset,
const UObject * Referencer
)
The asset that was returned or created
Parameters
| Name | Remarks |
|---|---|
| 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) |
| 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) |