mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 16:19:05 +08:00
Fix init machine for machines loaded from project files
This commit is contained in:
parent
a2e84bbe97
commit
2f86687320
@ -1082,11 +1082,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||
CuraApplication.getInstance().getMachineManager().activeQualityChanged.emit()
|
||||
|
||||
# Actually change the active machine.
|
||||
machine_manager = Application.getInstance().getMachineManager()
|
||||
machine_manager.setActiveMachine(global_stack.getId())
|
||||
|
||||
# Notify everything/one that is to notify about changes.
|
||||
global_stack.containersChanged.emit(global_stack.getTop())
|
||||
CuraApplication.getInstance().callLater(self._updateActiveMachine, global_stack)
|
||||
|
||||
# Load all the nodes / meshdata of the workspace
|
||||
nodes = self._3mf_mesh_reader.read(file_name)
|
||||
@ -1099,6 +1095,14 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||
self.setWorkspaceName(base_file_name)
|
||||
return nodes
|
||||
|
||||
def _updateActiveMachine(self, global_stack):
|
||||
# Actually change the active machine.
|
||||
machine_manager = Application.getInstance().getMachineManager()
|
||||
machine_manager.setActiveMachine(global_stack.getId())
|
||||
|
||||
# Notify everything/one that is to notify about changes.
|
||||
global_stack.containersChanged.emit(global_stack.getTop())
|
||||
|
||||
## HACK: Replaces the material container in the given stack with a newly created material container.
|
||||
# This function is used when the user chooses to resolve material conflicts by creating new ones.
|
||||
def _replaceStackMaterialWithNew(self, stack, old_new_material_dict):
|
||||
|
Loading…
x
Reference in New Issue
Block a user