Skip to content

Commit

Permalink
[processing] fix modeler output values in case algorithm(s)
Browse files Browse the repository at this point in the history
execution modifies those (fixes #16021)
(cherry picked from commit 9908d9c)
  • Loading branch information
nirvn authored and alexbruy committed Jan 24, 2017
1 parent e3cb33a commit 056ef7f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions python/plugins/processing/modeler/ModelerAlgorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,15 @@ def processAlgorithm(self, progress):
t0 = time.time()
alg.algorithm.execute(progress, self)
dt = time.time() - t0

# copy algorithm output value(s) back to model in case the algorithm modified those
for out in alg.algorithm.outputs:
if not out.hidden:
if out.name in alg.outputs:
modelOut = self.getOutputFromName(self.getSafeNameForOutput(alg.name, out.name))
if modelOut:
modelOut.value = out.value

executed.append(alg.name)
progress.setDebugInfo(
self.tr('OK. Execution took %0.3f ms (%i outputs).', 'ModelerAlgorithm') % (dt, len(alg.algorithm.outputs)))
Expand Down

0 comments on commit 056ef7f

Please sign in to comment.