Skip to content

Commit

Permalink
Reconstruct ID for submaterials from unique base name
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Ghostkeeper committed Dec 4, 2017
1 parent bc28189 commit 72c7d2b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cura/Settings/ContainerManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 72c7d2b

Please sign in to comment.