mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 04:55:54 +08:00
Variants are now taken into account when auto updating material
CURA-2600
This commit is contained in:
parent
939ed60808
commit
c0654c56a0
@ -148,6 +148,16 @@ class MachineManager(QObject):
|
|||||||
|
|
||||||
if matching_extruder and matching_extruder.findContainer({"type": "material"}).getMetaDataEntry("GUID") != material_id:
|
if matching_extruder and matching_extruder.findContainer({"type": "material"}).getMetaDataEntry("GUID") != material_id:
|
||||||
# Save the material that needs to be changed. Multiple changes will be handled by the callback.
|
# Save the material that needs to be changed. Multiple changes will be handled by the callback.
|
||||||
|
if matching_extruder:
|
||||||
|
variant_container = matching_extruder.findContainer({"type": "variant"})
|
||||||
|
if self._global_container_stack.getBottom().getMetaDataEntry("has_variants") and variant_container:
|
||||||
|
variant_id = self.getQualityVariantId(self._global_container_stack.getBottom(), variant_container)
|
||||||
|
for container in containers:
|
||||||
|
if container.getMetaDataEntry("variant") == variant_id:
|
||||||
|
self._auto_materials_changed[str(index)] = container.getId()
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
# Just use the first result we found.
|
||||||
self._auto_materials_changed[str(index)] = containers[0].getId()
|
self._auto_materials_changed[str(index)] = containers[0].getId()
|
||||||
self._printer_output_devices[0].materialHotendChangedMessage(self._materialHotendChangedCallback)
|
self._printer_output_devices[0].materialHotendChangedMessage(self._materialHotendChangedCallback)
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user