From ab3d8349b6533987a7db9e57e11f28da32434d9a Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 9 Aug 2017 09:24:02 +0200 Subject: [PATCH] Also skip empty containers when getting layer height for a quality profile CURA-4133 On some machines such as UM2, there is no material. Getting the layer height in this case will result back to the global stack itself, which is the layer height of the current setting. This is a problem for "Normal" (or "Fine") quality because it uses the machine's default layer height. --- cura/Settings/ProfilesModel.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cura/Settings/ProfilesModel.py b/cura/Settings/ProfilesModel.py index 18acb5e9e8..3775353143 100644 --- a/cura/Settings/ProfilesModel.py +++ b/cura/Settings/ProfilesModel.py @@ -108,9 +108,9 @@ class ProfilesModel(InstanceContainersModel): #Quality has no value for layer height either. Get the layer height from somewhere lower in the stack. skip_until_container = global_container_stack.material - if not skip_until_container: #No material in stack. + if not skip_until_container or skip_until_container == ContainerRegistry.getInstance().getEmptyInstanceContainer(): #No material in stack. skip_until_container = global_container_stack.variant - if not skip_until_container: #No variant in stack. + if not skip_until_container or skip_until_container == ContainerRegistry.getInstance().getEmptyInstanceContainer(): #No variant in stack. skip_until_container = global_container_stack.getBottom() item["layer_height"] = str(global_container_stack.getRawProperty("layer_height", "value", skip_until_container = skip_until_container.getId())) + unit #Fall through to the currently loaded material. yield item \ No newline at end of file