Skip to content

Commit be43c5c

Browse files
committed
[ui] Compatibility nodes cannot be computed or recomputed
When the compatibility node was fully computed, the recompute/resubmit button was available in the UI menu. The reason is that we need to propagate that the connected nodes can be computed if there is a compatibility node in the dependency iff it is already fully computed. Now there is an additional explicit check.
1 parent 8be8ea5 commit be43c5c

1 file changed

Lines changed: 20 additions & 6 deletions

File tree

meshroom/ui/qml/GraphEditor/GraphEditor.qml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -570,19 +570,31 @@ Item {
570570

571571
readonly property bool isSelectionFullyComputed: {
572572
return uigraph.nodeSelection.selectedIndexes.every(function(idx) {
573-
return uigraph.graph.nodes.at(idx.row).isComputed;
573+
const node = uigraph.graph.nodes.at(idx.row);
574+
return node.isComputed;
575+
});
576+
}
577+
578+
// Selection contains only compatibility nodes
579+
readonly property bool isSelectionFullyCompatibility: {
580+
return uigraph.nodeSelection.selectedIndexes.every(function(idx) {
581+
const node = uigraph.graph.nodes.at(idx.row);
582+
return node.isCompatibilityNode;
574583
});
575584
}
576585

577-
readonly property bool selectionContainsComputableNodes: {
586+
// Selection contains at least one computable node type
587+
readonly property bool selectionContainsComputableNodeType: {
578588
return uigraph.nodeSelection.selectedIndexes.some(function(idx) {
579589
const node = uigraph.graph.nodes.at(idx.row);
580590
return node.isComputableType;
581591
});
582592
}
583593

584594
readonly property bool canSelectionBeComputed: {
585-
if(!selectionContainsComputableNodes)
595+
if(!selectionContainsComputableNodeType)
596+
return false;
597+
if(isSelectionFullyCompatibility)
586598
return false;
587599
if(isSelectionFullyComputed)
588600
return true;
@@ -598,10 +610,12 @@ Item {
598610
return b
599611
}
600612

601-
readonly property bool isSelectionSubmitable: uigraph.canSubmit && selectionContainsComputableNodes
613+
readonly property bool isSelectionSubmitable: uigraph.canSubmit && selectionContainsComputableNodeType
602614

603615
readonly property bool canSelectionBeSubmitted: {
604-
if(!selectionContainsComputableNodes)
616+
if(!selectionContainsComputableNodeType)
617+
return false;
618+
if(isSelectionFullyCompatibility)
605619
return false;
606620
if(isSelectionFullyComputed)
607621
return true;
@@ -624,7 +638,7 @@ Item {
624638
MenuItem {
625639
id: computeMenuItem
626640
text: nodeMenu.isSelectionFullyComputed ? "Re-Compute" : "Compute"
627-
visible: nodeMenu.selectionContainsComputableNodes
641+
visible: nodeMenu.selectionContainsComputableNodeType
628642
height: visible ? implicitHeight : 0
629643
enabled: nodeMenu.canSelectionBeComputed
630644

0 commit comments

Comments
 (0)