RuntimeLoader QML Type

在运行时导入 3D 资产。更多

Import Statement: import QtQuick3D.AssetUtils
Since: Qt 6.2
Inherits:

Node

属性

详细说明

RuntimeLoader 类型提供了一种在运行时直接从源代码加载 3D 资产的方法,而无需先将其转换为QtQuick3D 的内部格式。

RuntimeLoader 支持 .obj 和 glTF 2.0 版本的文本(.gltf)和二进制(.glb)格式文件。

属性文档

bounds : Bounds [read-only]

该属性描述了导入模型周围的边界体的范围。

注意: 该值在第一次渲染前可能不可用


errorString : string [read-only]

该属性是一个可读字符串,表示最新加载操作的状态。


instancing : Instancing

如果设置了该属性,则不会正常渲染导入的模型。相反,将根据实例表的定义渲染若干实例。

更多信息,请参阅实例渲染概述文档。


source : url

此属性保存包含 3D 资产的源文件的位置。更改此属性将卸载当前资产,并尝试从给定的 URL 加载资产。

加载操作的成功或失败由status 表示。


status : enumeration [read-only]

此属性保存最新加载操作的状态。

常量说明
RuntimeLoader.Empty未指定 URL。
RuntimeLoader.Success加载操作成功。
RuntimeLoader.Error加载操作失败。errorString 提供了人可读的错误信息。

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