Skip to content

Commit dddd150

Browse files
committed
[core] Attribute: Parent's exposed property takes precedence over description's
The `exposed` property, which determines whether the attribute is displayed on the upper part of the node in the Graph Editor, is set for each attribute individually in their node's description. If an attribute has a parent (meaning it depends on a `GroupAttribute` or a `ListAttribute`) whose `exposed` property value differs, it does not make sense to display it separately from it. The attribute's `exposed` should align with its parent's.
1 parent 746105e commit dddd150

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

meshroom/core/attribute.py

+7
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,14 @@ def __init__(self, node, attributeDesc, isOutput, root=None, parent=None):
6161
self._description = attributeDesc.description
6262
self._invalidate = False if self._isOutput else attributeDesc.invalidate
6363

64+
self._exposed = attributeDesc.exposed
6465
self._depth = 0
6566
if root is not None:
6667
current = self
6768
while current.root is not None:
6869
self._depth += 1
70+
if current.root.exposed != self._exposed:
71+
self._exposed = current.root.exposed
6972
current = current.root
7073

7174
# invalidation value for output attributes
@@ -87,6 +90,9 @@ def root(self):
8790
def getDepth(self):
8891
return self._depth
8992

93+
def getExposed(self):
94+
return self._exposed
95+
9096
def getName(self):
9197
""" Attribute name """
9298
return self._name
@@ -462,6 +468,7 @@ def getFlattenedChildren(self):
462468
type = Property(str, getType, constant=True)
463469
baseType = Property(str, getType, constant=True)
464470
isReadOnly = Property(bool, _isReadOnly, constant=True)
471+
exposed = Property(bool, getExposed, constant=True)
465472

466473
# Description of the attribute
467474
descriptionChanged = Signal()

meshroom/ui/qml/GraphEditor/Node.qml

+2-2
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ Item {
434434

435435
delegate: Loader {
436436
id: inputLoader
437-
active: !object.isOutput && object.desc.exposed && object.desc.visible
437+
active: !object.isOutput && object.exposed && object.desc.visible
438438
visible: Boolean(object.enabled)
439439
width: inputs.width
440440

@@ -494,7 +494,7 @@ Item {
494494
model: node ? node.attributes : undefined
495495
delegate: Loader {
496496
id: paramLoader
497-
active: !object.isOutput && !object.desc.exposed && object.desc.visible
497+
active: !object.isOutput && !object.exposed && object.desc.visible
498498
visible: Boolean(object.enabled || object.isLink || object.hasOutputConnections)
499499
property bool isFullyActive: Boolean(m.displayParams || object.isLink || object.hasOutputConnections)
500500
width: parent.width

0 commit comments

Comments
 (0)