Skip to content

Kuesa::Serenity::GLTF2Importer

Imports glTF 2 scenes into a Serenity 3D scene. More...

#include <Kuesa/Serenity/api/gltf2importer.h>

Inherits from KDFoundation::Object

Public Types

Name
enum class Status { None, Loading, Ready, Error}

Public Functions

Name
GLTF2Importer()
~GLTF2Importer()
std::vector< std::unique_ptr<::Serenity::Entity > > & sceneRoots()

Public Attributes

Name
KDBindings::Property< String > source
the source of the glTF file
KDBindings::Property< bool > assignNames
if true, assets with no names will be added to collections with default names (default is false)
KDBindings::Property<::Serenity::LayerManager * > layerManager
KDBindings::Property< AssetCollections * > assetCollections
asset collections
KDBindings::Property< Status > status

Detailed Description

1
class Kuesa::Serenity::GLTF2Importer;

Imports glTF 2 scenes into a Serenity 3D scene.

Since: Kuesa 2.0

Note: Materials are registered using the name of the glTF node that references the glTF mesh.

GLTF2Importer imports glTF 2 scenes into a Serenity 3D scene.

1
2
3
4
Kuesa::Serenity::GLTF2Importer importer;
Kuesa::Serenity::AssetCollections assetCollections;
importer.assetCollections = &assetCollections;
importer.source = String(model.gltf");

If a Kuesa::Serenity::AssectCollections has been set on the importer, various Qt 3D resources generated upon import will be registered into named collections. If no name is specified for an asset in the glTF, a default name will be assigned to the asset. If several assets of the same type share the same name, subsequent assets will be given unique names by appending an index.

Below is a list of resources currently registered into collections:

  • AnimationClips
  • AnimationMappers
  • Cameras
  • Entities
  • Lights
  • Meshes
  • Materials
  • Textures
  • Transforms

Public Types Documentation

enum Status

Enumerator Value Description
None
Loading
Ready
Error

Public Functions Documentation

function GLTF2Importer

1
GLTF2Importer()

function ~GLTF2Importer

1
~GLTF2Importer()

function sceneRoots

1
std::vector< std::unique_ptr<::Serenity::Entity > > & sceneRoots()

Public Attributes Documentation

variable source

1
KDBindings::Property< String > source {};

the source of the glTF file

variable assignNames

1
KDBindings::Property< bool > assignNames { false };

if true, assets with no names will be added to collections with default names (default is false)

variable layerManager

1
KDBindings::Property<::Serenity::LayerManager * > layerManager { nullptr };

variable assetCollections

1
KDBindings::Property< AssetCollections * > assetCollections { nullptr };

asset collections

See: Kuesa::Serenity::AssetCollections

variable status

1
KDBindings::Property< Status > status { Status::None };

Updated on 2023-07-03 at 08:07:22 +0000