From 5a4384916ee257df9f39ba9ceae132fa8ef6afcf Mon Sep 17 00:00:00 2001 From: Yann Lanthony Date: Fri, 13 Dec 2019 12:16:18 +0100 Subject: [PATCH] [ui][3D] expose status on EnvironmentMapEntity get loading status when env map is loading in 3D view --- meshroom/ui/qml/Viewer3D/EnvironmentMapEntity.qml | 3 +++ meshroom/ui/qml/Viewer3D/MediaLoader.qml | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/meshroom/ui/qml/Viewer3D/EnvironmentMapEntity.qml b/meshroom/ui/qml/Viewer3D/EnvironmentMapEntity.qml index 0bd8877b..5d3402a3 100644 --- a/meshroom/ui/qml/Viewer3D/EnvironmentMapEntity.qml +++ b/meshroom/ui/qml/Viewer3D/EnvironmentMapEntity.qml @@ -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 diff --git a/meshroom/ui/qml/Viewer3D/MediaLoader.qml b/meshroom/ui/qml/Viewer3D/MediaLoader.qml index 831cd619..fd48f6c8 100644 --- a/meshroom/ui/qml/Viewer3D/MediaLoader.qml +++ b/meshroom/ui/qml/Viewer3D/MediaLoader.qml @@ -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; + }); } } }