mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-03 12:03:57 -06:00
CURA-4606 incompatible material(s) now results in an empty quality list
This commit is contained in:
parent
b96d49c010
commit
8401e1c7f7
2 changed files with 19 additions and 1 deletions
|
@ -48,12 +48,18 @@ class QualityProfilesModel(ListModel):
|
|||
def _update(self):
|
||||
Logger.log("d", "Updating quality profile model ...")
|
||||
|
||||
active_global_stack = Application.getInstance().getMachineManager()._global_container_stack
|
||||
machine_manager = Application.getInstance().getMachineManager()
|
||||
active_global_stack = machine_manager._global_container_stack
|
||||
if active_global_stack is None:
|
||||
self.setItems([])
|
||||
Logger.log("d", "No active GlobalStack, set quality profile model as empty.")
|
||||
return
|
||||
|
||||
# Check for material compatibility
|
||||
if not machine_manager.activeMaterialsCompatible():
|
||||
self.setItems([])
|
||||
return
|
||||
|
||||
quality_group_dict = self._quality_manager.getQualityGroups(active_global_stack)
|
||||
|
||||
item_list = []
|
||||
|
|
|
@ -1018,6 +1018,13 @@ class MachineManager(QObject):
|
|||
self._current_root_material_id[position] = root_material_id
|
||||
self.rootMaterialChanged.emit()
|
||||
|
||||
def activeMaterialsCompatible(self):
|
||||
# check material - variant compatibility
|
||||
for position, extruder in self._global_container_stack.extruders.items():
|
||||
if not extruder.material.getMetaDataEntry("compatible"):
|
||||
return False
|
||||
return True
|
||||
|
||||
## Update current quality type and machine after setting material
|
||||
def _updateQualityWithMaterial(self):
|
||||
current_quality = None
|
||||
|
@ -1027,6 +1034,11 @@ class MachineManager(QObject):
|
|||
candidate_quality_groups = quality_manager.getQualityGroups(self._global_container_stack)
|
||||
available_quality_types = {qt for qt, g in candidate_quality_groups.items() if g.is_available}
|
||||
|
||||
if not self.activeMaterialsCompatible:
|
||||
Logger.log("d", "Material [%s] is not compatible, setting empty material." % str(extruder.material))
|
||||
self._setEmptyQuality()
|
||||
return
|
||||
|
||||
if not available_quality_types:
|
||||
self._setEmptyQuality()
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue