Browse Source

CURA-4778 Add up to 8 different colors when loading a GCode, since we
support up to 8 extruders in CFP

Diego Prado Gesto 7 years ago
parent
commit
e3e6f301f9

+ 7 - 1
plugins/GCodeReader/FlavorParser.py

@@ -418,9 +418,15 @@ class FlavorParser:
                     self._layer_number += 1
                     current_path.clear()
 
-        material_color_map = numpy.zeros((10, 4), dtype = numpy.float32)
+        material_color_map = numpy.zeros((8, 4), dtype = numpy.float32)
         material_color_map[0, :] = [0.0, 0.7, 0.9, 1.0]
         material_color_map[1, :] = [0.7, 0.9, 0.0, 1.0]
+        material_color_map[2, :] = [0.9, 0.0, 0.7, 1.0]
+        material_color_map[3, :] = [0.7, 0.0, 0.0, 1.0]
+        material_color_map[4, :] = [0.0, 0.7, 0.0, 1.0]
+        material_color_map[5, :] = [0.0, 0.0, 0.7, 1.0]
+        material_color_map[6, :] = [0.3, 0.3, 0.3, 1.0]
+        material_color_map[7, :] = [0.7, 0.7, 0.7, 1.0]
         layer_mesh = self._layer_data_builder.build(material_color_map)
         decorator = LayerDataDecorator()
         decorator.setLayerData(layer_mesh)

+ 1 - 1
plugins/SimulationView/SimulationView.py

@@ -104,7 +104,7 @@ class SimulationView(View):
                                                   title = catalog.i18nc("@info:title", "Simulation View"))
 
     def _resetSettings(self):
-        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, 3 is layer thickness
         self._extruder_count = 0
         self._extruder_opacity = [1.0, 1.0, 1.0, 1.0]
         self._show_travel_moves = 0

+ 0 - 1
plugins/SimulationView/SimulationView.qml

@@ -176,7 +176,6 @@ Item
                     viewSettings.show_feedrate_gradient = viewSettings.show_gradient && (type_id == 2);
                     viewSettings.show_thickness_gradient = viewSettings.show_gradient && (type_id == 3);
                 }
-
             }
 
             Label