Skip to content

Commit 70546c7

Browse files
committed
[core] Graph: account for specialized GroupAttribute in nodeCopy
GroupAttribute subclasses can override their `value` property to return the value of a child attribute. The `nodeCopy` method needs to evaluate the group's actual value. Therefore, make sure to access the GroupAttribute's internal value and not an overriden one.
1 parent 58c13aa commit 70546c7

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

meshroom/core/graph.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -599,13 +599,19 @@ def copyNode(self, srcNode, withEdges=False):
599599
# edges are declared in input with an expression linking
600600
# to another param (which could be an output)
601601
continue
602+
value = attr.value
603+
if isinstance(attr, GroupAttribute):
604+
# GroupAttribute subclasses can override their `value` property to return the value
605+
# of a child attribute. Here, we need to evaluate the group's value, hence
606+
# the use of GroupAttribute's `value` getter.
607+
value = GroupAttribute.value.fget(attr)
602608
# find top-level links
603-
if Attribute.isLinkExpression(attr.value):
604-
skippedEdges[attr] = attr.value
609+
if Attribute.isLinkExpression(value):
610+
skippedEdges[attr] = value
605611
attr.resetToDefaultValue()
606612
# find links in ListAttribute children
607613
elif isinstance(attr, (ListAttribute, GroupAttribute)):
608-
for child in attr.value:
614+
for child in value:
609615
if Attribute.isLinkExpression(child.value):
610616
skippedEdges[child] = child.value
611617
child.resetToDefaultValue()

0 commit comments

Comments
 (0)