Empty InstanceContainers are now correctly handled by setActiveMaterial again

CURA-3789
This commit is contained in:
Jaime van Kessel 2017-05-12 13:59:31 +02:00
parent f60765c56c
commit ef2aa3b2b2

View file

@ -721,7 +721,7 @@ class MachineManager(QObject):
Logger.log("w", "While trying to set the active material, no material was found to replace it.") Logger.log("w", "While trying to set the active material, no material was found to replace it.")
return return
if old_quality_changes and old_quality_changes.getId() == "empty_quality_changes": if old_quality_changes and isinstance(old_quality_changes, type(self._empty_quality_changes_container)):
old_quality_changes = None old_quality_changes = None
self.blurSettings.emit() self.blurSettings.emit()
@ -754,7 +754,7 @@ class MachineManager(QObject):
candidate_quality = quality_manager.findQualityByQualityType(quality_type, candidate_quality = quality_manager.findQualityByQualityType(quality_type,
quality_manager.getWholeMachineDefinition(machine_definition), quality_manager.getWholeMachineDefinition(machine_definition),
[material_container]) [material_container])
if not candidate_quality or candidate_quality.getId() == "empty_quality": if not candidate_quality or isinstance(candidate_quality, type(self._empty_quality_changes_container)):
# Fall back to a quality (which must be compatible with all other extruders) # Fall back to a quality (which must be compatible with all other extruders)
new_qualities = quality_manager.findAllUsableQualitiesForMachineAndExtruders( new_qualities = quality_manager.findAllUsableQualitiesForMachineAndExtruders(
self._global_container_stack, ExtruderManager.getInstance().getExtruderStacks()) self._global_container_stack, ExtruderManager.getInstance().getExtruderStacks())