diff --git a/meshroom/core/node.py b/meshroom/core/node.py index 7e5999f606..aedb6e17ba 100644 --- a/meshroom/core/node.py +++ b/meshroom/core/node.py @@ -1166,6 +1166,8 @@ def canBeCanceled(self): hasDuplicatesChanged = Signal() hasDuplicates = Property(bool, lambda self: self._hasDuplicates, notify=hasDuplicatesChanged) + outputAttrEnabledChanged = Signal() + class Node(BaseNode): """ @@ -1192,6 +1194,8 @@ def __init__(self, nodeType, position=None, parent=None, **kwargs): # List attributes per uid for attr in self._attributes: + if attr.isOutput and attr.desc.semantic == "image": + attr.enabledChanged.connect(self.outputAttrEnabledChanged) for uidIndex in attr.attributeDesc.uid: self.attributesPerUid[uidIndex].add(attr) diff --git a/meshroom/nodes/aliceVision/DepthMap.py b/meshroom/nodes/aliceVision/DepthMap.py index 023da0970c..7161fbcd78 100644 --- a/meshroom/nodes/aliceVision/DepthMap.py +++ b/meshroom/nodes/aliceVision/DepthMap.py @@ -391,7 +391,7 @@ class DepthMap(desc.AVCommandLineNode): label='Export Depth Maps', description='Export intermediate depth/similarity maps from the SGM and Refine steps.', value=False, - uid=[], + uid=[0], advanced=True, ), desc.BoolParam( @@ -399,7 +399,7 @@ class DepthMap(desc.AVCommandLineNode): label='Export Volumes', description='Export intermediate full similarity volumes from the SGM and Refine steps.', value=False, - uid=[], + uid=[0], advanced=True, ), desc.BoolParam( @@ -407,7 +407,7 @@ class DepthMap(desc.AVCommandLineNode): label='Export Cross Volumes', description='Export intermediate similarity cross volumes from the SGM and Refine steps.', value=False, - uid=[], + uid=[0], advanced=True, ), desc.BoolParam( @@ -415,7 +415,7 @@ class DepthMap(desc.AVCommandLineNode): label='Export 9 Points', description='Export intermediate volumes 9 points from the SGM and Refine steps in CSV files.', value=False, - uid=[], + uid=[0], advanced=True, ), desc.BoolParam( @@ -423,7 +423,7 @@ class DepthMap(desc.AVCommandLineNode): label='Export Tile Pattern', description='Export the bounding boxes of tiles volumes as meshes. This allows to visualize the depth map search areas.', value=False, - uid=[], + uid=[0], advanced=True, ), ]), @@ -483,7 +483,7 @@ class DepthMap(desc.AVCommandLineNode): value=desc.Node.internalFolder + '_tilePattern.obj', uid=[], group='', # do not export on the command line - # enabled=lambda node: node.intermediateResults.exportTilePattern.value, + enabled=lambda node: node.intermediateResults.exportTilePattern.value, ), desc.File( name='depthSgm', @@ -493,7 +493,7 @@ class DepthMap(desc.AVCommandLineNode): value=desc.Node.internalFolder + '_depthMap_scale2_sgm.exr', uid=[], group='', # do not export on the command line - # enabled=lambda node: node.intermediateResults.exportIntermediateDepthSimMaps.value, + enabled=lambda node: node.intermediateResults.exportIntermediateDepthSimMaps.value, ), desc.File( name='depthSgmUpscaled', @@ -503,7 +503,7 @@ class DepthMap(desc.AVCommandLineNode): value=desc.Node.internalFolder + '_depthMap_sgmUpscaled.exr', uid=[], group='', # do not export on the command line - # enabled=lambda node: node.intermediateResults.exportIntermediateDepthSimMaps.value, + enabled=lambda node: node.intermediateResults.exportIntermediateDepthSimMaps.value, ), desc.File( name='depthRefined', @@ -513,6 +513,6 @@ class DepthMap(desc.AVCommandLineNode): value=desc.Node.internalFolder + '_depthMap_refinedFused.exr', uid=[], group='', # do not export on the command line - # enabled=lambda node: node.intermediateResults.exportIntermediateDepthSimMaps.value, + enabled=lambda node: node.intermediateResults.exportIntermediateDepthSimMaps.value, ), ] diff --git a/meshroom/ui/qml/Viewer/Viewer2D.qml b/meshroom/ui/qml/Viewer/Viewer2D.qml index 7c437ba43a..9b12d83afc 100644 --- a/meshroom/ui/qml/Viewer/Viewer2D.qml +++ b/meshroom/ui/qml/Viewer/Viewer2D.qml @@ -184,7 +184,7 @@ FocusScope { var hasImageOutputAttr = false; for (var i = 0; i < node.attributes.count; i++) { var attr = node.attributes.at(i); - if (attr.isOutput && attr.desc.semantic == "image") { + if (attr.isOutput && attr.desc.semantic === "image" && attr.enabled) { hasImageOutputAttr = true; break; } @@ -280,7 +280,7 @@ FocusScope { // store attr name for output attributes that represent images for (var i = 0; i < displayedNode.attributes.count; i++) { var attr = displayedNode.attributes.at(i); - if (attr.isOutput && attr.desc.semantic == "image") { + if (attr.isOutput && attr.desc.semantic === "image" && attr.enabled) { names.push(attr.name); } } @@ -300,6 +300,10 @@ FocusScope { } } + Connections { + target: displayedNode + onOutputAttrEnabledChanged: tryLoadNode(displayedNode) + } // context menu property Component contextMenu: Menu { MenuItem { @@ -1193,7 +1197,7 @@ FocusScope { property var names: ["gallery"] property string name: names[currentIndex] - model: names.map(n => (n == "gallery") ? "Image Gallery" : displayedNode.attributes.get(n).label) + model: names.map(n => (n === "gallery") ? "Image Gallery" : displayedNode.attributes.get(n).label) enabled: count > 1 FontMetrics {