mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 06:58:59 +08:00
If a default color is used, the layer view now correctly uses it.
This commit is contained in:
parent
53cec3bea4
commit
afe5f56862
@ -24,6 +24,7 @@ from cura import LayerPolygon
|
|||||||
|
|
||||||
import numpy
|
import numpy
|
||||||
from time import time
|
from time import time
|
||||||
|
from cura.Settings.ExtrudersModel import ExtrudersModel
|
||||||
catalog = i18nCatalog("cura")
|
catalog = i18nCatalog("cura")
|
||||||
|
|
||||||
|
|
||||||
@ -174,7 +175,11 @@ class ProcessSlicedLayersJob(Job):
|
|||||||
material_color_map = numpy.zeros((len(extruders), 4), dtype=numpy.float32)
|
material_color_map = numpy.zeros((len(extruders), 4), dtype=numpy.float32)
|
||||||
for extruder in extruders:
|
for extruder in extruders:
|
||||||
position = int(extruder.getMetaDataEntry("position", default="0")) # Get the position
|
position = int(extruder.getMetaDataEntry("position", default="0")) # Get the position
|
||||||
color_code = extruder.material.getMetaDataEntry("color_code", default="#e0e000")
|
try:
|
||||||
|
default_color = ExtrudersModel.defaultColors[position]
|
||||||
|
except KeyError:
|
||||||
|
default_color = "#e0e000"
|
||||||
|
color_code = extruder.material.getMetaDataEntry("color_code", default=default_color)
|
||||||
color = colorCodeToRGBA(color_code)
|
color = colorCodeToRGBA(color_code)
|
||||||
material_color_map[position, :] = color
|
material_color_map[position, :] = color
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user