Use material color for cutting_mesh and infill_mesh

This commit is contained in:
fieldOfView 2017-11-10 12:24:32 +01:00
parent ac27b3f811
commit e00ac591bf
2 changed files with 7 additions and 2 deletions

View file

@ -86,6 +86,8 @@ class SolidView(View):
uniforms = {} uniforms = {}
shade_factor = 1.0 shade_factor = 1.0
per_mesh_stack = node.callDecoration("getStack")
if not multi_extrusion: if not multi_extrusion:
if global_container_stack: if global_container_stack:
material = global_container_stack.findContainer({ "type": "material" }) material = global_container_stack.findContainer({ "type": "material" })
@ -100,7 +102,6 @@ class SolidView(View):
extruder_index = max(0, self._extruders_model.find("id", extruder_id)) extruder_index = max(0, self._extruders_model.find("id", extruder_id))
# Use the support extruder instead of the active extruder if this is a support_mesh # Use the support extruder instead of the active extruder if this is a support_mesh
per_mesh_stack = node.callDecoration("getStack")
if per_mesh_stack: if per_mesh_stack:
if per_mesh_stack.getProperty("support_mesh", "value"): if per_mesh_stack.getProperty("support_mesh", "value"):
extruder_index = int(global_container_stack.getProperty("support_extruder_nr", "value")) extruder_index = int(global_container_stack.getProperty("support_extruder_nr", "value"))
@ -126,6 +127,9 @@ class SolidView(View):
pass pass
if getattr(node, "_non_printing_mesh", False): if getattr(node, "_non_printing_mesh", False):
if per_mesh_stack and (per_mesh_stack.getProperty("infill_mesh", "value") or per_mesh_stack.getProperty("cutting_mesh", "value")):
renderer.queueNode(node, shader = self._non_printing_shader, uniforms = uniforms, transparent = True)
else:
renderer.queueNode(node, shader = self._non_printing_shader, transparent = True) renderer.queueNode(node, shader = self._non_printing_shader, transparent = True)
elif getattr(node, "_outside_buildarea", False): elif getattr(node, "_outside_buildarea", False):
renderer.queueNode(node, shader = self._disabled_shader) renderer.queueNode(node, shader = self._disabled_shader)

View file

@ -111,6 +111,7 @@ u_modelMatrix = model_matrix
u_viewProjectionMatrix = view_projection_matrix u_viewProjectionMatrix = view_projection_matrix
u_normalMatrix = normal_matrix u_normalMatrix = normal_matrix
u_lightPosition = light_0_position u_lightPosition = light_0_position
u_diffuseColor = diffuse_color
[attributes] [attributes]
a_vertex = vertex a_vertex = vertex