From 4a9bb212ddf975e8c2848e475e39c43e1862dc7f Mon Sep 17 00:00:00 2001 From: Youness Alaoui Date: Sat, 10 Jan 2015 13:56:47 -0500 Subject: [PATCH] Use the right plugin configuration when running the engine The simple settings would override the plugin config to disable all then run the engine then reset the overrides, but the plugin config was not accessed until the slicing engine finished, at which point the plugin config override was already reset. this caused plugins to be kept enabled even in simple mode. This fixes issue #59 --- Cura/util/pluginInfo.py | 3 +-- Cura/util/sliceEngine.py | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Cura/util/pluginInfo.py b/Cura/util/pluginInfo.py index 7290c8bc..54fe7252 100644 --- a/Cura/util/pluginInfo.py +++ b/Cura/util/pluginInfo.py @@ -111,8 +111,7 @@ def getPluginList(pluginType): ret.append(plugin) return ret -def runPostProcessingPlugins(engineResult): - pluginConfigList = getPostProcessPluginConfig() +def runPostProcessingPlugins(engineResult, pluginConfigList): pluginList = getPluginList('postprocess') tempfilename = None diff --git a/Cura/util/sliceEngine.py b/Cura/util/sliceEngine.py index 66e10a11..a1f9bd4d 100644 --- a/Cura/util/sliceEngine.py +++ b/Cura/util/sliceEngine.py @@ -356,11 +356,11 @@ class Engine(object): self._objCount += 1 modelHash = hash.hexdigest() if self._objCount > 0: - self._thread = threading.Thread(target=self._watchProcess, args=(commandList, self._thread, engineModelData, modelHash)) + self._thread = threading.Thread(target=self._watchProcess, args=(commandList, self._thread, engineModelData, modelHash, pluginInfo.getPostProcessPluginConfig())) self._thread.daemon = True self._thread.start() - def _watchProcess(self, commandList, oldThread, engineModelData, modelHash): + def _watchProcess(self, commandList, oldThread, engineModelData, modelHash, pluginConfig): if oldThread is not None: if self._process is not None: self._process.terminate() @@ -400,7 +400,7 @@ class Engine(object): pass if returnCode == 0: - pluginError = pluginInfo.runPostProcessingPlugins(self._result) + pluginError = pluginInfo.runPostProcessingPlugins(self._result, pluginConfig) if pluginError is not None: print pluginError self._result.addLog(pluginError) -- 2.30.2