From c95cc7a21b409f2ab3e7fad726139c751be1f04c Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Thu, 11 Aug 2016 16:44:19 +0200 Subject: [PATCH] Fix error in SolidView when there is a model but no printer --- plugins/SolidView/SolidView.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/SolidView/SolidView.py b/plugins/SolidView/SolidView.py index 7896892808..3e3501a83f 100644 --- a/plugins/SolidView/SolidView.py +++ b/plugins/SolidView/SolidView.py @@ -62,8 +62,11 @@ class SolidView(View): uniforms = {} if not multi_extrusion: - material = global_container_stack.findContainer({ "type": "material" }) - material_color = material.getMetaDataEntry("color_code", default = self._extruders_model.defaultColors[0]) if material else self._extruders_model.defaultColors[0] + if global_container_stack: + material = global_container_stack.findContainer({ "type": "material" }) + material_color = material.getMetaDataEntry("color_code", default = self._extruders_model.defaultColors[0]) if material else self._extruders_model.defaultColors[0] + else: + material_color = self._extruders_model.defaultColors[0] else: # Get color to render this mesh in from ExtrudersModel extruder_index = 0