[core] correct the actions order when loading the project file

We now call applyExpr before updateInternals is called (triggered by setupProjectFile and/or end of GraphModification).
So the input parameters expressions/connections are up-to-date (after applyExpr) when updateInternals will evaluate the input/output parameters.
This commit is contained in:
Fabien Castan 2020-06-29 12:53:11 +02:00
parent 202c1db5ff
commit 082f9b5843
2 changed files with 16 additions and 10 deletions

View file

@ -584,8 +584,13 @@ class BaseNode(BaseObject):
continue
defaultValue = attr.defaultValue()
attr.value = defaultValue.format(**self._cmdVars)
attr._invalidationValue = defaultValue.format(**cmdVarsNoCache)
try:
attr.value = defaultValue.format(**self._cmdVars)
attr._invalidationValue = defaultValue.format(**cmdVarsNoCache)
except KeyError as e:
logging.warning('Invalid expression with missing key on "{nodeName}.{attrName}" with value "{defaultValue}".\nError: {err}'.format(nodeName=self.name, attrName=attr.name, defaultValue=defaultValue, err=str(e)))
except ValueError as e:
logging.warning('Invalid expression value on "{nodeName}.{attrName}" with value "{defaultValue}".\nError: {err}'.format(nodeName=self.name, attrName=attr.name, defaultValue=defaultValue, err=str(e)))
v = attr.getValueStr()
self._cmdVars[name] = '--{name} {value}'.format(name=name, value=v)