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

#include <EditorAssetSystemAPI.h>

Inherits AZ::EBusTraits.

Public Types

using MutexType = AZStd::recursive_mutex
 

Public Member Functions

virtual bool GetAbsoluteAssetDatabaseLocation (AZStd::string &)
 Retrieve the absolute path for the Asset Database Location.
 
virtual bool GetRelativeProductPathFromFullSourceOrProductPath (const AZStd::string &fullPath, AZStd::string &relativeProductPath)=0
 
virtual bool GenerateRelativeSourcePath (const AZStd::string &sourcePath, AZStd::string &relativePath, AZStd::string &rootFilePath)=0
 
virtual bool GetFullSourcePathFromRelativeProductPath (const AZStd::string &relPath, AZStd::string &fullSourcePath)=0
 
virtual bool GetAssetInfoById (const AZ::Data::AssetId &assetId, const AZ::Data::AssetType &assetType, const AZStd::string &platformName, AZ::Data::AssetInfo &assetInfo, AZStd::string &rootFilePath)=0
 retrieve an Az::Data::AssetInfo class for the given assetId. this may map to source too in which case rootFilePath will be non-empty.
 
virtual bool GetSourceInfoBySourcePath (const char *sourcePath, AZ::Data::AssetInfo &assetInfo, AZStd::string &watchFolder)=0
 
virtual bool GetSourceInfoBySourceUUID (const AZ::Uuid &sourceUuid, AZ::Data::AssetInfo &assetInfo, AZStd::string &watchFolder)=0
 
virtual bool GetScanFolders (AZStd::vector< AZStd::string > &scanFolders)=0
 
virtual bool GetAssetSafeFolders (AZStd::vector< AZStd::string > &assetSafeFolders)=0
 
virtual bool IsAssetPlatformEnabled (const char *platform)=0
 
virtual int GetPendingAssetsForPlatform (const char *platform)=0
 
virtual bool GetAssetsProducedBySourceUUID (const AZ::Uuid &sourceUuid, AZStd::vector< AZ::Data::AssetInfo > &productsAssetInfo)=0
 
virtual bool ClearFingerprintForAsset (const AZStd::string &sourcePath)=0
 

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

A bus to talk to the asset system as a tool or editor This contains things that only tools or editors should be given access to If you want to talk to it as if a game engine component or runtime component AssetSystemBus.h in the common header location.

Member Function Documentation

◆ ClearFingerprintForAsset()

virtual bool AzToolsFramework::AssetSystem::AssetSystemRequest::ClearFingerprintForAsset ( const AZStd::string &  sourcePath)
pure virtual

This will cause the file to reprocess the next time it changes, even if it's identical to what it was before. This is useful for in-editor tools that save source files. A content creator expects that, every time they save a file, the file will be processed, even if nothing has actually changed, so they will sometimes save a file specifically to force the asset to reprocess.

Returns
true if the fingerprint was cleared, false if not.

◆ GenerateRelativeSourcePath()

virtual bool AzToolsFramework::AssetSystem::AssetSystemRequest::GenerateRelativeSourcePath ( const AZStd::string &  sourcePath,
AZStd::string &  relativePath,
AZStd::string &  rootFilePath 
)
pure virtual

Convert a source path like "c:\\dev\\gamename\\blah\\test.tga" into a relative source path, like "blah/test.tga". If no valid relative path could be created, the input source path will be returned in relativePath.

