Open 3D Engine AzFramework 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.
AzFramework::AssetSystem::AssetSystemRequests Class Referenceabstract

#include <AssetSystemBus.h>

Inherits AZ::EBusTraits.

Public Types

using MutexType = AZStd::recursive_mutex
 

Public Member Functions

virtual bool EstablishAssetProcessorConnection (const ConnectionSettings &connectionSettings)=0
 
virtual bool WaitUntilAssetProcessorConnected (AZStd::chrono::duration< float > timeout)=0
 
virtual bool WaitUntilAssetProcessorReady (AZStd::chrono::duration< float > timeout)=0
 
virtual bool AssetProcessorIsReady ()=0
 
virtual bool ConnectedWithAssetProcessor ()=0
 
virtual bool NegotiationWithAssetProcessorFailed ()=0
 
virtual void StartDisconnectingAssetProcessor ()=0
 Starts the disconnecting thread.
 
virtual bool DisconnectedWithAssetProcessor ()=0
 
virtual bool WaitUntilAssetProcessorDisconnected (AZStd::chrono::duration< float > timeout)=0
 
virtual AssetStatus CompileAssetSync (const AZStd::string &assetPath)=0
 
virtual AssetStatus CompileAssetSync_FlushIO (const AZStd::string &assetPath)=0
 
virtual AssetStatus CompileAssetSyncById (const AZ::Data::AssetId &assetId)=0
 
virtual AssetStatus CompileAssetSyncById_FlushIO (const AZ::Data::AssetId &assetId)=0
 
virtual AssetStatus GetAssetStatusById (const AZ::Data::AssetId &assetId)=0
 
virtual AssetStatus GetAssetStatusById_FlushIO (const AZ::Data::AssetId &assetId)=0
 
virtual AssetStatus GetAssetStatus (const AZStd::string &assetPath)=0
 
virtual AssetStatus GetAssetStatus_FlushIO (const AZStd::string &assetPath)=0
 
virtual AssetStatus GetAssetStatusSearchType (const AZStd::string &searchTerm, int searchType)=0
 
virtual AssetStatus GetAssetStatusSearchType_FlushIO (const AZStd::string &searchTerm, int searchType)=0
 
virtual bool EscalateAssetByUuid (const AZ::Uuid &assetUuid)=0
 
virtual bool EscalateAssetBySearchTerm (AZStd::string_view searchTerm)=0
 
virtual void ShowAssetProcessor ()=0
 Show the AssetProcessor App.
 
virtual void ShowInAssetProcessor (const AZStd::string &assetPath)=0
 Show an asset in the AssetProcessor App.
 
virtual void GetUnresolvedProductReferences (AZ::Data::AssetId assetId, AZ::u32 &unresolvedAssetIdReferences, AZ::u32 &unresolvedPathReferences)=0
 
virtual float GetAssetProcessorPingTimeMilliseconds ()=0
 Compute the ping time between this client and the Asset Processor that's actually handling our requests (proxy relaying is included in the time)
 
virtual bool SaveCatalog ()=0
 Saves the catalog synchronously.
 

Static Public Attributes

static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single
 
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single
 
static const bool LocklessDispatch = true
 

Detailed Description

AssetSystemRequestBusTraits This bus is for making requests to the asset system

Member Function Documentation

◆ AssetProcessorIsReady()

virtual bool AzFramework::AssetSystem::AssetSystemRequests::AssetProcessorIsReady ( )
pure virtual

Is the asset processor status ready

Returns
Whether or not the asset processor is reporting ready status

◆ CompileAssetSync()

virtual AssetStatus AzFramework::AssetSystem::AssetSystemRequests::CompileAssetSync ( const AZStd::string &  assetPath)
pure virtual

