[ui][3D] expose status on EnvironmentMapEntity

get loading status when env map is loading in 3D view
This commit is contained in:
Yann Lanthony 2019-12-13 12:16:18 +01:00
parent 63ffb20819
commit 5a4384916e
No known key found for this signature in database
GPG key ID: 519FAE6DF7A70642
2 changed files with 8 additions and 2 deletions

View file

@ -22,6 +22,8 @@ Entity {
property alias rings: sphereMesh.rings
/// Position of the sphere
property alias position: transform.translation
/// Texture loading status
property alias status: textureLoader.status
components: [
SphereMesh {
@ -39,6 +41,7 @@ Entity {
shininess: 0
specular: "#000"
diffuse: TextureLoader {
id: textureLoader
magnificationFilter: Texture.Linear
mirrored: true
source: root.source

View file

@ -125,13 +125,16 @@ import Utils 1.0
}
// - [2] as an environment map
obj.destroy()
obj.destroy();
root.status = SceneLoader.Loading;
obj = Qt.createComponent("EnvironmentMapEntity.qml").createObject(
exrLoaderEntity, {
'source': source,
'position': Qt.binding(function() { return root.camera.position })
});
root.status = SceneLoader.Ready;
obj.statusChanged.connect(function() {
root.status = obj.status;
});
}
}
}