# scene.gltf2.Loader

## Method

Loader.__init__(meta: SceneDescription)

  Initialize loading GLTF 2 scene.

  Supported formats:

  - gltf json format with external resources

  - gltf embedded buffers

  - glb Binary format

classmethod Loader.supports_file(meta)

  Check if the loader has a supported file extension.

  What extensions are supported can be defined in the `file_extensions` class attribute.

Loader.load() → Scene

  Load a GLTF 2 scene including referenced textures.

  Returns:

    The scene instance

  Return type:

    Scene

Loader.find_data(path)

  Find resource using data finders.

  This is mainly a shortcut method to simplify the task.

  Parameters:

    path – Path to resource

Loader.find_program(path)

  Find resource using program finders.

  This is mainly a shortcut method to simplify the task.

  Parameters:

    path – Path to resource

Loader.find_texture(path)

  Find resource using texture finders.

  This is mainly a shortcut method to simplify the task.

  Parameters:

    path – Path to resource

Loader.find_scene(path)

  Find resource using scene finders.

  This is mainly a shortcut method to simplify the task.

  Parameters:

    path – Path to resource

## Loader Specific Methods

Loader.load_gltf()

  Loads a gltf json file parsing its contents

Loader.load_glb()

  Loads a binary gltf file parsing its contents

Loader.load_materials()

  Load materials referenced in gltf metadata

Loader.load_nodes()

  Load nodes referenced in gltf metadata

Loader.load_node(meta, parent=None)

  Load a single node

Loader.load_images()

  Load images referenced in gltf metadata

Loader.load_textures()

  Load textures referenced in gltf metadata

Loader.load_samplers()

  Load samplers referenced in gltf metadata

Loader.load_meshes()

  Load meshes referenced in gltf metadata

## Attributes

Loader.kind = 'gltf'

  The kind of resource this loaded supports. This can be used when file extensions is not enough to decide what loader should be selected.

Loader.file_extensions = [['.gltf'], ['.glb']]

  A list defining the file extensions accepted by this loader.

  Example:

      # Loader will match .xyz and .xyz.gz files.
      file_extensions = [
          ['.xyz'],
          ['.xyz', '.gz'],
      ]

Loader.ctx

  ModernGL context

  Type:

    moderngl.Context

## Loader Specific Attributes

Loader.supported_extensions = []

  Supported GLTF extensions https://github.com/KhronosGroup/glTF/tree/master/extensions