QSceneLoader¶
Provides the facility to load an existing Scene. More…

Synopsis¶
Functions¶
def
component(entityName, componentType)def
entity(entityName)def
entityNames()def
source()def
status()
Slots¶
Signals¶
def
sourceChanged(source)def
statusChanged(status)
Detailed Description¶
Given a 3D source file, the
QSceneLoaderwill try to parse it and build a tree ofQEntityobjects with properQGeometryRenderer,QTransformandQMaterialcomponents.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,
QSceneLoaderloads a complete scene subtree. If you wish to load a single piece of geometry, you should rather use theQMeshinstead.
QSceneLoaderinternally 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
QEntityinstances. Undefined behavior will result.See also
QMeshQGeometryRenderer
- class PySide2.Qt3DRender.Qt3DRender.QSceneLoader([parent=None])¶
- param parent:
The constructor creates an instance with the specified
parent.
- PySide2.Qt3DRender.Qt3DRender.QSceneLoader.Status¶
This enum identifies the state of loading
Constant
Description
Qt3DRender.QSceneLoader.None
The
QSceneLoaderhasn’t been used yet.Qt3DRender.QSceneLoader.Loading
The
QSceneLoaderis currently loading the scene file.Qt3DRender.QSceneLoader.Ready
The
QSceneLoadersuccessfully loaded the scene file.Qt3DRender.QSceneLoader.Error
The
QSceneLoaderencountered an error while loading the scene file.
- PySide2.Qt3DRender.Qt3DRender.QSceneLoader.ComponentType¶
This enum specifies a component type.
Constant
Description
Qt3DRender.QSceneLoader.UnknownComponent
Unknown component type
Qt3DRender.QSceneLoader.GeometryRendererComponent
QGeometryRenderercomponentQt3DRender.QSceneLoader.TransformComponent
QTransformcomponentQt3DRender.QSceneLoader.MaterialComponent
QMaterialcomponentQt3DRender.QSceneLoader.LightComponent
QAbstractLightcomponentQt3DRender.QSceneLoader.CameraLensComponent
QCameraLenscomponent
- PySide2.Qt3DRender.Qt3DRender.QSceneLoader.component(entityName, componentType)¶
- Parameters:
entityName – str
componentType –
ComponentType
- Return type:
Returns a component matching
componentTypeof a loaded entity with anobjectNamematching theentityName. 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)¶
- Parameters:
entityName – str
- Return type:
Returns a loaded entity with an
objectNamematching theentityNameparameter. 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()¶
- Return type:
list of strings
Returns a list of the
objectNamesof the loaded entities.
- PySide2.Qt3DRender.Qt3DRender.QSceneLoader.setSource(arg)¶
- Parameters:
arg –
PySide2.QtCore.QUrl
Holds the url to the source to be loaded.
- PySide2.Qt3DRender.Qt3DRender.QSceneLoader.setStatus(status)¶
- Parameters:
status –
Status
Note
This function is deprecated.
See also
- PySide2.Qt3DRender.Qt3DRender.QSceneLoader.source()¶
- Return type:
Holds the url to the source to be loaded.
- PySide2.Qt3DRender.Qt3DRender.QSceneLoader.sourceChanged(source)¶
- Parameters:
source –
PySide2.QtCore.QUrl
- PySide2.Qt3DRender.Qt3DRender.QSceneLoader.status()¶
- Return type:
Holds the status of scene loading.
SceneLoader .None
SceneLoader .Loading
SceneLoader .Ready
SceneLoader .Error
See also
Status
© 2022 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.