mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Fix extruder color when no extruder_nr has been added to an object
CURA-345
This commit is contained in:
parent
963a2092ef
commit
3fcfbb4e48
1 changed files with 13 additions and 14 deletions
|
@ -61,10 +61,9 @@ class SolidView(View):
|
|||
extruder_index = 0
|
||||
extruder_id = node.callDecoration("getActiveExtruder")
|
||||
if extruder_id:
|
||||
extruder_index = self._extruders_model.find("id", extruder_id)
|
||||
if extruder_index:
|
||||
extruder_color = self._extruders_model.getItem(extruder_index)["color"]
|
||||
extruder_index = max(0, self._extruders_model.find("id", extruder_id))
|
||||
|
||||
extruder_color = self._extruders_model.getItem(extruder_index)["color"]
|
||||
try:
|
||||
# Colors are passed as rgb hex strings (eg "#ffffff"), and the shader needs
|
||||
# an rgba list of floats (eg [1.0, 1.0, 1.0, 1.0])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue