Skip to content

Commit 026feed

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 d0e0a4b commit 026feed

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

meshroom/core/attribute.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,14 @@ def __init__(self, node, attributeDesc, isOutput, root=None, parent=None):
6464
self._description = attributeDesc.description
6565
self._invalidate = False if self._isOutput else attributeDesc.invalidate
6666

67+
self._exposed = attributeDesc.exposed
6768
self._depth = 0
6869
if root is not None:
6970
current = self
7071
while current.root is not None:
7172
self._depth += 1
73+
if current.root.exposed != self._exposed:
74+
self._exposed = current.root.exposed
7275
current = current.root
7376

7477
# invalidation value for output attributes
@@ -89,6 +92,9 @@ def root(self):
8992
def getDepth(self):
9093
return self._depth
9194

95+
def getExposed(self):
96+
return self._exposed
97+
9298
def getName(self):
9399
""" Attribute name """
94100
return self._name
@@ -446,6 +452,7 @@ def getFlattenedChildren(self):
446452
type = Property(str, getType, constant=True)
447453
baseType = Property(str, getType, constant=True)
448454
isReadOnly = Property(bool, _isReadOnly, constant=True)
455+
exposed = Property(bool, getExposed, constant=True)
449456

450457
# Description of the attribute
451458
descriptionChanged = Signal()

meshroom/ui/qml/GraphEditor/Node.qml

Lines changed: 2 additions & 2 deletions
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.isLinkNested || object.hasOutputConnections)
499499
property bool isFullyActive: Boolean(m.displayParams || object.isLinkNested || object.hasOutputConnections)
500500
width: parent.width

0 commit comments

Comments
 (0)