From 1a050968a51f6f1e91e9ff72a8b856b2510ecc28 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Fri, 3 Aug 2018 10:51:01 +0200 Subject: [PATCH 1/2] Clear out old gcode This way if you move the model, and don't hit prepare again, you can end up exporting the old gcode again thinking its new gcode. --- plugins/CuraEngineBackend/CuraEngineBackend.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index beec374d8d..796495fef8 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -541,6 +541,9 @@ class CuraEngineBackend(QObject, Backend): ## Remove old layer data (if any) def _clearLayerData(self, build_plate_numbers: Set = None) -> None: + # Clear out any old gcode + self._scene.gcode_dict = {} # type: dict + for node in DepthFirstIterator(self._scene.getRoot()): #type: ignore #Ignore type error because iter() should get called automatically by Python syntax. if node.callDecoration("getLayerData"): if not build_plate_numbers or node.callDecoration("getBuildPlateNumber") in build_plate_numbers: From 1d0e88dc161844f4342176b1da4b810348bf0ba0 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Fri, 3 Aug 2018 11:00:56 +0200 Subject: [PATCH 2/2] Fix typing issue --- plugins/CuraEngineBackend/CuraEngineBackend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index 796495fef8..56763a6632 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -542,7 +542,7 @@ class CuraEngineBackend(QObject, Backend): ## Remove old layer data (if any) def _clearLayerData(self, build_plate_numbers: Set = None) -> None: # Clear out any old gcode - self._scene.gcode_dict = {} # type: dict + self._scene.gcode_dict = {} # type: ignore for node in DepthFirstIterator(self._scene.getRoot()): #type: ignore #Ignore type error because iter() should get called automatically by Python syntax. if node.callDecoration("getLayerData"):