diff --git a/meshroom/core/attribute.py b/meshroom/core/attribute.py index c0651de2..8291580b 100644 --- a/meshroom/core/attribute.py +++ b/meshroom/core/attribute.py @@ -93,6 +93,9 @@ class Attribute(BaseObject): def getType(self): return self.attributeDesc.__class__.__name__ + def _isReadOnly(self): + return not self._isOutput and self.node.isCompatibilityNode + def getBaseType(self): return self.getType() @@ -262,6 +265,7 @@ class Attribute(BaseObject): label = Property(str, getLabel, constant=True) type = Property(str, getType, constant=True) baseType = Property(str, getType, constant=True) + isReadOnly = Property(bool, _isReadOnly, constant=True) desc = Property(desc.Attribute, lambda self: self.attributeDesc, constant=True) valueChanged = Signal() value = Property(Variant, _get_value, _set_value, notify=valueChanged) diff --git a/meshroom/core/node.py b/meshroom/core/node.py index bb67c3fd..42c2bc57 100644 --- a/meshroom/core/node.py +++ b/meshroom/core/node.py @@ -865,6 +865,9 @@ class BaseNode(BaseObject): fusedStatus.merge(node.fusedStatus) return fusedStatus + def _isCompatibilityNode(self): + return False + @property def globalExecMode(self): return self._chunks.at(0).execModeName @@ -1031,6 +1034,7 @@ class BaseNode(BaseObject): fusedStatus = Property(StatusData, getFusedStatus, notify=globalStatusChanged) elapsedTime = Property(float, lambda self: self.getFusedStatus().elapsedTime, notify=globalStatusChanged) recursiveElapsedTime = Property(float, lambda self: self.getRecursiveFusedStatus().elapsedTime, notify=globalStatusChanged) + isCompatibilityNode = Property(bool, lambda self: self._isCompatibilityNode(), constant=True) # need lambda to evaluate the virtual function globalExecModeChanged = Signal() globalExecMode = Property(str, globalExecMode.fget, notify=globalExecModeChanged) @@ -1167,6 +1171,9 @@ class CompatibilityNode(BaseNode): for i in range(self.splitCount) ]) + def _isCompatibilityNode(self): + return True + @staticmethod def attributeDescFromValue(attrName, value, isOutput): """ diff --git a/meshroom/ui/qml/GraphEditor/GraphEditor.qml b/meshroom/ui/qml/GraphEditor/GraphEditor.qml index 9b6c2e11..897d5802 100755 --- a/meshroom/ui/qml/GraphEditor/GraphEditor.qml +++ b/meshroom/ui/qml/GraphEditor/GraphEditor.qml @@ -222,7 +222,7 @@ Item { id: edgeMenu property var currentEdge: null MenuItem { - enabled: edgeMenu.currentEdge && !edgeMenu.currentEdge.dst.node.locked + enabled: edgeMenu.currentEdge && !edgeMenu.currentEdge.dst.node.locked && !edgeMenu.currentEdge.dst.isReadOnly text: "Remove" onTriggered: uigraph.removeEdge(edgeMenu.currentEdge) } diff --git a/meshroom/ui/qml/GraphEditor/Node.qml b/meshroom/ui/qml/GraphEditor/Node.qml index 2825dbbc..84c0bd49 100755 --- a/meshroom/ui/qml/GraphEditor/Node.qml +++ b/meshroom/ui/qml/GraphEditor/Node.qml @@ -270,8 +270,6 @@ Item { height: childrenRect.height anchors.horizontalCenter: parent.horizontalCenter - enabled: !root.isCompatibilityNode - Column { id: attributesColumn width: parent.width @@ -311,6 +309,7 @@ Item { id: inputs width: parent.width spacing: 3 + Repeater { model: node ? node.attributes : undefined delegate: Loader { @@ -326,7 +325,7 @@ Item { property real globalX: root.x + nodeAttributes.x + inputs.x + inputLoader.x + inPin.x property real globalY: root.y + nodeAttributes.y + inputs.y + inputLoader.y + inPin.y - readOnly: root.readOnly + readOnly: root.readOnly || root.isCompatibilityNode Component.onCompleted: attributePinCreated(attribute, inPin) Component.onDestruction: attributePinDeleted(attribute, inPin) onPressed: root.pressed(mouse)