Open 3D Engine AzCore API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::Data::AssetCatalogRequests Class Reference

#include <AssetManagerBus.h>

Inherits AZ::EBusTraits.

Classes

struct  PostThreadDispatchInvoker
 
struct  ThreadDispatchLockGuard
 

Public Types

using MutexType = AZStd::recursive_mutex
 
using EventQueueMutexType = AZStd::mutex
 
template<typename DispatchMutex , bool >
using DispatchLockGuard = ThreadDispatchLockGuard< DispatchMutex >
 
using BeginAssetEnumerationCB = AZStd::function< void() >
 
using AssetEnumerationCB = AZStd::function< void(const AZ::Data::AssetId, const AZ::Data::AssetInfo &) >
 
using EndAssetEnumerationCB = AZStd::function< void() >
 
- Public Types inherited from AZ::EBusTraits
using AllocatorType = AZ::Internal::EBusEnvironmentAllocator
 
using BusIdType = NullBusId
 
using BusIdOrderCompare = NullBusIdCompare
 
using BusHandlerOrderCompare = BusHandlerCompareDefault
 
using MutexType = NullMutex
 
using EventQueueMutexType = NullMutex
 
template<class Bus >
using ConnectionPolicy = EBusConnectionPolicy< Bus >
 
template<class Context >
using StoragePolicy = EBusEnvironmentStoragePolicy< Context >
 
template<class Bus >
using RouterPolicy = EBusRouterPolicy< Bus >
 
using EventProcessingPolicy = EBusEventProcessingPolicy
 
template<typename DispatchMutex , bool IsLocklessDispatch>
using DispatchLockGuard = AZStd::conditional_t< IsLocklessDispatch, AZ::Internal::NullLockGuard< DispatchMutex >, AZStd::scoped_lock< DispatchMutex > >
 
template<typename ContextMutex >
using ConnectLockGuard = AZStd::conditional_t< AZStd::is_same_v< ContextMutex, AZ::NullMutex >, AZ::Internal::NullLockGuard< ContextMutex >, AZStd::unique_lock< ContextMutex > >
 
template<typename ContextMutex >
using BindLockGuard = AZStd::scoped_lock< ContextMutex >
 
template<typename ContextMutex >
using CallstackTrackerLockGuard = AZStd::conditional_t< AZStd::is_same_v< ContextMutex, AZ::NullMutex >, AZ::Internal::NullLockGuard< ContextMutex >, AZStd::unique_lock< ContextMutex > >
 

Public Member Functions

virtual void EnableCatalogForAsset (const AZ::Data::AssetType &)
 Enables the catalog.
 
virtual void DisableCatalog ()
 Disables the catalog.
 
virtual void StartMonitoringAssets ()
 Enable monitoring of asset changes.
 
virtual void StopMonitoringAssets ()
 Stop monitoring of asset changes.
 
virtual bool LoadCatalog (const char *)
 
virtual void ClearCatalog ()
 
virtual bool SaveCatalog (const char *)
 Write out our existing catalog to the given file.
 
virtual bool AddDeltaCatalog (AZStd::shared_ptr< AzFramework::AssetRegistry >)
 Load a catalog file on top of our existing catalog data.
 
virtual bool InsertDeltaCatalog (AZStd::shared_ptr< AzFramework::AssetRegistry >, size_t)
 Insert a new delta catalog at a particular index

 
virtual bool InsertDeltaCatalogBefore (AZStd::shared_ptr< AzFramework::AssetRegistry >, AZStd::shared_ptr< AzFramework::AssetRegistry >)
 Insert a new delta catalog before the given next unique catalog name.
 
virtual bool RemoveDeltaCatalog (AZStd::shared_ptr< AzFramework::AssetRegistry >)
 Remove a catalog from our delta list and rebuild the catalog from remaining items.
 
virtual bool CreateBundleManifest (const AZStd::string &, const AZStd::vector< AZStd::string > &, const AZStd::string &, int, const AZStd::vector< AZ::IO::Path > &)
 Creates a manifest with the given DeltaCatalog name.
 
virtual bool CreateDeltaCatalog (const AZStd::vector< AZStd::string > &, const AZStd::string &)
 Creates an instance of a registry containing info for just the specified files, and writes it out to a file at the specified path.
 
virtual void AddExtension (const char *)
 
virtual void AddAssetType (const AZ::Data::AssetType &)
 
virtual void GetHandledAssetTypes (AZStd::vector< AZ::Data::AssetType > &)
 
virtual AZ::Data::AssetType GetAssetTypeByDisplayName (const AZStd::string_view)
 Get Asset Type Uuid from its Display Name.
 
virtual void RegisterAsset (const AZ::Data::AssetId &, AZ::Data::AssetInfo &)
 
