GLTFImporter Class

(Qt3DRender::GLTFImporter)

Handles importing of gltf files. More...

Header: #include <GLTFImporter>
qmake: QT += 3drender

Public Functions

GLTFImporter()
~GLTFImporter()
bool areFileTypesSupported(const QStringList &extensions) const
Qt3DCore::QEntity *node(const QString &id)
Qt3DCore::QEntity *scene(const QString &id = QString())
void setBasePath(const QString &path)
void setData(const QByteArray &data, const QString &basePath)
bool setJSON(const QJsonDocument &json)
void setSource(const QUrl &source)

Detailed Description

Handles importing of gltf files

Member Function Documentation

GLTFImporter::GLTFImporter()

Default constructs an instance of GLTFImporter.

GLTFImporter::~GLTFImporter()

Destroys the instance of GLTFImporter.

bool GLTFImporter::areFileTypesSupported(const QStringList &extensions) const

Returns true if the extensions are supported by the GLTF parser.

Qt3DCore::QEntity *GLTFImporter::node(const QString &id)

Imports the node specified in id from the GLTF file.

Qt3DCore::QEntity *GLTFImporter::scene(const QString &id = QString())

Imports the scene specified in parameter id.

void GLTFImporter::setBasePath(const QString &path)

Set the base path for importing scenes.

void GLTFImporter::setData(const QByteArray &data, const QString &basePath)

Sets the basePath used by the parser to load the scene file. If the file derived from data is valid, parsing is automatically triggered.

bool GLTFImporter::setJSON(const QJsonDocument &json)

Set a json document as the file used for importing a scene. Returns true if the operation is successful.

void GLTFImporter::setSource(const QUrl &source)

Sets the path based on parameter source. The path is used by the parser to load the scene file. If the file is valid, parsing is automatically triggered.