mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 00:16:04 +08:00
Fix colour of unknown material
The other colour was just used for debugging. Contributes to issue CURA-3161.
This commit is contained in:
parent
2a114f1e53
commit
d7b0336c24
@ -1,3 +1,6 @@
|
|||||||
|
# Copyright (c) 2017 Ultimaker B.V.
|
||||||
|
# Cura is released under the terms of the AGPLv3 or higher.
|
||||||
|
|
||||||
from UM.i18n import i18nCatalog
|
from UM.i18n import i18nCatalog
|
||||||
from UM.OutputDevice.OutputDevice import OutputDevice
|
from UM.OutputDevice.OutputDevice import OutputDevice
|
||||||
from PyQt5.QtCore import pyqtProperty, pyqtSignal, pyqtSlot, QObject
|
from PyQt5.QtCore import pyqtProperty, pyqtSignal, pyqtSlot, QObject
|
||||||
@ -357,14 +360,14 @@ class PrinterOutputDevice(QObject, OutputDevice):
|
|||||||
result = []
|
result = []
|
||||||
for material_id in self._material_ids:
|
for material_id in self._material_ids:
|
||||||
if material_id is None:
|
if material_id is None:
|
||||||
result.append("#800000FF") #No material.
|
result.append("#00000000") #No material.
|
||||||
continue
|
continue
|
||||||
|
|
||||||
containers = self._container_registry.findInstanceContainers(type = "material", GUID = material_id)
|
containers = self._container_registry.findInstanceContainers(type = "material", GUID = material_id)
|
||||||
if containers:
|
if containers:
|
||||||
result.append(containers[0].getMetaDataEntry("color_code"))
|
result.append(containers[0].getMetaDataEntry("color_code"))
|
||||||
else:
|
else:
|
||||||
result.append("#800000FF") #Unknown material.
|
result.append("#00000000") #Unknown material.
|
||||||
return result
|
return result
|
||||||
|
|
||||||
## Protected setter for the current material id.
|
## Protected setter for the current material id.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user