Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGhostkeeper <rubend@tutanota.com>2019-09-13 15:40:43 +0300
committerGhostkeeper <rubend@tutanota.com>2019-09-13 15:42:27 +0300
commitbb0c9c80dc2b8090864ebd4888730c86b77dffe0 (patch)
tree97d1f85bce94ad363b138df705a07c81ea5c4d01 /plugins/UFPWriter
parent882e60bf95a856f5103757ba72cb154e5a6b3aef (diff)
Don't use material groups to find just the root container
Just look it up in the container registry. If you know the ID, this look-up is just a dictionary look-up as well. Contributes to issue CURA-6600.
Diffstat (limited to 'plugins/UFPWriter')
-rw-r--r--plugins/UFPWriter/UFPWriter.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/UFPWriter/UFPWriter.py b/plugins/UFPWriter/UFPWriter.py
index 0dbc069408..d698cbfab7 100644
--- a/plugins/UFPWriter/UFPWriter.py
+++ b/plugins/UFPWriter/UFPWriter.py
@@ -81,7 +81,7 @@ class UFPWriter(MeshWriter):
# Store the material.
application = CuraApplication.getInstance()
machine_manager = application.getMachineManager()
- material_manager = application.getMaterialManager()
+ container_registry = application.getContainerRegistry()
global_stack = machine_manager.activeMachine
material_extension = "xml.fdm_material"
@@ -107,12 +107,12 @@ class UFPWriter(MeshWriter):
continue
material_root_id = material.getMetaDataEntry("base_file")
- material_group = material_manager.getMaterialGroup(material_root_id)
- if material_group is None:
- Logger.log("e", "Cannot find material container with root id [%s]", material_root_id)
+ material_root_query = container_registry.findContainers(id = material_root_id)
+ if not material_root_query:
+ Logger.log("e", "Cannot find material container with root id {root_id}".format(root_id = material_root_id))
return False
+ material_container = material_root_query[0]
- material_container = material_group.root_material_node.container
try:
serialized_material = material_container.serialize()
except NotImplementedError: