RSX Code Reference
    Preparing search index...
    • rsx
    • TypeScriptImporter

    Class TypeScriptImporter<ImportOptionsType>Abstract

    Allows implementing resource importes from TypeScript code.

    Type Parameters

    • ImportOptionsType extends object = object
    Index
    • Virtual

      Gets the description of the importer.

      Returns string

    • Virtual

      Gets the name of the developer.

      Returns string

    • Virtual

      Gets the name of the importer.

      Returns string

    • Virtual

      Gets an array containing all supported extensions, in lowercase.

      Returns string[]

    • Virtual

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

      Parameters

      • magicNumbers: number[]

      Returns boolean

    • Virtual

      Creates import options specific for this importer. Import options are provided when calling onImport to customize the import, and provide additional information.

      Returns ImportOptionsType

    • Virtual

      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).

      Parameters

      • sourceData: DataStream

        The data of the source file to import from.

      • filePath: FilePath

        Pathname of the file, with file extension.

      • importProgress: TaskProgress

        The operation progress.

      • importOptions: ImportOptionsType

        Options that can control how is the resource imported.

      • filePeekInformation: ImportFileInformation

        Optional import information cache in case the file was peeked before importing.

      Returns Promise<ImportedSubResource>

      A resource import result containing the resource or an error message.

    • Virtual

      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).

      Parameters

      • sourceData: DataStream

        The data of the source file to import from.

      • filePath: FilePath

        Pathname of the file, with file extension.

      • importProgress: TaskProgress

        The operation progress.

      • importOptions: ImportOptionsType

        Options that can control how are the resources imported.

      • OptionalfilePeekInformation: ImportFileInformation

        Optional import information cache in case the file was peeked before importing.

      Returns Promise<ImportedSubResource[]>

      An array of imported resource, that might be successful of have failed. First element is always the primary resource.