Skip to content

Commit d0e0a4b

Browse files
committed
[core] Correctly match descriptions for connected attributes within groups
1 parent ec7d408 commit d0e0a4b

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
@@ -340,7 +340,7 @@ def _applyExpr(self):
340340
elif self.isInput and Attribute.isLinkExpression(v):
341341
# value is a link to another attribute
342342
link = v[1:-1]
343-
linkNode, linkAttr = link.split('.')
343+
linkNode, linkAttr = link.split('.', 1)
344344
try:
345345
g.addEdge(g.node(linkNode).attribute(linkAttr), self)
346346
except KeyError as err:

meshroom/core/node.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1711,9 +1711,18 @@ def attributeDescFromName(refAttributes, name, value, strict=True):
17111711
attrDesc = next((d for d in refAttributes if d.name == name), None)
17121712
if attrDesc is None:
17131713
return None
1714+
17141715
# We have found a description, and we still need to
17151716
# check if the value matches the attribute description.
1716-
#
1717+
1718+
# If it is a GroupAttribute, all attributes within the group should be matched individually
1719+
# so that links that can be correctly evaluated
1720+
if isinstance(attrDesc, desc.GroupAttribute):
1721+
for k, v in value.items():
1722+
if CompatibilityNode.attributeDescFromName(attrDesc.groupDesc, k, v, strict=True) is None:
1723+
return None
1724+
return attrDesc
1725+
17171726
# If it is a serialized link expression (no proper value to set/evaluate)
17181727
if Attribute.isLinkExpression(value):
17191728
return attrDesc

0 commit comments

Comments
 (0)