mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 02:16:01 +08:00
Don't sync invisible materials
CURA-10953
This commit is contained in:
parent
1a41f2650a
commit
fd887a877a
@ -148,6 +148,9 @@ class CloudMaterialSync(QObject):
|
|||||||
continue
|
continue
|
||||||
if metadata["id"] == "empty_material": # Don't export the empty material.
|
if metadata["id"] == "empty_material": # Don't export the empty material.
|
||||||
continue
|
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]
|
material = registry.findContainers(id = metadata["id"])[0]
|
||||||
suffix = registry.getMimeTypeForContainer(type(material)).preferredSuffix
|
suffix = registry.getMimeTypeForContainer(type(material)).preferredSuffix
|
||||||
filename = metadata["id"] + "." + suffix
|
filename = metadata["id"] + "." + suffix
|
||||||
|
@ -173,7 +173,7 @@ class SendMaterialJob(Job):
|
|||||||
|
|
||||||
result = {} # type: Dict[str, LocalMaterial]
|
result = {} # type: Dict[str, LocalMaterial]
|
||||||
all_materials = CuraApplication.getInstance().getContainerRegistry().findInstanceContainersMetadata(type = "material")
|
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.
|
# Find the latest version of all material containers in the registry.
|
||||||
for material_metadata in all_base_files:
|
for material_metadata in all_base_files:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user