CompileAssetSync Compile an asset synchronously. This will only return after compilation, and also escalates it so that it builds immediately. Note that the asset path will be heuristically matched like a search term, so things missing an extension or things that are just a folder name will cause all assets which match that search term to be escalated and compiled. PERFORMANCE WARNING: Only use the FlushIO version if you have just written an asset file you wish to immediately compile, potentially before the operating system's disk IO queue is finished writing it. It will force a flush of the OS file monitoring queue before considering the request.

◆ ConnectedWithAssetProcessor()

virtual bool AzFramework::AssetSystem::AssetSystemRequests::ConnectedWithAssetProcessor ( )
pure virtual

Are we connected to the asset processor

Returns
Whether or not we are connected

◆ DisconnectedWithAssetProcessor()

virtual bool AzFramework::AssetSystem::AssetSystemRequests::DisconnectedWithAssetProcessor ( )
pure virtual

Is the asset processor connection in the disconnected state

Returns
true if in disconnected state false otherwise

◆ EscalateAssetBySearchTerm()

virtual bool AzFramework::AssetSystem::AssetSystemRequests::EscalateAssetBySearchTerm ( AZStd::string_view  searchTerm)
pure virtual

EscalateAssetBySearchTerm Request that a particular asset be escalated to the top of the build queue, by "search term" (ie, source file name) This is an async request - the return value only indicates whether it was sent, not whether it escalated or was found. Search terms can be: Source File Names fragments of source file names Folder Names or pieces of folder names Product file names fragments of product file names The asset processor will find the closest match and escalate it. So for example if you request escalation on "mything.dds" and no such SOURCE FILE exists, it may match mything.fbx heuristically after giving up on the dds. If possible, use the above EscalateAsset with the Uuid, which does not require a heuristic match, or use the source file name (relative or absolute) as the input, instead of trying to work with product names.

Parameters
searchTerm- see above

note that this request always flushes IO (on the AssetProcessor side), but you don't pay for it in the caller process since it is a fire-and-forget message. This means its the fastest possible way to reliably escalate an asset by name

◆ EscalateAssetByUuid()

virtual bool AzFramework::AssetSystem::AssetSystemRequests::EscalateAssetByUuid ( const AZ::Uuid &  assetUuid)
pure virtual

Request that a particular asset be escalated to the top of the build queue, by uuid This is an async request - the return value only indicates whether it was sent, not whether it escalated or was found. Note that the Uuid of an asset is the Uuid of its source file. If you have an AssetId field, this is the m_uuid part inside the AssetId, since that refers to the source file that produced the asset.

Parameters
assetUuid- the uuid to look up. note that this request always flushes IO (on the AssetProcessor side), but you don't pay for it in the caller process since it is a fire-and-forget message. This means its the fastest possible way to reliably escalate an asset by UUID

◆ EstablishAssetProcessorConnection()

virtual bool AzFramework::AssetSystem::AssetSystemRequests::EstablishAssetProcessorConnection ( const ConnectionSettings connectionSettings)
pure virtual

Function which can either start a connection to the AssetProcessor or... start a connection thread that will listen for the Asset Processor to connect to the current application If a connection with the AssetProcessor has been established, this method will check whether the ConnectionSettings::m_waitUntilAssetProcessorIsReady is set If it is not set, then it returns true otherwise the SystemEvent queue is pumped while until the AssetProcessor send a ready respond or the wait timeout is reached

returns true if successfully connected and connection settings indicate that connection shouldn't wait for the AssetProcessor to be ready. Otherwise returns true if successfully connected and the AssetProcessor is ready

◆ GetAssetStatus()

virtual AssetStatus AzFramework::AssetSystem::AssetSystemRequests::GetAssetStatus ( const AZStd::string &  assetPath)
pure virtual

GetAssetStatus Retrieve the status of an asset synchronously and also escalate it so that it builds sooner than others that are not escalated.

