diff --git a/meshroom/ui/qml/Viewer/PanoramaViewer.qml b/meshroom/ui/qml/Viewer/PanoramaViewer.qml index a781331c..77c7de66 100644 --- a/meshroom/ui/qml/Viewer/PanoramaViewer.qml +++ b/meshroom/ui/qml/Viewer/PanoramaViewer.qml @@ -18,7 +18,21 @@ AliceVision.PanoramaViewer { // paintedWidth / paintedHeight / status for compatibility with standard Image property int paintedWidth: textureSize.width property int paintedHeight: textureSize.height - property var status: Image.Null + property var status: { + if (readyToLoad === Image.Ready && root.imagesLoaded === root.pathList.length) { + for (var i = 0; i < repeater.model; i++) { + if (repeater.itemAt(i).item.status !== Image.Ready) return Image.Loading; + } + return Image.Ready; + } + else if (readyToLoad === Image.Ready) { + return Image.Loading; + } + else { + return Image.Null; + } + } + property var readyToLoad: Image.Null // Value from ui button property int downscaleValueQML: 0 @@ -195,6 +209,7 @@ AliceVision.PanoramaViewer { property var pathList : [] property var idList : [] + property int imagesLoaded: 0 Item { id: panoImages @@ -205,7 +220,7 @@ AliceVision.PanoramaViewer { id: imgPano Loader { id: floatOneLoader - active: root.status + active: root.readyToLoad visible: (floatOneLoader.status === Loader.Ready) z:0 //anchors.centerIn: parent @@ -226,6 +241,9 @@ AliceVision.PanoramaViewer { setSource("", {}) } } + onLoaded: { + imagesLoaded++; + } } } Repeater { @@ -237,6 +255,7 @@ AliceVision.PanoramaViewer { Connections { target: root onImagesDataChanged: { + root.imagesLoaded = 0; //We receive the map from C++ //Resetting arrays to avoid problem with push @@ -255,7 +274,7 @@ AliceVision.PanoramaViewer { //Changing the repeater model (number of elements) panoImages.updateRepeater() - root.status = Image.Ready; + root.readyToLoad = Image.Ready; } } diff --git a/meshroom/ui/qml/Viewer/Viewer2D.qml b/meshroom/ui/qml/Viewer/Viewer2D.qml index 71b6c43c..70132fe2 100644 --- a/meshroom/ui/qml/Viewer/Viewer2D.qml +++ b/meshroom/ui/qml/Viewer/Viewer2D.qml @@ -990,7 +990,12 @@ FocusScope { anchors.centerIn: parent // running property binding seems broken, only dynamic binding assignment works Component.onCompleted: { - running = Qt.binding(function() { return imgContainer.image && imgContainer.image.status === Image.Loading }) + if (root.usePanoramaViewer) { + running = Qt.binding(function() { return imgContainer.panoramaViewerLoader.status === Image.Loading }) + } else { + running = Qt.binding(function() { return imgContainer.image && imgContainer.image.status === Image.Loading }) + } + } // disable the visibility when unused to avoid stealing the mouseEvent to the image color picker visible: running