mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Do not load material when no GUID is present instead of crashing Cura
This commit is contained in:
parent
e9d2623237
commit
c13b77d8a1
2 changed files with 7 additions and 4 deletions
|
@ -76,7 +76,9 @@ class MaterialManager(QObject):
|
|||
|
||||
def initialize(self):
|
||||
# Find all materials and put them in a matrix for quick search.
|
||||
material_metadatas = {metadata["id"]: metadata for metadata in self._container_registry.findContainersMetadata(type = "material")}
|
||||
material_metadatas = {metadata["id"]: metadata for metadata in
|
||||
self._container_registry.findContainersMetadata(type = "material") if
|
||||
metadata.get("GUID")}
|
||||
|
||||
self._material_group_map = dict()
|
||||
|
||||
|
@ -93,7 +95,7 @@ class MaterialManager(QObject):
|
|||
self._material_group_map[root_material_id].is_read_only = self._container_registry.isReadOnly(root_material_id)
|
||||
group = self._material_group_map[root_material_id]
|
||||
|
||||
#Store this material in the group of the appropriate root material.
|
||||
# Store this material in the group of the appropriate root material.
|
||||
if material_id != root_material_id:
|
||||
new_node = MaterialNode(material_metadata)
|
||||
group.derived_material_node_list.append(new_node)
|
||||
|
|
|
@ -540,7 +540,8 @@ class XmlMaterialProfile(InstanceContainer):
|
|||
|
||||
validation_message = XmlMaterialValidator.validateMaterialMetaData(meta_data)
|
||||
if validation_message is not None:
|
||||
raise Exception("Not valid material profile: %s" % (validation_message))
|
||||
return
|
||||
# raise Exception("Not valid material profile: %s" % (validation_message))
|
||||
|
||||
property_values = {}
|
||||
properties = data.iterfind("./um:properties/*", self.__namespaces)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue