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

support up to 8 extruders in CFP
This commit is contained in:
Diego Prado Gesto 2018-01-09 10:42:03 +01:00
parent 0722465fb9
commit e3e6f301f9
3 changed files with 8 additions and 3 deletions

View file

@ -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)