Parameters
sourcePathpartial or full path to a source file. (The file doesn't need to exist)
relativePaththe output relative path for the source file, if a valid one could be created
rootFilePaththe root path that relativePath is relative to
Returns
true if a valid relative path was created, false if it wasn't

◆ GetAssetSafeFolders()

virtual bool AzToolsFramework::AssetSystem::AssetSystemRequest::GetAssetSafeFolders ( AZStd::vector< AZStd::string > &  assetSafeFolders)
pure virtual

Populates a list with folders that are safe to store assets in. This is a subset of the scan folders.

Parameters
scanFoldergets appended with the found folders.
Returns
false if this process fails.

◆ GetAssetsProducedBySourceUUID()

virtual bool AzToolsFramework::AssetSystem::AssetSystemRequest::GetAssetsProducedBySourceUUID ( const AZ::Uuid &  sourceUuid,
AZStd::vector< AZ::Data::AssetInfo > &  productsAssetInfo 
)
pure virtual

Given a UUID of a source file, retrieve the products info.

Parameters
sourceUUIDis the UUID of a source file - If you have an AssetID, its the m_guid member of that assetId
productsAssetInfois a /ref AZStd::vector<AZ::Data::AssetInfo> filled out with details about the products returns false if it cannot find the source, true otherwise.

◆ GetFullSourcePathFromRelativeProductPath()

virtual bool AzToolsFramework::AssetSystem::AssetSystemRequest::GetFullSourcePathFromRelativeProductPath ( const AZStd::string &  relPath,
AZStd::string &  fullSourcePath 
)
pure virtual

Convert a relative asset path like "blah/test.tga" to a full source path path. Once the asset processor has finished building, this function is capable of handling even when the extension changes or when the source is in a different folder or in a different location (such as inside gems)

◆ GetPendingAssetsForPlatform()

virtual int AzToolsFramework::AssetSystem::AssetSystemRequest::GetPendingAssetsForPlatform ( const char *  platform)
pure virtual

Get the total number of pending assets left to process for a specific asset platform

Parameters
platformthe asset platform to check e.g. android, ios, etc.
Returns
-1 if the process fails, a positive number otherwise

◆ GetRelativeProductPathFromFullSourceOrProductPath()

virtual bool AzToolsFramework::AssetSystem::AssetSystemRequest::GetRelativeProductPathFromFullSourceOrProductPath ( const AZStd::string &  fullPath,
AZStd::string &  relativeProductPath 
)
pure virtual

Convert a full source path like "c:\\dev\\gamename\\blah\\test.tga" into a relative product path. asset paths never mention their alias and are relative to the asset cache root

◆ GetScanFolders()

virtual bool AzToolsFramework::AssetSystem::AssetSystemRequest::GetScanFolders ( AZStd::vector< AZStd::string > &  scanFolders)
pure virtual

Returns a list of scan folders recorded in the database.

Parameters
scanFoldergets appended with the found folders.

◆ GetSourceInfoBySourcePath()

virtual bool AzToolsFramework::AssetSystem::AssetSystemRequest::GetSourceInfoBySourcePath ( const char *  sourcePath,
AZ::Data::AssetInfo &  assetInfo,
AZStd::string &  watchFolder 
)
pure virtual

Given a path to a source file, retrieve its actual watch folder path and details.

Parameters
sourcePathis either a relative or absolute path to a source file.
assetInfois a /ref AZ::Data::AssetInfo filled out with details about the asset including its relative path to its watch folder note that inside assetInfo is a AssetId, but only the UUID-part will ever have a value since we are dealing with a source file (no subid)
watchFolderis the scan folder that it was found inside (the path in the assetInfo is relative to this folder). If you Path::Join the watchFolder and the assetInfo relative path, you get the full path. returns false if it cannot find the source, true otherwise.

◆ GetSourceInfoBySourceUUID()

virtual bool AzToolsFramework::AssetSystem::AssetSystemRequest::GetSourceInfoBySourceUUID ( const AZ::Uuid &  sourceUuid,
AZ::Data::AssetInfo &  assetInfo,
AZStd::string &  watchFolder 
)
pure virtual

Given a UUID of a source file, retrieve its actual watch folder path and other details.

Parameters
sourceUUIDis the UUID of a source file - If you have an AssetID, its the m_guid member of that assetId
assetInfois a /ref AZ::Data::AssetInfo filled out with details about the asset including its relative path to its watch folder note that inside assetInfo is a AssetId, but only the UUID-part will ever have a value since we are dealing with a source file (no subid)
watchFolderis the scan folder that it was found inside (the path in the assetInfo is relative to this folder). If you Path::Join the watchFolder and the assetInfo relative path, you get the full path to the source file on physical media returns false if it cannot find the source, true otherwise.

◆ IsAssetPlatformEnabled()

virtual bool AzToolsFramework::AssetSystem::AssetSystemRequest::IsAssetPlatformEnabled ( const char *  platform)
pure virtual

Query to see if a specific asset platform is enabled

Parameters
platformthe asset platform to check e.g. android, ios, etc.
Returns
true if enabled, false otherwise

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