mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-10 00:07:51 -06:00
Handle the startup situation where there is no global stack. Fixed a bug where the wrong stack was used instead of the first extruder.
Contributes to CURA-2477 Profile menu should only contain valid options for all materials
This commit is contained in:
parent
7b7c161d93
commit
062611a92a
1 changed files with 4 additions and 1 deletions
|
@ -18,6 +18,9 @@ class ProfilesModel(InstanceContainersModel):
|
||||||
# See UM.Settings.Models.InstanceContainersModel._fetchInstanceContainers().
|
# See UM.Settings.Models.InstanceContainersModel._fetchInstanceContainers().
|
||||||
def _fetchInstanceContainers(self):
|
def _fetchInstanceContainers(self):
|
||||||
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||||
|
if global_container_stack is None:
|
||||||
|
return []
|
||||||
|
|
||||||
global_machine_definition = global_container_stack.getBottom()
|
global_machine_definition = global_container_stack.getBottom()
|
||||||
|
|
||||||
extruder_stacks = ExtruderManager.getInstance().getActiveExtruderStacks()
|
extruder_stacks = ExtruderManager.getInstance().getActiveExtruderStacks()
|
||||||
|
@ -26,7 +29,7 @@ class ProfilesModel(InstanceContainersModel):
|
||||||
|
|
||||||
# Determine the common set of quality types which can be
|
# Determine the common set of quality types which can be
|
||||||
# applied to all of the materials for this machine.
|
# applied to all of the materials for this machine.
|
||||||
quality_type_dict = self.__fetchQualityTypeDictForStack(global_container_stack, global_machine_definition)
|
quality_type_dict = self.__fetchQualityTypeDictForStack(extruder_stacks[0], global_machine_definition)
|
||||||
common_quality_types = set(quality_type_dict.keys())
|
common_quality_types = set(quality_type_dict.keys())
|
||||||
for stack in extruder_stacks[1:]:
|
for stack in extruder_stacks[1:]:
|
||||||
next_quality_type_dict = self.__fetchQualityTypeDictForStack(stack, global_machine_definition)
|
next_quality_type_dict = self.__fetchQualityTypeDictForStack(stack, global_machine_definition)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue