XII Release 0.1.0
Loading...
Searching...
No Matches
xiiAssetDocumentManager Class Referenceabstract
Inheritance diagram for xiiAssetDocumentManager:
[legend]

Public Member Functions

virtual xiiStatus ReadAssetDocumentInfo (xiiUniquePtr< xiiAssetDocumentInfo > &out_pInfo, xiiStreamReader &inout_stream) const
 Opens the asset file and reads the "Header" into the given xiiAssetDocumentInfo.
 
virtual void FillOutSubAssetList (const xiiAssetDocumentInfo &assetInfo, xiiDynamicArray< xiiSubAssetData > &out_subAssets) const
 
virtual xiiStatus GetAdditionalOutputs (xiiDynamicArray< xiiString > &ref_files)
 
virtual xiiStatus CloneDocument (xiiStringView sPath, xiiStringView sClonePath, xiiUuid &inout_cloneGuid) override
 
virtual xiiResult OpenPickedDocument (const xiiDocumentObject *pPickedComponent, xiiUInt32 uiPartIndex)
 Called by the editor to try to open a document for the matching picking result.
 
xiiResult TryOpenAssetDocument (const char *szPathOrGuid)
 
virtual void GetAssetTypesRequiringTransformForSceneExport (xiiSet< xiiTempHashedString > &inout_assetTypes)
 
Thumbnail Functions
virtual xiiString GenerateResourceThumbnailPath (xiiStringView sDocumentPath, xiiStringView sSubAssetName=xiiStringView())
 Returns the absolute path to the thumbnail that belongs to the given document.
 
virtual bool IsThumbnailUpToDate (xiiStringView sDocumentPath, xiiStringView sSubAssetName, xiiUInt64 uiThumbnailHash, xiiUInt32 uiTypeVersion)
 
- Public Member Functions inherited from xiiDocumentManager
xiiStatus CanOpenDocument (xiiStringView sFilePath) const
 
xiiStatus CreateDocument (xiiStringView sDocumentTypeName, xiiStringView sPath, xiiDocument *&out_pDocument, xiiBitflags< xiiDocumentFlags > flags=xiiDocumentFlags::None, const xiiDocumentObject *pOpenContext=nullptr)
 Creates a new document.
 
xiiStatus OpenDocument (xiiStringView sDocumentTypeName, xiiStringView sPath, xiiDocument *&out_pDocument, xiiBitflags< xiiDocumentFlags > flags=xiiDocumentFlags::AddToRecentFilesList|xiiDocumentFlags::RequestWindow, const xiiDocumentObject *pOpenContext=nullptr)
 Opens an existing document.
 
void CloseDocument (xiiDocument *pDocument)
 
void EnsureWindowRequested (xiiDocument *pDocument, const xiiDocumentObject *pOpenContext=nullptr)
 
const xiiDynamicArray< xiiDocument * > & GetAllOpenDocuments () const
 Returns a list of all currently open documents that are managed by this document manager.
 
xiiDocumentGetDocumentByPath (xiiStringView sPath) const
 
bool EnsureDocumentIsClosed (xiiStringView sPath)
 If the given document is open, it will be closed. User is not asked about it, unsaved changes are discarded. Returns true if the document was open and needed to be closed. This function only operates on documents opened by this manager. Use EnsureDocumentIsClosedInAllManagers() to close documents of any type.
 
void CloseAllDocumentsOfManager ()
 
void GetSupportedDocumentTypes (xiiDynamicArray< const xiiDocumentTypeDescriptor * > &inout_documentTypes) const
 
- Public Member Functions inherited from xiiReflectedClass
virtual const xiiRTTIGetDynamicRTTI () const
 
bool IsInstanceOf (const xiiRTTI *pType) const
 Returns whether the type of this instance is of the given type or derived from it.
 
template<typename T>
XII_ALWAYS_INLINE bool IsInstanceOf () const
 Returns whether the type of this instance is of the given type or derived from it.
 

Static Protected Member Functions

static bool IsResourceUpToDate (const char *szResourceFile, xiiUInt64 uiHash, xiiUInt16 uiTypeVersion)
 
static void GenerateOutputFilename (xiiStringBuilder &inout_sRelativeDocumentPath, const xiiPlatformProfile *pAssetProfile, const char *szExtension, bool bPlatformSpecific)
 

Output Functions

enum  OutputReliability : xiiUInt8 { Unknown = 0 , Good = 1 , Perfect = 2 }
 
virtual void AddEntriesToAssetTable (xiiStringView sDataDirectory, const xiiPlatformProfile *pAssetProfile, xiiDelegate< void(xiiStringView sGuid, xiiStringView sPath, xiiStringView sType)> addEntry) const
 
virtual xiiString GetAssetTableEntry (const xiiSubAsset *pSubAsset, xiiStringView sDataDirectory, const xiiPlatformProfile *pAssetProfile) const
 
xiiString GetAbsoluteOutputFileName (const xiiAssetDocumentTypeDescriptor *pTypeDesc, xiiStringView sDocumentPath, xiiStringView sOutputTag, const xiiPlatformProfile *pAssetProfile=nullptr) const
 Calls GetRelativeOutputFileName and prepends [DataDir]/AssetCache/ .
 
virtual xiiString GetRelativeOutputFileName (const xiiAssetDocumentTypeDescriptor *pTypeDesc, xiiStringView sDataDirectory, xiiStringView sDocumentPath, xiiStringView sOutputTag, const xiiPlatformProfile *pAssetProfile=nullptr) const
 Relative to 'AssetCache' folder.
 
virtual bool GeneratesProfileSpecificAssets () const =0
 
