内容表

上一话题

Qt3DRender.QRenderTargetSelector

下一话题

Qt3DRender.QScissorTest

Qt3DRender.QSceneLoader

提供加载现有场景的设施。 更多

Inheritance diagram of PySide2.Qt3DRender.Qt3DRender.QSceneLoader

概要

函数

信号

详细描述

Given a 3D source file, the QSceneLoader will try to parse it and build a tree of QEntity objects with proper QGeometryRenderer , QTransform and QMaterial components.

The loader will try to determine the best material to be used based on the properties of the model file. If you wish to use a custom material, you will have to traverse the tree and replace the default associated materials with yours.

As the name implies, QSceneLoader loads a complete scene subtree. If you wish to load a single piece of geometry, you should rather use the QMesh 代替。

QSceneLoader internally relies on the use of plugins to support a wide variety of 3D file formats. Here is a list of formats that are supported by Qt3D.

注意

this component shouldn’t be shared among several QEntity instances. Undefined behavior will result.

另请参阅

QMesh QGeometryRenderer

class PySide2.Qt3DRender.Qt3DRender. QSceneLoader ( [ parent=None ] )
param parent

QNode

The constructor creates an instance with the specified parent .

PySide2.Qt3DRender.Qt3DRender.QSceneLoader. Status

This enum identifies the state of loading

常量

描述

Qt3DRender.QSceneLoader.None

QSceneLoader hasn’t been used yet.

Qt3DRender.QSceneLoader.Loading

QSceneLoader is currently loading the scene file.

Qt3DRender.QSceneLoader.Ready

QSceneLoader successfully loaded the scene file.

Qt3DRender.QSceneLoader.Error

QSceneLoader encountered an error while loading the scene file.

PySide2.Qt3DRender.Qt3DRender.QSceneLoader. ComponentType

This enum specifies a component type.

常量

描述

Qt3DRender.QSceneLoader.UnknownComponent

Unknown component type

Qt3DRender.QSceneLoader.GeometryRendererComponent

QGeometryRenderer component

Qt3DRender.QSceneLoader.TransformComponent

QTransform component

Qt3DRender.QSceneLoader.MaterialComponent

QMaterial component

Qt3DRender.QSceneLoader.LightComponent

QAbstractLight component

Qt3DRender.QSceneLoader.CameraLensComponent

QCameraLens component

PySide2.Qt3DRender.Qt3DRender.QSceneLoader. component ( entityName , componentType )
参数
返回类型

QComponent

Returns a component matching componentType of a loaded entity with an objectName matching the entityName . If the entity has multiple matching components, the first match in the component list of the entity is returned. If there is no match, a null pointer is returned.

PySide2.Qt3DRender.Qt3DRender.QSceneLoader. entity ( entityName )
参数

entityName – unicode

返回类型

QEntity

Returns a loaded entity with an objectName matching the entityName parameter. If multiple entities have the same name, it is undefined which one of them is returned, but it will always be the same one.

PySide2.Qt3DRender.Qt3DRender.QSceneLoader. entityNames ( )
返回类型

字符串列表

返回列表为 objectNames of the loaded entities.

PySide2.Qt3DRender.Qt3DRender.QSceneLoader. setSource ( arg )
参数

arg QUrl

另请参阅

source()

PySide2.Qt3DRender.Qt3DRender.QSceneLoader. setStatus ( status )
参数

status Status

注意

此函数被弃用。

另请参阅

status()

PySide2.Qt3DRender.Qt3DRender.QSceneLoader. source ( )
返回类型

QUrl

另请参阅

setSource()

PySide2.Qt3DRender.Qt3DRender.QSceneLoader. sourceChanged ( source )
参数

source QUrl

PySide2.Qt3DRender.Qt3DRender.QSceneLoader. status ( )
返回类型

Status

PySide2.Qt3DRender.Qt3DRender.QSceneLoader. statusChanged ( status )
参数

status Status