mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-21 12:09:13 +08:00
Add check for empty material instance containers before trying to fetch material metadata. This fixes failing to save a project on a printer with no materials (UM2 for example).
CURA-9412
This commit is contained in:
parent
1142768d59
commit
dd3abf7ff0
@ -12,6 +12,7 @@ from UM.Application import Application
|
||||
from UM.Message import Message
|
||||
from UM.Resources import Resources
|
||||
from UM.Scene.SceneNode import SceneNode
|
||||
from UM.Settings.EmptyInstanceContainer import EmptyInstanceContainer
|
||||
|
||||
from cura.CuraApplication import CuraApplication
|
||||
from cura.CuraPackageManager import CuraPackageManager
|
||||
@ -268,6 +269,10 @@ class ThreeMFWriter(MeshWriter):
|
||||
# Don't export materials not in use
|
||||
continue
|
||||
|
||||
if type(extruder.material) is EmptyInstanceContainer:
|
||||
# This is an empty material container, no material to export
|
||||
continue
|
||||
|
||||
if package_manager.isMaterialBundled(extruder.material.getFileName(), extruder.material.getMetaDataEntry("GUID")):
|
||||
# Don't export bundled materials
|
||||
continue
|
||||
|
Loading…
x
Reference in New Issue
Block a user