[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 {
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

View file

@ -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)
}
}
}