Do not render the convex hull node unless the object is selected

Contributes to #52
This commit is contained in:
Arjen Hiemstra 2015-06-16 13:11:19 +02:00
parent 2aa2d4d1a8
commit 9849283144
2 changed files with 11 additions and 0 deletions

View file

@ -11,6 +11,9 @@ from . import LayerViewProxy
from UM.Scene.Selection import Selection
from UM.Math.Color import Color
from cura.ConvexHullNode import ConvexHullNode
## View used to display g-code paths.
class LayerView(View):
def __init__(self):
@ -45,6 +48,11 @@ class LayerView(View):
self._selection_material.setUniformValue("u_color", Color(35, 35, 35, 128))
for node in DepthFirstIterator(scene.getRoot()):
# We do not want to render ConvexHullNode as it conflicts with the bottom layers.
# However, it is somewhat relevant when the node is selected, so do render it then.
if type(node) is ConvexHullNode and not Selection.isSelected(node.getWatchedNode()):
continue
if not node.render(renderer):
if node.getMeshData() and node.isVisible():
if Selection.isSelected(node):