Browse Source

D6: Fixed file naming, removed spaces and fixed decoration calls

Victor Larchenko 8 years ago
parent
commit
485e81731f

+ 1 - 1
cura/BlockSlicingDecorator.py

@@ -4,6 +4,6 @@ from UM.Scene.SceneNodeDecorator import SceneNodeDecorator
 class BlockSlicingDecorator(SceneNodeDecorator):
     def __init__(self):
         super().__init__()
-        
+
     def isBlockSlicing(self):
         return True

+ 10 - 3
cura/CuraApplication.py

@@ -585,10 +585,13 @@ class CuraApplication(QtApplication):
     def updatePlatformActivity(self, node = None):
         count = 0
         scene_bounding_box = None
+        is_block_slicing_node = False
         for node in DepthFirstIterator(self.getController().getScene().getRoot()):
-            if type(node) is not SceneNode or (not node.getMeshData() and not node.callDecoration("isBlockSlicing")):
+            if type(node) is not SceneNode or (not node.getMeshData() and not node.callDecoration("getLayerData")):
                 continue
-            
+            if node.callDecoration("isBlockSlicing"):
+                is_block_slicing_node = True
+
             count += 1
             if not scene_bounding_box:
                 scene_bounding_box = node.getBoundingBox()
@@ -597,6 +600,10 @@ class CuraApplication(QtApplication):
                 if other_bb is not None:
                     scene_bounding_box = scene_bounding_box + node.getBoundingBox()
 
+        print_information = self.getPrintInformation()
+        if print_information:
+            print_information.setPreSliced(is_block_slicing_node)
+
         if not scene_bounding_box:
             scene_bounding_box = AxisAlignedBox.Null
 
@@ -717,7 +724,7 @@ class CuraApplication(QtApplication):
         for node in DepthFirstIterator(self.getController().getScene().getRoot()):
             if type(node) is not SceneNode:
                 continue
-            if (not node.getMeshData() and not node.callDecoration("isBlockSlicing")) and not node.callDecoration("isGroup"):
+            if (not node.getMeshData() and not node.callDecoration("getLayerData")) and not node.callDecoration("isGroup"):
                 continue  # Node that doesnt have a mesh and is not a group.
             if node.getParent() and node.getParent().callDecoration("isGroup"):
                 continue  # Grouped nodes don't need resetting as their parent (the group) is resetted)

+ 1 - 1
cura/GCodeListDecorator.py

@@ -5,7 +5,7 @@ class GCodeListDecorator(SceneNodeDecorator):
     def __init__(self):
         super().__init__()
         self._gcode_list = []
-        
+
     def getGCodeList(self):
         return self._gcode_list
 

+ 0 - 7
plugins/CuraEngineBackend/CuraEngineBackend.py

@@ -315,8 +315,6 @@ class CuraEngineBackend(Backend):
         if source is self._scene.getRoot():
             return
 
-        application = Application.getInstance()
-
         should_pause = False
         for node in DepthFirstIterator(self._scene.getRoot()):
             if node.callDecoration("isBlockSlicing"):
@@ -325,15 +323,10 @@ class CuraEngineBackend(Backend):
             if gcode_list is not None:
                 self._scene.gcode_list = gcode_list
 
-        print_information = application.getPrintInformation()
         if should_pause:
             self.pauseSlicing()
-            if print_information:
-                print_information.setPreSliced(True)
         else:
             self.continueSlicing()
-            if print_information:
-                print_information.setPreSliced(False)
 
         if source.getMeshData() is None:
             return