Qt3DCore::QSkeletonLoader Class
class Qt3DCore::QSkeletonLoader用于从文件中加载关节骨架。更多...
| 头文件: | #include <QSkeletonLoader> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS 3DCore) target_link_libraries(mytarget PRIVATE Qt6::3DCore) |
| qmake: | QT += 3dcore |
| 在 QML 中: | SkeletonLoader |
| 继承自: | Qt3DCore::QAbstractSkeleton |
| 状态: | 已弃用 |
该类已弃用。我们强烈建议不要在新代码中使用它。
公共类型
| enum | Status { NotReady, Ready, Error } |
属性
- createJointsEnabled : bool
- rootJoint : Qt3DCore::QJoint*
- source : QUrl
- status : Status
公共函数
| QSkeletonLoader(Qt3DCore::QNode *parent = nullptr) | |
| QSkeletonLoader(const QUrl &source, Qt3DCore::QNode *parent = nullptr) | |
| bool | isCreateJointsEnabled() const |
| Qt3DCore::QJoint * | rootJoint() const |
| QUrl | source() const |
| Qt3DCore::QSkeletonLoader::Status | status() const |
公共槽位
| void | setCreateJointsEnabled(bool enabled) |
| void | setSource(const QUrl &source) |
信号
| void | createJointsEnabledChanged(bool createJointsEnabled) |
| void | rootJointChanged(Qt3DCore::QJoint *rootJoint) |
| void | sourceChanged(const QUrl &source) |
| void | statusChanged(Qt3DCore::QSkeletonLoader::Status status) |
详细说明
如果您希望从文件中加载整个骨骼,而不是使用 Skeleton 和 Joints 自行创建关节,请使用SkeletonLoader 。 在Blender等3D数字内容创作工具中,创建骨骼并将网格的顶点绑定到骨骼是最简单的方法。生成的骨骼和网格随后可以导出为glTF 2等合适格式,供Qt 3D 使用。
成员类型文档
enum QSkeletonLoader::Status
此枚举用于标识骨架的状态。
| 常量 | 值 | 描述 |
|---|---|---|
Qt3DCore::QSkeletonLoader::NotReady | 0 | 骨架尚未加载 |
Qt3DCore::QSkeletonLoader::Ready | 1 | 骨架已成功加载 |
Qt3DCore::QSkeletonLoader::Error | 2 | 加载骨架时发生错误 |
属性文档
createJointsEnabled : bool
该属性存储一个布尔值,用于指示 createJoints 是否已启用。
访问函数:
| bool | isCreateJointsEnabled() const |
| void | setCreateJointsEnabled(bool enabled) |
通知器信号:
| void | createJointsEnabledChanged(bool createJointsEnabled) |
[read-only] rootJoint : Qt3DCore::QJoint*
该属性保存构成骨骼的关节层次结构的根关节。
保存从源文件加载的骨骼层次结构的根关节。
访问函数:
| Qt3DCore::QJoint * | rootJoint() const |
通知信号:
| void | rootJointChanged(Qt3DCore::QJoint *rootJoint) |
source : QUrl
存储用于加载骨架的源网址。
访问函数:
| QUrl | source() const |
| void | setSource(const QUrl &source) |
通知器信号:
| void | sourceChanged(const QUrl &source) |
[read-only] status : Status
保存骨架加载的当前状态。
访问函数:
| Qt3DCore::QSkeletonLoader::Status | status() const |
通知信号:
| void | statusChanged(Qt3DCore::QSkeletonLoader::Status status) |
成员函数文档
[explicit] QSkeletonLoader::QSkeletonLoader(Qt3DCore::QNode *parent = nullptr)
使用parent 创建一个新的QSkeletonLoader。
[explicit] QSkeletonLoader::QSkeletonLoader(const QUrl &source, Qt3DCore::QNode *parent = nullptr)
使用parent 创建一个新的QSkeletonLoader,并设置source 。
bool QSkeletonLoader::isCreateJointsEnabled() const
返回一个布尔值,用于指示 CreateJoints 是否已启用。默认值为false 。
注意: 这是属性createJointsEnabled 的获取器 函数。
Qt3DCore::QJoint *QSkeletonLoader::rootJoint() const
返回构成骨骼的关节层次结构中的根关节。
注意: 这是属性 rootJoint 的获取 函数。
© 2026 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.