mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-14 02:07:51 -06:00
CURA-4606 CURA-5003 activate duplicated material and always switch to correct material after some material change
This commit is contained in:
parent
2df9802ba5
commit
c23827cfa1
2 changed files with 40 additions and 19 deletions
|
@ -458,7 +458,7 @@ class ContainerManager(QObject):
|
|||
## Create a duplicate of a material, which has the same GUID and base_file metadata
|
||||
#
|
||||
# \return \type{str} the id of the newly created container.
|
||||
@pyqtSlot("QVariant")
|
||||
@pyqtSlot("QVariant", result = str)
|
||||
def duplicateMaterial(self, material_node, new_base_id = None, new_metadata = None):
|
||||
root_material_id = material_node.metadata["base_file"]
|
||||
|
||||
|
@ -509,6 +509,7 @@ class ContainerManager(QObject):
|
|||
for container_to_add in new_containers:
|
||||
container_to_add.setDirty(True)
|
||||
ContainerRegistry.getInstance().addContainer(container_to_add)
|
||||
return new_base_id
|
||||
|
||||
## Create a new material by cloning Generic PLA for the current material diameter and setting the GUID to something unqiue
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue