Merge branch 'feature_intent_container_tree' of https://github.com/Ultimaker/Cura into feature_intent_container_tree

This commit is contained in:
Remco Burema 2019-08-27 17:57:25 +02:00
commit ec6903d34f
5 changed files with 109 additions and 10 deletions

View file

@ -302,7 +302,6 @@ class MaterialManager(QObject):
# Create a new ID & container to hold the data.
new_containers = []
container_registry = CuraContainerRegistry.getInstance()
if new_base_id is None:
new_base_id = container_registry.uniqueName(base_container.getId())
new_base_container = copy.deepcopy(base_container)
@ -338,9 +337,10 @@ class MaterialManager(QObject):
# if the duplicated material was favorite then the new material should also be added to favorite.
if root_material_id in self.getFavorites():
self.addFavorite(new_base_id)
cura.CuraApplication.CuraApplication.getInstance().getMaterialManagementModel().addFavorite(new_base_id)
return new_base_id
#
# Creates a duplicate of a material, which has the same GUID and base_file metadata.
# Returns the root material ID of the duplicated material if successful.