[core] desc.Node: allow usage of DynamicNodeSize on output attributes

Also consider IntParam value as node size.
This commit is contained in:
Yann Lanthony 2019-12-13 17:41:59 +01:00
parent a0ba44fbff
commit 0b4d2c8927
No known key found for this signature in database
GPG key ID: 519FAE6DF7A70642

View file

@ -318,13 +318,14 @@ class DynamicNodeSize(object):
def computeSize(self, node):
param = node.attribute(self._param)
assert param.isInput
# Link: use linked node's size
if param.isLink:
return param.getLinkParam().node.size
# ListAttribute: use list size
if isinstance(param.desc, ListAttribute):
return len(param)
if isinstance(param.desc, IntParam):
return param.value
return 1