SceneLoader QML Type

提供加载现有场景的功能。更多

Import Statement: import Qt3D.Render 2.9
In C++: QSceneLoader
Inherits:

Component

Status: Deprecated

属性

方法

详细说明

给定一个 3D 源文件后,SceneLoader 会尝试对其进行解析,并构建一棵包含适当GeometryRenderer 、变换和材质组件的实体对象树。

加载器将尝试根据模型文件的属性确定使用的最佳材质。如果您希望使用自定义材质,则必须遍历该树,并将默认关联材质替换为您的材质。

顾名思义,SceneLoader 载入的是一个完整的场景子树。如果要加载单个几何体,则应使用网格。

SceneLoader 内部依赖插件来支持多种 3D 文件格式。以下是 Qt3D 支持的格式列表。

注意: 此组件不应在多个实体实例之间共享。这将导致未定义的行为。

另请参阅 MeshGeometryRenderer

属性文档

source : url

保存要加载的源的 url。


status : enumeration [read-only]

显示场景加载的状态。

另请参阅 Qt3DRender::QSceneLoader::Status


方法文档

Entity component(string entityName, enumeration componentType)

Returns a component matchingcomponentType of a loaded entity with anobjectNamematching theentityName. 如果实体有多个匹配的组件,则返回实体组件列表中第一个匹配的组件。如果没有匹配项,则返回未定义项。

另请参阅 Qt3DRender::QSceneLoader::ComponentType


Entity entity(string entityName)

返回已加载的实体,其objectNameentityName 参数匹配。如果多个实体具有相同的名称,则无法确定返回哪个实体,但总是返回相同的实体。


list entityNames()

返回已加载实体的objectNames 列表。


© 2025 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.