From cd3d3cc1f3ff0181f9498f491efdce07ef867e90 Mon Sep 17 00:00:00 2001 From: Thomas Zorroche Date: Tue, 13 Jul 2021 15:11:40 +0200 Subject: [PATCH] [Panorama Viewer] fix msfmData status bug --- meshroom/ui/qml/Viewer/FloatImage.qml | 6 +++++- meshroom/ui/qml/Viewer/Viewer2D.qml | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/meshroom/ui/qml/Viewer/FloatImage.qml b/meshroom/ui/qml/Viewer/FloatImage.qml index 0e6d1508..e3b22b07 100644 --- a/meshroom/ui/qml/Viewer/FloatImage.qml +++ b/meshroom/ui/qml/Viewer/FloatImage.qml @@ -17,7 +17,11 @@ AliceVision.FloatImageViewer { property var sfmData - surface.msfmData : sfmData + onSfmDataChanged: { + console.warn("FLOAT IMG " + sfmData) + root.surface.msfmData = sfmData; + } + // paintedWidth / paintedHeight / status for compatibility with standard Image property int paintedWidth: textureSize.width diff --git a/meshroom/ui/qml/Viewer/Viewer2D.qml b/meshroom/ui/qml/Viewer/Viewer2D.qml index 5e9a8b55..a13b2cd7 100644 --- a/meshroom/ui/qml/Viewer/Viewer2D.qml +++ b/meshroom/ui/qml/Viewer/Viewer2D.qml @@ -284,6 +284,7 @@ FocusScope { 'surface.subdivisions' : Qt.binding(function(){ return root.useFloatImageViewer ? 1 : lensDistortionImageToolbar.subdivisionsValue;}), 'viewerTypeString': Qt.binding(function(){ return displayLensDistortionViewer.checked ? "distortion" : "hdr";}), 'sfmRequired': Qt.binding(function(){ return displayLensDistortionViewer.checked ? true : false;}), + 'sfmData': Qt.binding(function() { return (msfmDataLoader.status === Loader.Ready && msfmDataLoader.item.status === 2) ? msfmDataLoader.item : null; }), 'canBeHovered': false }) } else { @@ -310,7 +311,7 @@ FocusScope { 'isHighlightable': Qt.binding(function(){ return panoramaViewerToolbar.enableHover;}), 'displayGridPano': Qt.binding(function(){ return panoramaViewerToolbar.displayGrid;}), 'mouseMultiplier': Qt.binding(function(){ return panoramaViewerToolbar.mouseSpeed;}), - 'sfmData': Qt.binding(function() { return msfmDataLoader.status === Loader.Ready ? msfmDataLoader.item : null; }), + 'sfmData': Qt.binding(function() { return (msfmDataLoader.status === Loader.Ready && msfmDataLoader.item.status === 2) ? msfmDataLoader.item : null; }), }) } else { // Force the unload (instead of using Component.onCompleted to load it once and for all) is necessary since Qt 5.14 @@ -587,6 +588,7 @@ FocusScope { id: msfmDataLoader property bool isUsed: displayFeatures.checked || displaySfmStatsView.checked || displaySfmDataGlobalStats.checked + || displayPanoramaViewer.checked || displayLensDistortionViewer.checked property var activeNode: root.aliceVisionPluginAvailable ? _reconstruction.activeNodes.get('sfm').node : null property bool isComputed: activeNode && activeNode.isComputed property string filepath: Filepath.stringToUrl(isComputed ? activeNode.attribute("output").value : "")