bool IsOutputUpToDate (xiiStringView sDocumentPath, const xiiDynamicArray< xiiString > &outputs, xiiUInt64 uiHash, const xiiAssetDocumentTypeDescriptor *pTypeDescriptor)
 
virtual bool IsOutputUpToDate (xiiStringView sDocumentPath, xiiStringView sOutputTag, xiiUInt64 uiHash, const xiiAssetDocumentTypeDescriptor *pTypeDescriptor)
 
virtual OutputReliability GetAssetTypeOutputReliability () const
 

Asset Profile Functions

void ComputeAssetProfileHash (const xiiPlatformProfile *pAssetProfile)
 Called by the xiiAssetCurator when the active asset profile changes to re-compute m_uiAssetProfileHash.
 
XII_ALWAYS_INLINE xiiUInt64 GetAssetProfileHash () const
 Returns the hash that was previously computed through ComputeAssetProfileHash().
 
static const xiiPlatformProfileDetermineFinalTargetProfile (const xiiPlatformProfile *pAssetProfile)
 Returns pAssetProfile, or if that is null, xiiAssetCurator::GetSingleton()->GetActiveAssetProfile().
 

Additional Inherited Members

- Public Types inherited from xiiDocumentManager
using CustomAction = xiiVariant (*)(const xiiDocument*)
 
- Static Public Member Functions inherited from xiiDocumentManager
static const xiiHybridArray< xiiDocumentManager *, 16 > & GetAllDocumentManagers ()
 
static xiiResult FindDocumentTypeFromPath (xiiStringView sPath, bool bForCreation, const xiiDocumentTypeDescriptor *&out_pTypeDesc)
 
static xiiDocumentGetDocumentByGuid (const xiiUuid &guid)
 
static bool EnsureDocumentIsClosedInAllManagers (xiiStringView sPath)
 If the given document is open, it will be closed. User is not asked about it, unsaved changes are discarded. Returns true if the document was open and needed to be closed.
 
static void CloseAllDocuments ()
 
static const xiiDocumentTypeDescriptorGetDescriptorForDocumentType (xiiStringView sDocumentType)
 
static const xiiMap< xiiString, const xiiDocumentTypeDescriptor * > & GetAllDocumentDescriptors ()
 
- Static Public Member Functions inherited from xiiNoBase
static const xiiRTTIGetStaticRTTI ()
 
- Static Public Attributes inherited from xiiDocumentManager
static xiiCopyOnBroadcastEvent< const Event & > s_Events
 
static xiiEvent< Request & > s_Requests
 
static xiiMap< xiiString, CustomAction > s_CustomActions
 
- Protected Member Functions inherited from xiiDocumentManager
virtual void InternalCloneDocument (xiiStringView sPath, xiiStringView sClonePath, const xiiUuid &documentId, const xiiUuid &seedGuid, const xiiUuid &cloneGuid, xiiAbstractObjectGraph *pHeader, xiiAbstractObjectGraph *pObjects, xiiAbstractObjectGraph *pTypes)
 

Member Enumeration Documentation

◆ OutputReliability

Describes how likely it is that a generated file is 'corrupted', due to dependency issues and such. For example a prefab may not work correctly, if it was written with a very different C++ plugin state, but this can't be detected later. Whereas a texture always produces exactly the same output and is thus perfectly reliable. This is used to clear asset caches selectively, and keep things that are unlikely to be in a broken state.

Member Function Documentation

◆ CloneDocument()

xiiStatus xiiAssetDocumentManager::CloneDocument ( xiiStringView sPath,
xiiStringView sClonePath,
xiiUuid & inout_cloneGuid )
overridevirtual

Reimplemented from xiiDocumentManager.

◆ GetAdditionalOutputs()

virtual xiiStatus xiiAssetDocumentManager::GetAdditionalOutputs ( xiiDynamicArray< xiiString > & ref_files)
inlinevirtual

If this asset type has additional output files that need to be generated (like a texture atlas that combines outputs from multiple assets) this function should make sure those files are all generated and return the list of relative file paths (from the data directory root).

◆ GetAssetTypeOutputReliability()

◆ GetAssetTypesRequiringTransformForSceneExport()

virtual void xiiAssetDocumentManager::GetAssetTypesRequiringTransformForSceneExport ( xiiSet< xiiTempHashedString > & inout_assetTypes)
inlinevirtual

In case this manager deals with types that need to be force transformed on scene export, it can add the asset type names to this list. This is only needed for assets that have such special dependencies for their transform step, that the regular dependency tracking doesn't work for them. Currently the only known case are Collection assets, because they have to manually go through the Package dependencies transitively, which means that the asset curator can't know when they need to be updated.

Reimplemented in xiiCollectionAssetDocumentManager.

◆ GetRelativeOutputFileName()

xiiString xiiAssetDocumentManager::GetRelativeOutputFileName ( const xiiAssetDocumentTypeDescriptor * pTypeDesc,
xiiStringView sDataDirectory,
xiiStringView sDocumentPath,
xiiStringView sOutputTag,
const xiiPlatformProfile * pAssetProfile = nullptr ) const
virtual

Relative to 'AssetCache' folder.

Reimplemented in xiiMaterialAssetDocumentManager, and xiiTextureAssetDocumentManager.

◆ OpenPickedDocument()

virtual xiiResult xiiAssetDocumentManager::OpenPickedDocument ( const xiiDocumentObject * pPickedComponent,
xiiUInt32 uiPartIndex )
inlinevirtual

Called by the editor to try to open a document for the matching picking result.

Reimplemented in xiiMeshAssetDocumentManager.


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