Skip to content

Commit da3eb06

Browse files
nirvnalexbruy
authored andcommitted
[processing] fix modeler output values in case algorithm(s)
execution modifies those (fixes #16021) (cherry picked from commit 9908d9c)
1 parent b6fb784 commit da3eb06

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

python/plugins/processing/modeler/ModelerAlgorithm.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,15 @@ def processAlgorithm(self, progress):
491491
t0 = time.time()
492492
alg.algorithm.execute(progress, self)
493493
dt = time.time() - t0
494+
495+
# copy algorithm output value(s) back to model in case the algorithm modified those
496+
for out in alg.algorithm.outputs:
497+
if not out.hidden:
498+
if out.name in alg.outputs:
499+
modelOut = self.getOutputFromName(self.getSafeNameForOutput(alg.name, out.name))
500+
if modelOut:
501+
modelOut.value = out.value
502+
494503
executed.append(alg.name)
495504
progress.setDebugInfo(
496505
self.tr('OK. Execution took %0.3f ms (%i outputs).', 'ModelerAlgorithm') % (dt, len(alg.algorithm.outputs)))

0 commit comments

Comments
 (0)