mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06: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
1 changed files with 5 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue