mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Fix setting metadata on fdmmaterial containers
This commit is contained in:
parent
1f49a87acb
commit
a7cdf49018
1 changed files with 3 additions and 5 deletions
|
@ -56,16 +56,14 @@ class XmlMaterialProfile(InstanceContainer):
|
||||||
def setMetaDataEntry(self, key, value):
|
def setMetaDataEntry(self, key, value):
|
||||||
if self.isReadOnly():
|
if self.isReadOnly():
|
||||||
return
|
return
|
||||||
if self.getMetaDataEntry(key, None) == value:
|
|
||||||
# Prevent recursion caused by for loop.
|
|
||||||
return
|
|
||||||
|
|
||||||
super().setMetaDataEntry(key, value)
|
super().setMetaDataEntry(key, value)
|
||||||
|
|
||||||
basefile = self.getMetaDataEntry("base_file", self._id) #if basefile is self.id, this is a basefile.
|
basefile = self.getMetaDataEntry("base_file", self._id) #if basefile is self.id, this is a basefile.
|
||||||
# Update all containers that share GUID and basefile
|
# Update all containers that share basefile
|
||||||
for container in ContainerRegistry.getInstance().findInstanceContainers(base_file = basefile):
|
for container in ContainerRegistry.getInstance().findInstanceContainers(base_file = basefile):
|
||||||
container.setMetaDataEntry(key, value)
|
if container.getMetaDataEntry(key, None) != value: # Prevent recursion
|
||||||
|
container.setMetaDataEntry(key, value)
|
||||||
|
|
||||||
## Overridden from InstanceContainer, similar to setMetaDataEntry.
|
## Overridden from InstanceContainer, similar to setMetaDataEntry.
|
||||||
# without this function the setName would only set the name of the specific nozzle / material / machine combination container
|
# without this function the setName would only set the name of the specific nozzle / material / machine combination container
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue