From 72c7d2bd76c0ea0d6acfd50b519757ee6940f307 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 4 Dec 2017 11:04:28 +0100 Subject: [PATCH] Reconstruct ID for submaterials from unique base name When you make the ID of the subprofile unique it doesn't get linked to the base profile any more since the '#2' gets put at the end. Contributes to issue CURA-4243. --- cura/Settings/ContainerManager.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cura/Settings/ContainerManager.py b/cura/Settings/ContainerManager.py index 94a79c99110..c552a6fe8cd 100644 --- a/cura/Settings/ContainerManager.py +++ b/cura/Settings/ContainerManager.py @@ -785,7 +785,11 @@ def duplicateMaterial(self, material_id: str) -> str: for container_to_copy in containers_to_copy: #Create unique IDs for every clone. current_id = container_to_copy.getId() - new_id = self._container_registry.uniqueName(current_id) + new_id = new_base_id + 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") if current_id == material_id: clone_of_original = new_id