mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -06:00
Layerview removed Color Only Selected Extruder, cleanup 3d shader. CURA-3273
This commit is contained in:
parent
2f9618f2ad
commit
5f6ed488d1
5 changed files with 0 additions and 31 deletions
|
@ -45,7 +45,6 @@ class LayerPass(RenderPass):
|
||||||
self._layer_shader.setUniformValue("u_active_extruder", float(max(0, self._extruder_manager.activeExtruderIndex)))
|
self._layer_shader.setUniformValue("u_active_extruder", float(max(0, self._extruder_manager.activeExtruderIndex)))
|
||||||
if self._layer_view:
|
if self._layer_view:
|
||||||
self._layer_shader.setUniformValue("u_layer_view_type", self._layer_view.getLayerViewType())
|
self._layer_shader.setUniformValue("u_layer_view_type", self._layer_view.getLayerViewType())
|
||||||
self._layer_shader.setUniformValue("u_only_color_active_extruder", (1 if self._layer_view.getOnlyColorActiveExtruder() else 0))
|
|
||||||
self._layer_shader.setUniformValue("u_extruder_opacity", self._layer_view.getExtruderOpacities())
|
self._layer_shader.setUniformValue("u_extruder_opacity", self._layer_view.getExtruderOpacities())
|
||||||
self._layer_shader.setUniformValue("u_show_travel_moves", self._layer_view.getShowTravelMoves())
|
self._layer_shader.setUniformValue("u_show_travel_moves", self._layer_view.getShowTravelMoves())
|
||||||
self._layer_shader.setUniformValue("u_show_support", self._layer_view.getShowSupport())
|
self._layer_shader.setUniformValue("u_show_support", self._layer_view.getShowSupport())
|
||||||
|
@ -55,7 +54,6 @@ class LayerPass(RenderPass):
|
||||||
else:
|
else:
|
||||||
#defaults
|
#defaults
|
||||||
self._layer_shader.setUniformValue("u_layer_view_type", 1)
|
self._layer_shader.setUniformValue("u_layer_view_type", 1)
|
||||||
self._layer_shader.setUniformValue("u_only_color_active_extruder", 1)
|
|
||||||
self._layer_shader.setUniformValue("u_extruder_opacity", [1, 1, 1, 1])
|
self._layer_shader.setUniformValue("u_extruder_opacity", [1, 1, 1, 1])
|
||||||
self._layer_shader.setUniformValue("u_show_travel_moves", 0)
|
self._layer_shader.setUniformValue("u_show_travel_moves", 0)
|
||||||
self._layer_shader.setUniformValue("u_show_support", 1)
|
self._layer_shader.setUniformValue("u_show_support", 1)
|
||||||
|
|
|
@ -60,7 +60,6 @@ class LayerView(View):
|
||||||
self._controller.getScene().getRoot().childrenChanged.connect(self._onSceneChanged)
|
self._controller.getScene().getRoot().childrenChanged.connect(self._onSceneChanged)
|
||||||
|
|
||||||
self._layer_view_type = 0 # 0 is material color, 1 is color by linetype, 2 is speed
|
self._layer_view_type = 0 # 0 is material color, 1 is color by linetype, 2 is speed
|
||||||
self._only_color_active_extruder = True
|
|
||||||
self._extruder_opacity = [1.0, 1.0, 1.0, 1.0]
|
self._extruder_opacity = [1.0, 1.0, 1.0, 1.0]
|
||||||
self._show_travel_moves = 0
|
self._show_travel_moves = 0
|
||||||
self._show_support = 1
|
self._show_support = 1
|
||||||
|
@ -167,13 +166,6 @@ class LayerView(View):
|
||||||
def getLayerViewType(self):
|
def getLayerViewType(self):
|
||||||
return self._layer_view_type
|
return self._layer_view_type
|
||||||
|
|
||||||
def setOnlyColorActiveExtruder(self, only_color_active_extruder):
|
|
||||||
self._only_color_active_extruder = only_color_active_extruder
|
|
||||||
self.currentLayerNumChanged.emit()
|
|
||||||
|
|
||||||
def getOnlyColorActiveExtruder(self):
|
|
||||||
return self._only_color_active_extruder
|
|
||||||
|
|
||||||
def setExtruderOpacity(self, extruder_nr, opacity):
|
def setExtruderOpacity(self, extruder_nr, opacity):
|
||||||
self._extruder_opacity[extruder_nr] = opacity
|
self._extruder_opacity[extruder_nr] = opacity
|
||||||
self.currentLayerNumChanged.emit()
|
self.currentLayerNumChanged.emit()
|
||||||
|
|
|
@ -247,13 +247,6 @@ Item
|
||||||
}
|
}
|
||||||
text: "Show infill"
|
text: "Show infill"
|
||||||
}
|
}
|
||||||
CheckBox {
|
|
||||||
checked: true
|
|
||||||
onClicked: {
|
|
||||||
UM.LayerView.setOnlyColorActiveExtruder(checked);
|
|
||||||
}
|
|
||||||
text: "Only color active extruder"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,12 +84,6 @@ class LayerViewProxy(QObject):
|
||||||
return active_view.getLayerViewType()
|
return active_view.getLayerViewType()
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@pyqtSlot(bool)
|
|
||||||
def setOnlyColorActiveExtruder(self, only_color_active_extruder):
|
|
||||||
active_view = self._controller.getActiveView()
|
|
||||||
if type(active_view) == LayerView.LayerView.LayerView:
|
|
||||||
active_view.setOnlyColorActiveExtruder(only_color_active_extruder)
|
|
||||||
|
|
||||||
# Opacity 0..1
|
# Opacity 0..1
|
||||||
@pyqtSlot(int, float)
|
@pyqtSlot(int, float)
|
||||||
def setExtruderOpacity(self, extruder_nr, opacity):
|
def setExtruderOpacity(self, extruder_nr, opacity):
|
||||||
|
|
|
@ -3,10 +3,8 @@ vertex =
|
||||||
#version 410
|
#version 410
|
||||||
uniform highp mat4 u_modelMatrix;
|
uniform highp mat4 u_modelMatrix;
|
||||||
uniform highp mat4 u_viewProjectionMatrix;
|
uniform highp mat4 u_viewProjectionMatrix;
|
||||||
//uniform highp mat4 u_modelViewProjectionMatrix;
|
|
||||||
uniform lowp float u_active_extruder;
|
uniform lowp float u_active_extruder;
|
||||||
uniform lowp int u_layer_view_type;
|
uniform lowp int u_layer_view_type;
|
||||||
uniform lowp int u_only_color_active_extruder;
|
|
||||||
uniform lowp vec4 u_extruder_opacity; // currently only for max 4 extruders, others always visible
|
uniform lowp vec4 u_extruder_opacity; // currently only for max 4 extruders, others always visible
|
||||||
|
|
||||||
uniform highp mat4 u_normalMatrix;
|
uniform highp mat4 u_normalMatrix;
|
||||||
|
@ -20,11 +18,9 @@ vertex =
|
||||||
attribute highp int a_line_type;
|
attribute highp int a_line_type;
|
||||||
|
|
||||||
varying lowp vec4 v_color;
|
varying lowp vec4 v_color;
|
||||||
//varying lowp vec4 v_material_color;
|
|
||||||
|
|
||||||
varying highp vec3 v_vertex;
|
varying highp vec3 v_vertex;
|
||||||
varying highp vec3 v_normal;
|
varying highp vec3 v_normal;
|
||||||
//varying lowp vec2 v_uvs;
|
|
||||||
varying lowp vec2 v_line_dim;
|
varying lowp vec2 v_line_dim;
|
||||||
varying highp int v_extruder;
|
varying highp int v_extruder;
|
||||||
varying highp vec4 v_extruder_opacity;
|
varying highp vec4 v_extruder_opacity;
|
||||||
|
@ -52,9 +48,6 @@ vertex =
|
||||||
v_color = a_color;
|
v_color = a_color;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ((u_only_color_active_extruder == 1) && (a_line_type != 8) && (a_line_type != 9)) {
|
|
||||||
v_color = (a_extruder == u_active_extruder) ? v_color : vec4(0.4, 0.4, 0.4, v_color.a);
|
|
||||||
}
|
|
||||||
|
|
||||||
v_vertex = world_space_vert.xyz;
|
v_vertex = world_space_vert.xyz;
|
||||||
v_normal = (u_normalMatrix * normalize(a_normal)).xyz;
|
v_normal = (u_normalMatrix * normalize(a_normal)).xyz;
|
||||||
|
@ -323,7 +316,6 @@ fragment =
|
||||||
[defaults]
|
[defaults]
|
||||||
u_active_extruder = 0.0
|
u_active_extruder = 0.0
|
||||||
u_layer_view_type = 0
|
u_layer_view_type = 0
|
||||||
u_only_color_active_extruder = 1
|
|
||||||
u_extruder_opacity = [1.0, 1.0, 1.0, 1.0]
|
u_extruder_opacity = [1.0, 1.0, 1.0, 1.0]
|
||||||
|
|
||||||
u_specularColor = [0.4, 0.4, 0.4, 1.0]
|
u_specularColor = [0.4, 0.4, 0.4, 1.0]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue