Browse Source

CURA-4821 Fix one at a time slicing for builtiplexer

Jack Ha 7 years ago
parent
commit
ba29d64592
2 changed files with 11 additions and 5 deletions
  1. 2 1
      cura/OneAtATimeIterator.py
  2. 9 4
      plugins/CuraEngineBackend/StartSliceJob.py

+ 2 - 1
cura/OneAtATimeIterator.py

@@ -18,12 +18,13 @@ class OneAtATimeIterator(Iterator.Iterator):
     def _fillStack(self):
         node_list = []
         for node in self._scene_node.getChildren():
-            if not isinstance(node, SceneNode):
+            if not issubclass(type(node), SceneNode):
                 continue
 
             if node.callDecoration("getConvexHull"):
                 node_list.append(node)
 
+
         if len(node_list) < 2:
             self._node_stack = node_list[:]
             return 

+ 9 - 4
plugins/CuraEngineBackend/StartSliceJob.py

@@ -15,7 +15,7 @@ from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
 from UM.Settings.Validator import ValidatorState
 from UM.Settings.SettingRelation import RelationType
 
-from cura.Scene.CuraSceneNode import CuraSceneNode as SceneNode
+from cura.Scene.CuraSceneNode import CuraSceneNode
 from cura.OneAtATimeIterator import OneAtATimeIterator
 from cura.Settings.ExtruderManager import ExtruderManager
 
@@ -131,7 +131,7 @@ class StartSliceJob(Job):
 
         # Don't slice if there is a per object setting with an error value.
         for node in DepthFirstIterator(self._scene.getRoot()):
-            if type(node) is not SceneNode or not node.isSelectable():
+            if type(node) is not CuraSceneNode or not node.isSelectable():
                 continue
 
             if self._checkStackForErrors(node.callDecoration("getStack")):
@@ -155,10 +155,15 @@ class StartSliceJob(Job):
                     if getattr(node, "_outside_buildarea", False):
                         continue
 
+                    # Filter on current build plate
+                    build_plate_number = node.callDecoration("getBuildPlateNumber")
+                    if build_plate_number is not None and build_plate_number != self._build_plate_number:
+                        continue
+
                     children = node.getAllChildren()
                     children.append(node)
                     for child_node in children:
-                        if type(child_node) is SceneNode and child_node.getMeshData() and child_node.getMeshData().getVertices() is not None:
+                        if type(child_node) is CuraSceneNode and child_node.getMeshData() and child_node.getMeshData().getVertices() is not None:
                             temp_list.append(child_node)
 
                     if temp_list:
@@ -170,7 +175,7 @@ class StartSliceJob(Job):
                 temp_list = []
                 has_printing_mesh = False
                 for node in DepthFirstIterator(self._scene.getRoot()):
-                    if node.callDecoration("isSliceable") and type(node) is SceneNode and node.getMeshData() and node.getMeshData().getVertices() is not None:
+                    if node.callDecoration("isSliceable") and type(node) is CuraSceneNode and node.getMeshData() and node.getMeshData().getVertices() is not None:
                         per_object_stack = node.callDecoration("getStack")
                         is_non_printing_mesh = False
                         if per_object_stack: