Navigation
API > API/Plugins > API/Plugins/USDClasses
Owns the assets generated and reused by USD Stages, allowing thread-safe retrieval/storage.
| Name | UUsdAssetCache2 |
| Type | class |
| Header File | /Engine/Plugins/Runtime/USDCore/Source/USDClasses/Public/USDAssetCache2.h |
| Include Path | #include "USDAssetCache2.h" |
Syntax
UCLASS (MinimalAPI, BlueprintType, Blueprintable)
class UUsdAssetCache2 : public UObject
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UUsdAssetCache2
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UUsdAssetCache2() |
USDAssetCache2.h |
Classes
| Name | Remarks |
|---|---|
| FCachedAssetInfo | Describes all information we know about an asset in storage. |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| PersistentAssetStorageSizeMB | double | This limit specifies how much size is allocated to storing all persistent assets (i.e. assets that will be saved to disk, even if unused by any stage). | USDAssetCache2.h |
|
| UnreferencedAssetStorageSizeMB | double | The asset cache will always retain all currently used assets. | USDAssetCache2.h |
|
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ActiveAssets | TSet< UObject * > | Assets that were added/retrieved since the last call to MarkAssetsAsSlate();. | USDAssetCache2.h | |
| AssetStorage | TMap< FString, TObjectPtr< UObject > > | Main hash to asset storage for all assets that we're currently using and shouldn't be GC'd. | USDAssetCache2.h |
|
| CurrentScopedReferencer | const UObject * | When this is set to something, we will track that it is referencing any new asset that we cache. | USDAssetCache2.h | |
| LRUCache | TLruCache< FSoftObjectPath, FCachedAssetInfo > | Main storage of assets in most recent to least recently used. | USDAssetCache2.h | |
| PendingPersistentStorage | TMap< FString, FSoftObjectPath > | Storage of paths to additional assets that we know are persisted on disk (and tracked on LRUCache), but that we haven't loaded from bulkdata in this session yet | USDAssetCache2.h | |
| RWLock | FRWLock | Used to ensure thread safety. | USDAssetCache2.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool AddAssetReference
(
const UObject* Asset, |
Adds a new UObject referencer to a particular asset, returning true if the operation succeeded. | USDAssetCache2.h |
|
| Adds an asset to the cache attached to a particular hash, and optionally registering a referencer | USDAssetCache2.h |
|
|
bool CanRemoveAsset
(
const FString& Hash |
Returns true if the asset with the given hash can be removed from the cache. | USDAssetCache2.h |
|
TSet< UObject * > GetActiveAssets() |
Returns assets that aren't marked as stale | USDAssetCache2.h | |
TArray< FString > GetAllAssetHashes () |
Returns all asset hashes tracked by the asset cache, for all storage types. | USDAssetCache2.h |
|
| Returns all asset paths tracked by the asset cache, for all storage types. | USDAssetCache2.h |
|
|
TArray< UObject * > GetAllLoadedAssets () |
Returns all assets that are currently loaded in the asset cache. | USDAssetCache2.h |
|
UObject * GetCachedAsset
(
const FString& Hash |
Returns an asset associated with a particular `Hash_. | USDAssetCache2.h |
|
FString GetHashForAsset
(
const UObject* Asset |
Returns the hash associated with an asset, in case we own it. | USDAssetCache2.h |
|
int32 GetNumAssets() |
Returns how many assets are tracked by the asset cache in total (summing up persistent, referenced and unreferenced storage) | USDAssetCache2.h |
|
bool IsAssetOwnedByCache
(
const FString& AssetPath |
Returns true in case the asset at `AssetPath_ is tracked by the cache in any way (persistent asset, unreferenced or referenced). | USDAssetCache2.h |
|
void MarkAssetsAsStale () |
Every time an asset is retrieved/inserted we add it to ActiveAssets. | USDAssetCache2.h | |
void RefreshStorage () |
Updates which assets belong to each storage type. | USDAssetCache2.h |
|
bool RemoveAllAssetReferences
(
const UObject* Referencer |
Removes the particular referencer to all assets tracked by the cache, if it was a referencer to any of them. | USDAssetCache2.h |
|
UObject * RemoveAsset
(
const FString& Hash |
If an asset is associated with `Hash_, it will be returned and the asset cache will stop tracking this asset entirely. | USDAssetCache2.h |
|
bool RemoveAssetReference
(
const UObject* Asset, |
Removes an UObject referencer from a particular asset, returning true if the operation succeeded. | USDAssetCache2.h |
|
void Reset() |
Discards all tracked assets across all storage types | USDAssetCache2.h |
|
bool TouchAsset
(
const UObject* Asset, |
Marks the provided asset as being used at this point, optionally adding a specific referencer. | USDAssetCache2.h |
|
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void PostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent |
Begin UObject interfacte. | USDAssetCache2.h | |
virtual void PostLoad() |
USDAssetCache2.h | ||
virtual void Serialize
(
FArchive& Ar |
USDAssetCache2.h |