diff --git a/cura/Scene/ConvexHullNode.py b/cura/Scene/ConvexHullNode.py index 13e8a1969c..cb4cffca12 100644 --- a/cura/Scene/ConvexHullNode.py +++ b/cura/Scene/ConvexHullNode.py @@ -86,8 +86,11 @@ class ConvexHullNode(SceneNode): ConvexHullNode.shader = OpenGL.getInstance().createShaderProgram(Resources.getPath(Resources.Shaders, "transparent_object.shader")) ConvexHullNode.shader.setUniformValue("u_diffuseColor", self._color) ConvexHullNode.shader.setUniformValue("u_opacity", 0.6) - - renderer.queueNode(self, transparent = True, shader = ConvexHullNode.shader, backface_cull = True, sort = -8) + batch = renderer.getNamedBatch("convex_hull_node") + if not batch: + batch = renderer.createRenderBatch(transparent = True, shader = ConvexHullNode.shader, backface_cull = True, sort = -8) + renderer.addRenderBatch(batch, name = "convex_hull_node") + batch.addItem(self.getWorldTransformation(copy = False), self.getMeshData()) if self._convex_hull_head_mesh: # The full head. Rendered as a hint to the user: If this area overlaps another object A; this object # cannot be printed after A, because the head would hit A while printing the current object diff --git a/plugins/SolidView/SolidView.py b/plugins/SolidView/SolidView.py index f16f696150..e1789e34ed 100644 --- a/plugins/SolidView/SolidView.py +++ b/plugins/SolidView/SolidView.py @@ -186,7 +186,8 @@ class SolidView(View): self._enabled_shader.setUniformValue("u_overhangAngle", math.cos(math.radians(0))) #Overhang angle of 0 causes no area at all to be marked as overhang. else: self._enabled_shader.setUniformValue("u_overhangAngle", math.cos(math.radians(0))) - + disabled_batch = renderer.createRenderBatch(shader = self._disabled_shader) + renderer.addRenderBatch(disabled_batch) for node in DepthFirstIterator(scene.getRoot()): if node.render(renderer): continue @@ -233,7 +234,7 @@ class SolidView(View): else: renderer.queueNode(node, shader = self._non_printing_shader, transparent = True) elif getattr(node, "_outside_buildarea", False): - renderer.queueNode(node, shader = self._disabled_shader) + disabled_batch.addItem(node.getWorldTransformation(copy = False), node.getMeshData()) elif per_mesh_stack and node.callDecoration("isSupportMesh"): # Render support meshes with a vertical stripe that is darker shade_factor = 0.6