QSceneLoader#

Provides the facility to load an existing Scene. More

Inheritance diagram of PySide6.Qt3DRender.Qt3DRender.QSceneLoader

Synopsis#

Properties#

Functions#

Slots#

Signals#

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description#

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

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.

Note

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

See also

QMesh QGeometryRenderer

class PySide6.Qt3DRender.Qt3DRender.QSceneLoader([parent=None])#
Parameters:

parentPySide6.Qt3DCore.Qt3DCore.QNode

The constructor creates an instance with the specified parent.

Note

Properties can be used directly when from __feature__ import true_property is used or via accessor functions otherwise.

property PᅟySide6.Qt3DRender.Qt3DRender.QSceneLoader.source: PySide6.QtCore.QUrl#

Holds the url to the source to be loaded.

Access functions:
property PᅟySide6.Qt3DRender.Qt3DRender.QSceneLoader.status: Status#

Holds the status of scene loading.

See also

Status

Access functions:
PySide6.Qt3DRender.Qt3DRender.QSceneLoader.Status#

This enum identifies the state of loading

Constant

Description

Qt3DRender.QSceneLoader.None

The QSceneLoader hasn’t been used yet.

Qt3DRender.QSceneLoader.Loading

The QSceneLoader is currently loading the scene file.

Qt3DRender.QSceneLoader.Ready

The QSceneLoader successfully loaded the scene file.

Qt3DRender.QSceneLoader.Error

The QSceneLoader encountered an error while loading the scene file.

PySide6.Qt3DRender.Qt3DRender.QSceneLoader.ComponentType#

This enum specifies a component type.

Constant

Description

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

PySide6.Qt3DRender.Qt3DRender.QSceneLoader.component(entityName, componentType)#
Parameters:
Return type:

PySide6.Qt3DCore.Qt3DCore.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.

PySide6.Qt3DRender.Qt3DRender.QSceneLoader.entity(entityName)#
Parameters:

entityName – str

Return type:

PySide6.Qt3DCore.Qt3DCore.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.

PySide6.Qt3DRender.Qt3DRender.QSceneLoader.entityNames()#
Return type:

list of strings

Returns a list of the objectNames of the loaded entities.

PySide6.Qt3DRender.Qt3DRender.QSceneLoader.setSource(arg)#
Parameters:

argPySide6.QtCore.QUrl

See also

source()

Setter of property source .

PySide6.Qt3DRender.Qt3DRender.QSceneLoader.source()#
Return type:

PySide6.QtCore.QUrl

See also

setSource()

Getter of property source .

PySide6.Qt3DRender.Qt3DRender.QSceneLoader.sourceChanged(source)#
Parameters:

sourcePySide6.QtCore.QUrl

Notification signal of property source .

PySide6.Qt3DRender.Qt3DRender.QSceneLoader.status()#
Return type:

Status

Getter of property status .

PySide6.Qt3DRender.Qt3DRender.QSceneLoader.statusChanged(status)#
Parameters:

statusStatus

Notification signal of property status .