[multi] Pass the right sfm node according to the type of viewer

This commit is contained in:
Nils Landrodie 2021-08-27 20:30:57 +02:00 committed by Fabien Castan
parent 38cd58f03f
commit 0cb8171ceb

View file

@ -593,7 +593,9 @@ FocusScope {
if(! root.aliceVisionPluginAvailable){ if(! root.aliceVisionPluginAvailable){
return null return null
} }
var sfmNode = _reconstruction.activeNodes.get('sfm').node // For lens distortion viewer: use all nodes creating a sfmData file
var nodeType = displayLensDistortionViewer.checked ? 'sfmData' : 'sfm'
var sfmNode = _reconstruction.activeNodes.get(nodeType).node
if(sfmNode === null){ if(sfmNode === null){
return null return null
} }
@ -842,17 +844,21 @@ FocusScope {
if(!activeNode) if(!activeNode)
return false; return false;
if(activeNode.isComputed) if(activeNode.isComputed)
{
console.warn("displayLensDistortionViewer.isComputed: 1")
return true; return true;
}
var inputAttr = activeNode.attribute("input"); var inputAttr = activeNode.attribute("input");
if(!inputAttr) if(!inputAttr)
return false; return false;
var inputAttrLink = inputAttr.rootLinkParam; var inputAttrLink = inputAttr.rootLinkParam;
if(!inputAttrLink) if(!inputAttrLink)
return false; return false;
console.warn("displayLensDistortionViewer.isComputed (link attr): " + inputAttrLink.node.isComputed)
return inputAttrLink.node.isComputed; return inputAttrLink.node.isComputed;
} }
ToolTip.text: "Lens Distortion Viewer" ToolTip.text: "Lens Distortion Viewer" + (isComputed ? (": " + activeNode.label) : "")
text: MaterialIcons.panorama_horizontal text: MaterialIcons.panorama_horizontal
font.pointSize: 16 font.pointSize: 16
padding: 0 padding: 0