![]() |
XII Release 0.1.0
|
Provides functionality for importing files as asset documents. More...
#include <AssetDocumentGenerator.h>
Classes | |
struct | ImportMode |
Describes one option to import an asset. More... | |
Public Member Functions | |
xiiStatus | Import (xiiStringView sInputFileAbs, xiiStringView sMode, bool bOpenDocument) |
Imports the given file with the mode. Must be a mode that the generator supports. | |
virtual void | GetImportModes (xiiStringView sAbsInputFile, xiiDynamicArray< ImportMode > &out_modes) const =0 |
Used to fill out which import modes may be available for the given asset. | |
virtual xiiStringView | GetDocumentExtension () const =0 |
Returns the target asset document file extension. | |
virtual xiiStringView | GetGeneratorGroup () const =0 |
Allows to merge the import modes of multiple generators in the UI in one group. | |
virtual xiiStatus | Generate (xiiStringView sInputFileAbs, xiiStringView sMode, xiiDynamicArray< xiiDocument * > &out_generatedDocuments)=0 |
Tells the generator to create a new asset document with the chosen mode. | |
bool | SupportsFileType (xiiStringView sFile) const |
Returns whether this generator supports the given file type for import. | |
![]() | |
virtual const xiiRTTI * | GetDynamicRTTI () 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 Public Member Functions | |
static void | GetSupportsFileTypes (xiiSet< xiiString > &out_extensions) |
Creates a list of all importable file extensions. Note that this is an expensive function so the the result should be cached. | |
static void | ImportAssets () |
Opens a file browse dialog to let the user choose which files to import. | |
static void | ImportAssets (const xiiDynamicArray< xiiString > &filesToImport) |
Opens the "Asset Import" dialog to let the user choose how to import the given files. | |
static void | CreateGenerators (xiiHybridArray< xiiAssetDocumentGenerator *, 16 > &out_generators) |
Instantiates all currently available generators. | |
static void | DestroyGenerators (const xiiHybridArray< xiiAssetDocumentGenerator *, 16 > &generators) |
Destroys the previously instantiated generators. | |
![]() | |
static const xiiRTTI * | GetStaticRTTI () |
Protected Member Functions | |
void | AddSupportedFileType (xiiStringView sExtension) |
Friends | |
class | xiiQtAssetImportDlg |
Provides functionality for importing files as asset documents.
Derived from this class to add a custom importer (see existing derived classes for examples). Each importer typically handles one target asset type.
|
pure virtual |
Tells the generator to create a new asset document with the chosen mode.
Implemented in xiiAnimatedMeshAssetDocumentGenerator, xiiAnimationClipAssetDocumentGenerator, xiiDecalAssetDocumentGenerator, xiiLUTAssetDocumentGenerator, xiiMeshAssetDocumentGenerator, xiiSkeletonAssetDocumentGenerator, xiiTextureAssetDocumentGenerator, and xiiTextureCubeAssetDocumentGenerator.
|
pure virtual |
Returns the target asset document file extension.
Implemented in xiiAnimatedMeshAssetDocumentGenerator, xiiAnimationClipAssetDocumentGenerator, xiiDecalAssetDocumentGenerator, xiiLUTAssetDocumentGenerator, xiiMeshAssetDocumentGenerator, xiiSkeletonAssetDocumentGenerator, xiiTextureAssetDocumentGenerator, and xiiTextureCubeAssetDocumentGenerator.
|
pure virtual |
Allows to merge the import modes of multiple generators in the UI in one group.
Implemented in xiiAnimatedMeshAssetDocumentGenerator, xiiAnimationClipAssetDocumentGenerator, xiiDecalAssetDocumentGenerator, xiiLUTAssetDocumentGenerator, xiiMeshAssetDocumentGenerator, xiiSkeletonAssetDocumentGenerator, xiiTextureAssetDocumentGenerator, and xiiTextureCubeAssetDocumentGenerator.
|
pure virtual |
Used to fill out which import modes may be available for the given asset.
Note: sAbsInputFile may be empty, in this case it should fill out the array for "general purpose" import (any file of the supported types).
Implemented in xiiAnimatedMeshAssetDocumentGenerator, xiiAnimationClipAssetDocumentGenerator, xiiDecalAssetDocumentGenerator, xiiLUTAssetDocumentGenerator, xiiMeshAssetDocumentGenerator, xiiSkeletonAssetDocumentGenerator, xiiTextureAssetDocumentGenerator, and xiiTextureCubeAssetDocumentGenerator.
Creates a list of all importable file extensions. Note that this is an expensive function so the the result should be cached.
out_Extensions | List of all file extensions that can be imported. |
|
static |
Opens a file browse dialog to let the user choose which files to import.
After the user chose one or multiple files, opens the "Asset Import" dialog to let them choose details.