Use stack properties instead of .findContainer(type = ...)

Recently we changed the empty containers such that there is only one empty container instance and it doesn't have the proper type any more. Instead we have properties on the stack that allows us to find the container with the proper type. It's faster and easier to use.
We've had a few bugs about this so I decided to update all of them to remove those for the future, except the ones in plugins/MachineSettingsAction/MachineSettingsAction.py because we have a pending pull request that fixes those. Fixing them would give merge conflicts for fieldOfView.

It doesn't really belong to CURA-4024 but I'm sticking it under that nomer anyway to get it reviewed.
This commit is contained in:
Ghostkeeper 2017-07-10 10:35:03 +02:00
parent 4ad9ebc444
commit 81e07b1530
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75
4 changed files with 11 additions and 15 deletions

View file

@ -107,9 +107,9 @@ class ProfilesModel(InstanceContainersModel):
continue
#Quality has no value for layer height either. Get the layer height from somewhere lower in the stack.
skip_until_container = global_container_stack.findContainer({"type": "material"})
skip_until_container = global_container_stack.material
if not skip_until_container: #No material in stack.
skip_until_container = global_container_stack.findContainer({"type": "variant"})
skip_until_container = global_container_stack.variant
if not skip_until_container: #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.