mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-04-28 17:57:16 +02:00
[processGraph] change parameters evaluation order
This allows to use input parameters in the expression of the output params
This commit is contained in:
parent
48941a5782
commit
2c62c75e2e
1 changed files with 12 additions and 8 deletions
|
@ -263,17 +263,14 @@ class Node(BaseObject):
|
|||
assAttr.sort()
|
||||
self._cmdVars['uid{}'.format(uidIndex)] = hash(tuple([b for a, b in assAttr]))
|
||||
|
||||
for attr in self._attributes:
|
||||
if attr.attributeDesc.isOutput:
|
||||
attr._value = attr.attributeDesc.value.format(
|
||||
nodeType=self.nodeType(),
|
||||
**self._cmdVars) # self._cmdVars only contains uids at this step
|
||||
|
||||
# Evaluate input params
|
||||
for name, attr in self._attributes.objects.items():
|
||||
if attr.attributeDesc.isOutput:
|
||||
continue # skip outputs
|
||||
linkAttr = attr.getLinkParam()
|
||||
v = attr._value
|
||||
if linkAttr:
|
||||
v = linkAttr._value
|
||||
attr._value = linkAttr._value
|
||||
v = attr._value
|
||||
|
||||
self._cmdVars[name] = '--{name} {value}'.format(name=name, value=v)
|
||||
self._cmdVars[name + 'Value'] = str(v)
|
||||
|
@ -282,6 +279,13 @@ class Node(BaseObject):
|
|||
self._cmdVars[attr.attributeDesc.group] = self._cmdVars.get(attr.attributeDesc.group, '') + \
|
||||
' ' + self._cmdVars[name]
|
||||
|
||||
# Evaluate output params
|
||||
for name, attr in self._attributes.objects.items():
|
||||
if attr.attributeDesc.isOutput:
|
||||
attr._value = attr.attributeDesc.value.format(
|
||||
nodeType=self.nodeType(),
|
||||
**self._cmdVars)
|
||||
|
||||
def internalFolder(self):
|
||||
return self.nodeDesc.internalFolder.format(nodeType=self.nodeType(), **self._cmdVars)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue