chiark / gitweb /
Use the right plugin configuration when running the engine
authorYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Sat, 10 Jan 2015 18:56:47 +0000 (13:56 -0500)
committerYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Sat, 10 Jan 2015 18:56:47 +0000 (13:56 -0500)
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
Cura/util/sliceEngine.py

index 7290c8bc31a6571669368c9c73825e1f718dfbd2..54fe725287de4bc6ff29610699e236a0cf34760a 100644 (file)
@@ -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
index 66e10a11661f2ef71f616ded5bfc92e8c933b4bd..a1f9bd4d36b716283fb2f580e3d91bcd5a642cba 100644 (file)
@@ -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)