mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
CURA-4400 Fixed project loading
"enabled" metadata is now read from saved projects (.3mf)
This commit is contained in:
parent
19792fc1a6
commit
d7b0f11ddf
2 changed files with 14 additions and 0 deletions
|
@ -99,6 +99,7 @@ class MachineInfo:
|
|||
class ExtruderInfo:
|
||||
def __init__(self):
|
||||
self.position = None
|
||||
self.enabled = True
|
||||
self.variant_info = None
|
||||
self.root_material_id = None
|
||||
|
||||
|
@ -425,6 +426,8 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
|||
|
||||
extruder_info = ExtruderInfo()
|
||||
extruder_info.position = position
|
||||
if parser.has_option("metadata", "enabled"):
|
||||
extruder_info.enabled = parser["metadata"]["enabled"]
|
||||
if variant_id not in ("empty", "empty_variant"):
|
||||
extruder_info.variant_info = instance_container_info_dict[variant_id]
|
||||
if material_id not in ("empty", "empty_material"):
|
||||
|
@ -946,6 +949,15 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
|||
else:
|
||||
self._quality_type_to_apply = self._machine_info.quality_type
|
||||
|
||||
# Set enabled/disabled for extruders
|
||||
for position, extruder_stack in extruder_stack_dict.items():
|
||||
extruder_info = self._machine_info.extruder_info_dict.get(position)
|
||||
if not extruder_info:
|
||||
continue
|
||||
if "enabled" not in extruder_stack.getMetaData():
|
||||
extruder_stack.addMetaDataEntry("enabled", "True")
|
||||
extruder_stack.setMetaDataEntry("enabled", str(extruder_info.enabled))
|
||||
|
||||
def _updateActiveMachine(self, global_stack):
|
||||
# Actually change the active machine.
|
||||
machine_manager = Application.getInstance().getMachineManager()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue