Class Importer

Module responsible for importing various asset types and converting them to types usable by the engine.

Constructors

Methods

  • Imports a resource at the specified location, and returns the loaded data. If file contains more than one resource only the primary resource is imported (for example an FBX a mesh would be imported, but animations ignored).

    Parameters

    • inputFilePath: FilePath

      Pathname of the input file.

    • OptionalimportOptions: Const<ImportOptions>

      (optional) Options for controlling the import. Caller must ensure import options actually match the type of the importer used for the file type.

    • Optionaluuid: UUID

      Specific UUID to assign to the resource. If not specified a randomly generated UUID will be assigned.

    Returns Resource

    Imported resource.

    Thread safe.

  • Imports a resource at the specified location, and returns the loaded data. 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).

    Parameters

    • inputFilePath: FilePath

      Pathname of the input file.

    • OptionalimportOptions: Const<ImportOptions>

      (optional) Options for controlling the import. Caller must ensure import options actually match the type of the importer used for the file type.

    Returns MultiResource

    A list of all imported resources. The primary resource is always the first returned resource.

    Thread safe.

  • Same as ImportAll(), except it imports a resource without blocking the main thread. The returned AsyncOp will contain a list of the imported resources, after the import ends.

    Parameters

    Returns AsyncOp<MultiResource, void>

  • Peek into a file to gather information about it.

    Parameters

    Returns ImportFileInformation

    A object with the best Import Options for that given file and also a cache of the information that has been read.

  • Checks if we can import a file with the specified extension.

    Parameters

    • extension: string

      The extension without the leading dot.

    Returns boolean