Parameters
assetPath- a relpath to a product in the cache, or a relpath to a source file, or a full path to either PERFORMANCE WARNING: Only use the FlushIO version if you have just written an asset file you wish to immediately query the status of, potentially before the operating system's disk IO queue is finished writing it. It will force a flush of the OS file monitoring queue before considering the request.

◆ GetAssetStatusById()

virtual AssetStatus AzFramework::AssetSystem::AssetSystemRequests::GetAssetStatusById ( const AZ::Data::AssetId &  assetId)
pure virtual

GetAssetStatusByUuid Retrieve the status of an asset synchronously and also escalate it so that it builds sooner than others that are not escalated. If possible, prefer this function over the string-based version below. PERFORMANCE WARNING: Only use the FlushIO version if you have just written an asset file you wish to immediately compile, potentially before the operating system's disk IO queue is finished writing it. It will force a flush of the OS file monitoring queue before considering the request.

◆ GetAssetStatusSearchType()

virtual AssetStatus AzFramework::AssetSystem::AssetSystemRequests::GetAssetStatusSearchType ( const AZStd::string &  searchTerm,
int  searchType 
)
pure virtual

GetAssetStatusSearchType Retrieve the status of an asset synchronously and also escalate it so that it builds sooner than others that are not escalated.

Parameters
searchTerm- provides a string parameter used for searching. The use of this parameter depends on searchType.
searchType- indicates which type of search to perform, and how to use searchTerm RequestAssetStatus::SearchType::Default: Same as GetAssetStatus(). searchTerm is a relpath to a product in the cache, or a relpath to a source file, or a full path to either. RequestAssetStatus::SearchType::Exact: searchTerm is an exact path to a source data file. (see RequestAssetStatus::SearchType for more) PERFORMANCE WARNING: Only use the FlushIO version if you have just written an asset file you wish to immediately query the status of, potentially before the operating system's disk IO queue is finished writing it. It will force a flush of the OS file monitoring queue before considering the request.

◆ GetUnresolvedProductReferences()

virtual void AzFramework::AssetSystem::AssetSystemRequests::GetUnresolvedProductReferences ( AZ::Data::AssetId  assetId,
AZ::u32 &  unresolvedAssetIdReferences,
AZ::u32 &  unresolvedPathReferences 
)
pure virtual

Returns the number of unresolved AssetId and path references for the given asset. These are product assets that the given asset refers to which are not yet known by the Asset Processor. This API can be used to determine if a given asset can safely be loaded and have its asset references resolve successfully.

Parameters
assetId- Asset to lookup
unresolvedAssetIdReferences- number of AssetId-based references which are unresolved
unresolvedPathReferences- number of path-based references which are unresolved. This count excludes wildcard references which are never resolved

◆ NegotiationWithAssetProcessorFailed()

virtual bool AzFramework::AssetSystem::AssetSystemRequests::NegotiationWithAssetProcessorFailed ( )
pure virtual

Did the Negotiation with the asset processor fail

Returns
Whether or not negotiation failed with asset processor

◆ WaitUntilAssetProcessorConnected()

virtual bool AzFramework::AssetSystem::AssetSystemRequests::WaitUntilAssetProcessorConnected ( AZStd::chrono::duration< float >  timeout)
pure virtual

Wait until the asset processor is connected or timeout time is reached

Returns
Whether or not we are connected

◆ WaitUntilAssetProcessorDisconnected()

virtual bool AzFramework::AssetSystem::AssetSystemRequests::WaitUntilAssetProcessorDisconnected ( AZStd::chrono::duration< float >  timeout)
pure virtual

Waits at most timeout time for the asset processor connection to go into the disconnected state

Returns
true if in disconnected state false otherwise

◆ WaitUntilAssetProcessorReady()

virtual bool AzFramework::AssetSystem::AssetSystemRequests::WaitUntilAssetProcessorReady ( AZStd::chrono::duration< float >  timeout)
pure virtual

Wait until the asset processor is ready or timeout time is reached

Returns
Whether or not the asset processor is ready

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