mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-06-26 01:15:28 -06:00
Don't sync invisible materials
CURA-10953
This commit is contained in:
parent
1a41f2650a
commit
fd887a877a
2 changed files with 4 additions and 1 deletions
|
@ -148,6 +148,9 @@ class CloudMaterialSync(QObject):
|
|||
continue
|
||||
if metadata["id"] == "empty_material": # Don't export the empty material.
|
||||
continue
|
||||
# Ignore materials that are marked as not visible for whatever reason
|
||||
if not bool(metadata.get("visible", True)):
|
||||
continue
|
||||
material = registry.findContainers(id = metadata["id"])[0]
|
||||
suffix = registry.getMimeTypeForContainer(type(material)).preferredSuffix
|
||||
filename = metadata["id"] + "." + suffix
|
||||
|
|
|
@ -173,7 +173,7 @@ class SendMaterialJob(Job):
|
|||
|
||||
result = {} # type: Dict[str, LocalMaterial]
|
||||
all_materials = CuraApplication.getInstance().getContainerRegistry().findInstanceContainersMetadata(type = "material")
|
||||
all_base_files = [material for material in all_materials if material["id"] == material.get("base_file")] # Don't send materials without base_file: The empty material doesn't need to be sent.
|
||||
all_base_files = [material for material in all_materials if material["id"] == material.get("base_file") and material.get("visible", True)] # Don't send materials without base_file: The empty material doesn't need to be sent.
|
||||
|
||||
# Find the latest version of all material containers in the registry.
|
||||
for material_metadata in all_base_files:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue