Skip to content

Commit 746105e

Browse files
committed
[core] Correctly match descriptions for connected attributes within groups
1 parent d1d6170 commit 746105e

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

meshroom/core/attribute.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ def _applyExpr(self):
356356
elif self.isInput and Attribute.isLinkExpression(v):
357357
# value is a link to another attribute
358358
link = v[1:-1]
359-
linkNode, linkAttr = link.split('.')
359+
linkNode, linkAttr = link.split('.', 1)
360360
try:
361361
g.addEdge(g.node(linkNode).attribute(linkAttr), self)
362362
except KeyError as err:

meshroom/core/node.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1678,9 +1678,18 @@ def attributeDescFromName(refAttributes, name, value, strict=True):
16781678
attrDesc = next((d for d in refAttributes if d.name == name), None)
16791679
if attrDesc is None:
16801680
return None
1681+
16811682
# We have found a description, and we still need to
16821683
# check if the value matches the attribute description.
1683-
#
1684+
1685+
# If it is a GroupAttribute, all attributes within the group should be matched individually
1686+
# so that links that can be correctly evaluated
1687+
if isinstance(attrDesc, desc.GroupAttribute):
1688+
for k, v in value.items():
1689+
if CompatibilityNode.attributeDescFromName(attrDesc.groupDesc, k, v, strict=True) is None:
1690+
return None
1691+
return attrDesc
1692+
16841693
# If it is a serialized link expression (no proper value to set/evaluate)
16851694
if Attribute.isLinkExpression(value):
16861695
return attrDesc

0 commit comments

Comments
 (0)