Skip to content

Commit

Permalink
Don't sync invisible materials
Browse files Browse the repository at this point in the history
CURA-10953
  • Loading branch information
nallath committed Sep 7, 2023
1 parent 1a41f26 commit fd887a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cura/UltimakerCloud/CloudMaterialSync.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ def exportAll(self, file_path: QUrl, notify_progress: Optional["Signal"] = None)
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
Expand Down
2 changes: 1 addition & 1 deletion plugins/UM3NetworkPrinting/src/Network/SendMaterialJob.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def _getLocalMaterials() -> Dict[str, LocalMaterial]:

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:
Expand Down

0 comments on commit fd887a8

Please sign in to comment.