mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 06:29:02 +08:00
Merge branch '3.0' of https://github.com/Ultimaker/Cura into 3.0
This commit is contained in:
commit
15d945a207
@ -29,7 +29,8 @@ class CuraStackBuilder:
|
||||
return None
|
||||
|
||||
machine_definition = definitions[0]
|
||||
generated_name = registry.createUniqueName("machine", "", machine_definition.name, machine_definition.name)
|
||||
|
||||
generated_name = registry.createUniqueName("machine", "", name, machine_definition.name)
|
||||
# Make sure the new name does not collide with any definition or (quality) profile
|
||||
# createUniqueName() only looks at other stacks, but not at definitions or quality profiles
|
||||
# Note that we don't go for uniqueName() immediately because that function matches with ignore_case set to true
|
||||
@ -44,13 +45,7 @@ class CuraStackBuilder:
|
||||
variant = "default",
|
||||
)
|
||||
|
||||
# after creating a global stack can be set custom defined name
|
||||
if name != generated_name:
|
||||
name = registry.createUniqueName("machine", "", name, machine_definition.name)
|
||||
if registry.findContainers(id = name):
|
||||
name = registry.uniqueName(name)
|
||||
|
||||
new_global_stack.setName(name)
|
||||
new_global_stack.setName(generated_name)
|
||||
|
||||
for extruder_definition in registry.findDefinitionContainers(machine = machine_definition.id):
|
||||
position = extruder_definition.getMetaDataEntry("position", None)
|
||||
|
@ -600,7 +600,9 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||
if self._resolve_strategies["machine"] == "new":
|
||||
# The machine is going to get a spiffy new name, so ensure that the id's of user settings match.
|
||||
old_extruder_id = instance_container.getMetaDataEntry("extruder", None)
|
||||
if old_extruder_id:
|
||||
# Note that in case of a quality_changes extruder means the definition id of the extruder stack
|
||||
# For the user settings, it means the actual extruder stack id it's assigned to.
|
||||
if old_extruder_id and old_extruder_id in extruder_stack_id_map:
|
||||
new_extruder_id = extruder_stack_id_map[old_extruder_id]
|
||||
instance_container.setMetaDataEntry("extruder", new_extruder_id)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user