[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.
This commit is contained in:
Candice Bentéjac 2023-12-21 12:54:51 +01:00
parent 3412a77b4d
commit 8bb0b546be
2 changed files with 7 additions and 9 deletions

View file

@ -14,7 +14,7 @@ import DataObjects 1.0
FloatingPane { FloatingPane {
id: root id: root
property var ldrHdrCalibrationNode: null property var responsePath: null
property color textColor: Colors.sysPalette.text property color textColor: Colors.sysPalette.text
clip: true clip: true
@ -22,8 +22,7 @@ FloatingPane {
CsvData { CsvData {
id: csvData id: csvData
property bool hasAttr: (ldrHdrCalibrationNode && ldrHdrCalibrationNode.hasAttribute("response")) filepath: responsePath
filepath: hasAttr ? ldrHdrCalibrationNode.attribute("response").value : ""
} }
// To avoid interaction with components in background // To avoid interaction with components in background

View file

@ -1019,14 +1019,13 @@ FocusScope {
property var activeNode: _reconstruction ? _reconstruction.activeNodes.get('LdrToHdrCalibration').node : null property var activeNode: _reconstruction ? _reconstruction.activeNodes.get('LdrToHdrCalibration').node : null
property var isEnabled: displayLdrHdrCalibrationGraph.checked && activeNode && activeNode.isComputed property var isEnabled: displayLdrHdrCalibrationGraph.checked && activeNode && activeNode.isComputed
// active: isEnabled 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 property var path: activeNode && activeNode.hasAttribute("response") ? activeNode.attribute("response").value : ""
// and hide the loader content. property var vp: _reconstruction ? getViewpoint(_reconstruction.selectedViewId) : null
visible: isEnabled
sourceComponent: CameraResponseGraph { sourceComponent: CameraResponseGraph {
ldrHdrCalibrationNode: isEnabled ? activeNode : null responsePath: resolve(path, vp)
} }
} }
} }