From: Youness Alaoui Date: Sat, 10 Jan 2015 18:56:47 +0000 (-0500) Subject: Use the right plugin configuration when running the engine X-Git-Tag: lulzbot-15.02.1-1.01~75^2~4^2~1 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=4a9bb212ddf975e8c2848e475e39c43e1862dc7f;p=cura.git 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 --- 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)