Browse Source

Correct variant name when duplicating materials

It needs to be the variant name (swapping spaces for underscores) to be consistent with the deserialize functions.

Contributes to issue CURA-4243.
Ghostkeeper 7 years ago
parent
commit
80f4c9181d
1 changed files with 2 additions and 1 deletions
  1. 2 1
      cura/Settings/ContainerManager.py

+ 2 - 1
cura/Settings/ContainerManager.py

@@ -789,7 +789,8 @@ class ContainerManager(QObject):
             if container_to_copy.getMetaDataEntry("definition") != "fdmprinter":
                 new_id += "_" + container_to_copy.getMetaDataEntry("definition")
                 if container_to_copy.getMetaDataEntry("variant"):
-                    new_id += "_" + container_to_copy.getMetaDataEntry("variant")
+                    variant = self._container_registry.findContainers(id = container_to_copy.getMetaDataEntry("variant"))[0]
+                    new_id += "_" + variant.getName().replace(" ", "_")
             if current_id == material_id:
                 clone_of_original = new_id