virtual void UnregisterAsset (const AZ::Data::AssetId &)
 Removes an asset from the catalog (by ID)
 
virtual AZStd::string GetAssetPathById (const AZ::Data::AssetId &)
 
virtual AZ::Data::AssetId GetAssetIdByPath (const char *, const AZ::Data::AssetType &, bool)
 
virtual AZStd::vector< AZStd::stringGetRegisteredAssetPaths ()
 Retrieves file paths of all the registered assets.
 
virtual AZ::Data::AssetInfo GetAssetInfoById (const AZ::Data::AssetId &)
 Given an asset ID, retrieve general information about that asset.
 
virtual AZ::Data::AssetId GenerateAssetIdTEMP (const char *)
 
virtual AZ::Outcome< AZStd::vector< ProductDependency >, AZStd::stringGetDirectProductDependencies (const AssetId &)
 
virtual AZ::Outcome< AZStd::vector< ProductDependency >, AZStd::stringGetAllProductDependencies (const AssetId &)
 
virtual AZ::Outcome< AZStd::vector< AZ::Data::ProductDependency >, AZStd::stringGetLoadBehaviorProductDependencies (const AZ::Data::AssetId &id, AZStd::unordered_set< AZ::Data::AssetId > &noloadSet, PreloadAssetListType &preloadLists)
 
virtual AZ::Outcome< AZStd::vector< ProductDependency >, AZStd::stringGetAllProductDependenciesFilter (const AssetId &id, const AZStd::unordered_set< AssetId > &exclusionList, const AZStd::vector< AZStd::string > &wildcardPatternExclusionList)
 
virtual bool DoesAssetIdMatchWildcardPattern (const AZ::Data::AssetId &, const AZStd::string &)
 
virtual void EnumerateAssets (BeginAssetEnumerationCB, AssetEnumerationCB, EndAssetEnumerationCB)
 

Static Public Attributes

static constexpr AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single
 
static constexpr bool EnableEventQueue = true
 
- Static Public Attributes inherited from AZ::EBusTraits
static constexpr EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Multiple
 
static constexpr EBusAddressPolicy AddressPolicy = EBusAddressPolicy::Single
 
static constexpr bool EnableEventQueue = false
 
static constexpr bool EventQueueingActiveByDefault = true
 
static constexpr bool EnableQueuedReferences = false
 
static constexpr bool LocklessDispatch = false
 

Additional Inherited Members

- Protected Member Functions inherited from AZ::EBusTraits
 ~EBusTraits ()=default
 

Detailed Description

Request bus for asset catalogs. Presently we expect only one asset catalog, so this bus is limited to one handlers.

Member Function Documentation

◆ AddAssetType()

virtual void AZ::Data::AssetCatalogRequests::AddAssetType ( const AZ::Data::AssetType )
inlinevirtual

Adds an asset type to the catalog's handled list.

Parameters
assettype to add to the catalog's list of those handled.

◆ AddExtension()

virtual void AZ::Data::AssetCatalogRequests::AddExtension ( const char *  )
inlinevirtual

Adds an extension to the catalog's handled list.

Parameters
fileextension to add to catalog's list of those handled. With and without prefix '.' are both accepted.

◆ DoesAssetIdMatchWildcardPattern()

virtual bool AZ::Data::AssetCatalogRequests::DoesAssetIdMatchWildcardPattern ( const AZ::Data::AssetId ,
const AZStd::string  
)
inlinevirtual

Checks the relative path of the asset associated with the assetId against the input wildcard pattern. Does not verify the validity of the input wildcard pattern. AssetIds that cannot be resolved to a relative path are treated as though they do not match the input pattern.

Returns
true if the relative path associated with the input assetId matches the input wildcard pattern

◆ EnumerateAssets()

virtual void AZ::Data::AssetCatalogRequests::EnumerateAssets ( BeginAssetEnumerationCB  ,
AssetEnumerationCB  ,
EndAssetEnumerationCB   
)
inlinevirtual

Iterate through all assets and call the callback for each one. These callbacks will run on the same thread as the caller.

Parameters
beginCB- called before any assets are enumerated.
enumerateCB- called for each asset.
endCB- called after all assets are enumerated.

◆ GenerateAssetIdTEMP()

virtual AZ::Data::AssetId AZ::Data::AssetCatalogRequests::GenerateAssetIdTEMP ( const char *  )
inlinevirtual

Compute an asset Id from a path. This is TEMPORARY functionality. Side-by-side metadata and/or will eventually contain Uuid information. For now it's computed based on path.

Parameters
path- asset full or asset-root relative path.
Returns
AssetId computed from path. Returned Id will be invalid if input path is full, but not under the asset root.

◆ GetAllProductDependencies()

