class SpecificImporter

Abstract class that is to be specialized for converting a certain asset type into an engine usable resource (for example a .png file into an engine usable texture).

On initialization this class must register itself with the Importer module, which delegates asset import calls to a specific importer.

Public

Constructors

SpecificImporter

SpecificImporter()

Methods

~SpecificImporter

virtual ~SpecificImporter() noexcept

IsExtensionSupported

virtual bool IsExtensionSupported(const String &extension) const = 0

Check is the provided extension supported by this importer.

IsMagicNumberSupported

virtual bool IsMagicNumberSupported(const u8 *magicNumber, u32 magicNumberSize) const = 0

Check if the provided magic number is supported by this importer.

GetAsyncMode

virtual ImporterAsyncMode GetAsyncMode() const

Returns the level of asynchronous import supported by this importer.

Import

virtual SPtr<Resource> Import(const Path &filePath, SPtr<const ImportOptions> importOptions) = 0

Imports the given file.

If file contains more than one resource only the primary resource is imported (for example for an FBX a mesh would be imported, but animations ignored).

filePath
Pathname of the file, with file extension.
importOptions
Options that can control how is the resource imported.

Returns: null if it fails, otherwise the loaded object.

ImportAll

virtual Vector<SubResourceRaw> ImportAll(const Path &filePath, SPtr<const ImportOptions> importOptions)

Imports the given file.

This method returns all imported resources, which is relevant for files that can contain multiple resources (for example an FBX which may contain both a mesh and animations).

filePath
Pathname of the file, with file extension.
importOptions
Options that can control how are the resources imported.

Returns: Empty array if it fails, otherwise the loaded objects. First element is always the primary resource.

CreateImportOptions

virtual SPtr<ImportOptions> CreateImportOptions() const

Creates import options specific for this importer.

Import options are provided when calling import() in order to customize the import, and provide additional information.

GetDefaultImportOptions

SPtr<const ImportOptions> GetDefaultImportOptions() const

Gets the default import options.

Returns: The default import options.

Private

Fields

mDefaultImportOptions

SPtr<const ImportOptions> mDefaultImportOptions