Open 3D Engine AzFramework API Reference 26.05.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AzFramework::GenericAssetHandler< AssetType > Class Template Reference

Inherits AzFramework::GenericAssetHandlerBase, and AZ::AssetTypeInfoBus::Handler.

Public Member Functions

 AZ_CLASS_ALLOCATOR (GenericAssetHandler< AssetType >, AZ::SystemAllocator)
 
 AZ_RTTI (GenericAssetHandler< AssetType >, "{8B36B3E8-8C0B-4297-BDA2-1648C155C78E}", GenericAssetHandlerBase)
 
 GenericAssetHandler (const char *displayName, const char *group, const char *extension, const AZ::Uuid &componentTypeId=AZ::Uuid::CreateNull(), AZ::SerializeContext *serializeContext=nullptr, const AZ::DataStream::StreamType streamType=AZ::ObjectStream::ST_XML, const bool autoProcessToCache=false)
 
bool AutoBuildAssetToCache () override
 
void SetAutoBuildAssetToCache (bool autoBuild)
 
AZ::Data::AssetPtr CreateAsset (const AZ::Data::AssetId &, const AZ::Data::AssetType &) override
 
AZ::Data::AssetHandler::LoadResult LoadAssetData (const AZ::Data::Asset< AZ::Data::AssetData > &asset, AZStd::shared_ptr< AZ::Data::AssetDataStream > stream, const AZ::Data::AssetFilterCB &assetLoadFilterCB) override
 
bool SaveAssetData (const AZ::Data::Asset< AZ::Data::AssetData > &asset, AZ::IO::GenericStream *stream) override
 
void DestroyAsset (AZ::Data::AssetPtr ptr) override
 
void GetHandledAssetTypes (AZStd::vector< AZ::Data::AssetType > &assetTypes) override
 
void Register ()
 
void Unregister ()
 
bool CanHandleAsset (const AZ::Data::AssetId &id) const override
 
AZ::Data::AssetType GetAssetType () const override
 
const char * GetAssetTypeDisplayName () const override
 
const char * GetGroup () const override
 
AZ::Uuid GetComponentTypeId () const override
 
void GetAssetTypeExtensions (AZStd::vector< AZStd::string > &extensions) override
 
 GenericAssetHandler (const GenericAssetHandler &)=delete
 
- Public Member Functions inherited from AzFramework::GenericAssetHandlerBase
 AZ_RTTI (GenericAssetHandlerBase, "{B153B8B5-25CC-4BB7-A2BD-9A47ECF4123C}", AZ::Data::AssetHandler)
 
AZ::Data::AssetId AssetMissingInCatalog (const AZ::Data::Asset< AZ::Data::AssetData > &asset) override
 

Public Attributes

AZStd::string m_displayName
 
AZStd::string m_group
 
AZStd::string m_extension
 
bool m_autoProcessAsset = false
 
AZ::Uuid m_componentTypeId = AZ::Uuid::CreateNull()
 
AZ::SerializeContext * m_serializeContext
 
AZ::DataStream::StreamType m_streamType
 

Constructor & Destructor Documentation

◆ GenericAssetHandler()

template<typename AssetType >
AzFramework::GenericAssetHandler< AssetType >::GenericAssetHandler ( const char *  displayName,
const char *  group,
const char *  extension,
const AZ::Uuid &  componentTypeId = AZ::Uuid::CreateNull(),
AZ::SerializeContext *  serializeContext = nullptr,
const AZ::DataStream::StreamType  streamType = AZ::ObjectStream::ST_XML,
const bool  autoProcessToCache = false 
)
inline

Construct your generic asset handler.

Parameters
displayNameThe name of the asset type to show in the user-facing guis and logs
extensionThe file extension to associate with this asset type. JUST the extension without a dot.
componentTypeIdIf this asset type is meant to be automatically added as a component to entities when dragged and dropped into the level, specify the component typeid here. This should be the typeid of the component that should be added.
streamTypeThe type of stream to use when saving this asset. (Default is ObjectStream XML)
autoProcessToCacheIf true, the asset system will automatically process this asset into the cache using the asset processor, and automatically extract dependencies for it. if False, you're expected to do that work yourself, by either making a RC COPY rule in the asset processor setreg, or make your own Asset Builder (Custom) to handle extreme custom cases.

Member Function Documentation

◆ AutoBuildAssetToCache()

template<typename AssetType >
bool AzFramework::GenericAssetHandler< AssetType >::AutoBuildAssetToCache ( )
inlineoverridevirtual

Overridden in GenericAssetHandler to return whether or not the asset should be auto processed into the cache. This is based on what the constructor sets.

Implements AzFramework::GenericAssetHandlerBase.


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