From 8bb0b546be0a5aa8bc66829237f3c170110f328c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Thu, 21 Dec 2023 12:54:51 +0100 Subject: [PATCH] [Viewer] Provide a resolved response file path to Camera Response Graph Instead of providing the `LdrToHdrCalibration` node to the Camera Response Graph and retrieving the path of the response file within the widget, retrieve the path and resolve it before activating the Camera Response Graph component. --- meshroom/ui/qml/Viewer/CameraResponseGraph.qml | 5 ++--- meshroom/ui/qml/Viewer/Viewer2D.qml | 11 +++++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/meshroom/ui/qml/Viewer/CameraResponseGraph.qml b/meshroom/ui/qml/Viewer/CameraResponseGraph.qml index 64faa15e..1ee86c78 100644 --- a/meshroom/ui/qml/Viewer/CameraResponseGraph.qml +++ b/meshroom/ui/qml/Viewer/CameraResponseGraph.qml @@ -14,7 +14,7 @@ import DataObjects 1.0 FloatingPane { id: root - property var ldrHdrCalibrationNode: null + property var responsePath: null property color textColor: Colors.sysPalette.text clip: true @@ -22,8 +22,7 @@ FloatingPane { CsvData { id: csvData - property bool hasAttr: (ldrHdrCalibrationNode && ldrHdrCalibrationNode.hasAttribute("response")) - filepath: hasAttr ? ldrHdrCalibrationNode.attribute("response").value : "" + filepath: responsePath } // To avoid interaction with components in background diff --git a/meshroom/ui/qml/Viewer/Viewer2D.qml b/meshroom/ui/qml/Viewer/Viewer2D.qml index 21113bdd..67dc8487 100644 --- a/meshroom/ui/qml/Viewer/Viewer2D.qml +++ b/meshroom/ui/qml/Viewer/Viewer2D.qml @@ -1019,14 +1019,13 @@ FocusScope { property var activeNode: _reconstruction ? _reconstruction.activeNodes.get('LdrToHdrCalibration').node : null property var isEnabled: displayLdrHdrCalibrationGraph.checked && activeNode && activeNode.isComputed - // active: isEnabled - // Setting "active" from true to false creates a crash on linux with Qt 5.14.2. - // As a workaround, we clear the CameraResponseGraph with an empty node - // and hide the loader content. - visible: isEnabled + active: isEnabled + + property var path: activeNode && activeNode.hasAttribute("response") ? activeNode.attribute("response").value : "" + property var vp: _reconstruction ? getViewpoint(_reconstruction.selectedViewId) : null sourceComponent: CameraResponseGraph { - ldrHdrCalibrationNode: isEnabled ? activeNode : null + responsePath: resolve(path, vp) } } }