virtual AZ::Outcome< AZStd::vector< ProductDependency >, AZStd::string > AZ::Data::AssetCatalogRequests::GetAllProductDependencies ( const AssetId )
inlinevirtual

Retrieves a list of all products the given (product) asset depends on (recursively).

Parameters
id- the id of the asset to look up the dependencies for
Returns
AZ::Success containing a list of dependencies

◆ GetAllProductDependenciesFilter()

virtual AZ::Outcome< AZStd::vector< ProductDependency >, AZStd::string > AZ::Data::AssetCatalogRequests::GetAllProductDependenciesFilter ( const AssetId id,
const AZStd::unordered_set< AssetId > &  exclusionList,
const AZStd::vector< AZStd::string > &  wildcardPatternExclusionList 
)
inlinevirtual

Retrieves a list of all products the given (product) asset depends on (recursively).

Parameters
id- the id of the asset to look up the dependencies for
exclusionList- list of AssetIds to ignore (recursively). If a match is found, it and all its dependencies are skipped.
wildcardPatternExclusionList- if a dependency matches any of these wildcard patterns, it should be ignored (recursively). If a match is found, it and all its dependencies are skipped.
Returns
AZ::Success containing a list of dependencies

◆ GetAssetIdByPath()

virtual AZ::Data::AssetId AZ::Data::AssetCatalogRequests::GetAssetIdByPath ( const char *  ,
const AZ::Data::AssetType ,
bool   
)
inlinevirtual

Retrieves an asset Id given a full or asset-root-relative path.

Parameters
path- asset full or asset-root relative path.
typeToRegister- if autoRegisterIfNotFound is set and the asset isn't already registered, it will be registered as this type.
autoRegisterIfNotFound- registers the asset if not already in the catalog.
Returns
valid AssetId if it's in the registry, otherwise an empty AssetId.

◆ GetAssetPathById()

virtual AZStd::string AZ::Data::AssetCatalogRequests::GetAssetPathById ( const AZ::Data::AssetId )
inlinevirtual

Retrieves an asset-root-relative path by Id.

Returns
asset relative path given an Id, if it's in the catalog, otherwise an empty string.

◆ GetDirectProductDependencies()

virtual AZ::Outcome< AZStd::vector< ProductDependency >, AZStd::string > AZ::Data::AssetCatalogRequests::GetDirectProductDependencies ( const AssetId )
inlinevirtual

Retrieves a list of all products the given (product) asset directly depends on.

Parameters
id- the id of the asset to look up the dependencies for
Returns
AZ::Success containing a list of dependencies, AZ::Failure if id is not found

◆ GetHandledAssetTypes()

virtual void AZ::Data::AssetCatalogRequests::GetHandledAssetTypes ( AZStd::vector< AZ::Data::AssetType > &  )
inlinevirtual

Fills a vector with all registered AssetTypes.

Parameters
thelist reference to fill with registered types.

◆ GetLoadBehaviorProductDependencies()

virtual AZ::Outcome< AZStd::vector< AZ::Data::ProductDependency >, AZStd::string > AZ::Data::AssetCatalogRequests::GetLoadBehaviorProductDependencies ( const AZ::Data::AssetId id,
AZStd::unordered_set< AZ::Data::AssetId > &  noloadSet,
PreloadAssetListType preloadLists 
)
inlinevirtual

Retrieves a list of products the given (product) asset depends on (recursively) which are not flagged as NoLoad. NoLoad dependencies will be returned in the noload set for the caller to load on demand if desired

Parameters
id- the id of the asset to look up the dependencies for
Returns
AZ::Success containing a list of dependencies, noloadSet with the dependencies flagged as NoLoad, preloadLists contains the specific dependencies which are PreLoad for each asset. These assets are all also found in the product dependency list which the noloadset are not. This is because the intent of the return value product dependency list is the entire set of assets which need to load by default for the requested assetID, and the preload list is only to allow us to manage and communicate about subsets of those assets which have additional reporting requirements. We don't want to report assets which have preload dependencies as "Ready" until all of their "PreLoad" dependencies are also ready NoLoad assets however simply wait for the user to request an additional load - they or their dependencies don't begin loading by default

◆ LoadCatalog()

virtual bool AZ::Data::AssetCatalogRequests::LoadCatalog ( const char *  )
inlinevirtual

Populates catalog data from specified file.

Parameters
catalogRegistryFilecache-relative file path from which catalog should be pre-loaded.
Returns
true if catalog was successfuly loaded.

◆ RegisterAsset()

virtual void AZ::Data::AssetCatalogRequests::RegisterAsset ( const AZ::Data::AssetId ,
AZ::Data::AssetInfo  
)
inlinevirtual

Adds an asset to the catalog.

Parameters
id- the id to assign the asset.
info- the information to assign to that ID

The documentation for this class was generated from the following file: