QSkeletonLoader Class

class Qt3DCore::QSkeletonLoader

Used to load a skeleton of joints from file. More...

Header: #include <QSkeletonLoader>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3dcore)
target_link_libraries(mytarget PRIVATE Qt6::3dcore)
qmake: QT += 3dcore
Since: Qt 5.10
Instantiated By: SkeletonLoader
Inherits: Qt3DCore::QAbstractSkeleton

Public Types

enum Status { NotReady, Ready, Error }

Properties

Public Functions

QSkeletonLoader(const QUrl &source, Qt3DCore::QNode *parent = nullptr)
QSkeletonLoader(Qt3DCore::QNode *parent = nullptr)
bool isCreateJointsEnabled() const
Qt3DCore::QJoint *rootJoint() const
QUrl source() const
Qt3DCore::QSkeletonLoader::Status status() const

Public Slots

void setCreateJointsEnabled(bool enabled)
void setSource(const QUrl &source)

Signals

void createJointsEnabledChanged(bool createJointsEnabled)
void rootJointChanged(Qt3DCore::QJoint *rootJoint)
void sourceChanged(const QUrl &source)
void statusChanged(Qt3DCore::QSkeletonLoader::Status status)

Detailed Description

Use SkeletonLoader if you wish to load a whole skeleton from file rather than creating the joints yourself using Skeleton and Joints. Creating a skeleton and binding the vertices of a mesh to the skeleton is most easily performed in a 3D digital content creation tool such as Blender. The resulting skeleton and mesh can then be exported in a suitable format such as glTF 2 for consumption by Qt 3D.

Member Type Documentation

enum QSkeletonLoader::Status

This enum identifies the status of skeleton.

ConstantValueDescription
Qt3DCore::QSkeletonLoader::NotReady0The skeleton has not been loaded yet
Qt3DCore::QSkeletonLoader::Ready1The skeleton was successfully loaded
Qt3DCore::QSkeletonLoader::Error2An error occurred while loading the skeleton

Property Documentation

createJointsEnabled : bool

This property holds a boolean to indicate whether createJoints is enabled or not.

Access functions:

bool isCreateJointsEnabled() const
void setCreateJointsEnabled(bool enabled)

Notifier signal:

void createJointsEnabledChanged(bool createJointsEnabled)

source : QUrl

Holds the source url from which to load the skeleton.

Access functions:

QUrl source() const
void setSource(const QUrl &source)

Notifier signal:

void sourceChanged(const QUrl &source)

[read-only] status : const Status

Holds the current status of skeleton loading.

Access functions:

Qt3DCore::QSkeletonLoader::Status status() const

Notifier signal:

void statusChanged(Qt3DCore::QSkeletonLoader::Status status)

Member Function Documentation

QSkeletonLoader::QSkeletonLoader(const QUrl &source, Qt3DCore::QNode *parent = nullptr)

Constructs a new QSkeletonLoader with parent and sets the source.

QSkeletonLoader::QSkeletonLoader(Qt3DCore::QNode *parent = nullptr)

Constructs a new QSkeletonLoader with parent.

bool QSkeletonLoader::isCreateJointsEnabled() const

Returns a boolean indicating whether CreateJoints is enabled or not. The default value is false.

Note: Getter function for property createJointsEnabled.

Qt3DCore::QJoint *QSkeletonLoader::rootJoint() const

Returns the root joint of the hierarchy of joints forming the skeleton.

Note: Getter function for property rootJoint.

© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.