Skip to content

Commit 056ef7f

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 e3cb33a commit 056ef7f

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎python/plugins/processing/modeler/ModelerAlgorithm.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,15 @@ def processAlgorithm(self, progress):
507507
t0 = time.time()
508508
alg.algorithm.execute(progress, self)
509509
dt = time.time() - t0
510+
511+
# copy algorithm output value(s) back to model in case the algorithm modified those
512+
for out in alg.algorithm.outputs:
513+
if not out.hidden:
514+
if out.name in alg.outputs:
515+
modelOut = self.getOutputFromName(self.getSafeNameForOutput(alg.name, out.name))
516+
if modelOut:
517+
modelOut.value = out.value
518+
510519
executed.append(alg.name)
511520
progress.setDebugInfo(
512521
self.tr('OK. Execution took %0.3f ms (%i outputs).', 'ModelerAlgorithm') % (dt, len(alg.algorithm.outputs)))

0 commit comments

Comments
 (0)