diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index 72884ce5a5..ec9b050cdd 100644 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -227,6 +227,16 @@ class CuraEngineBackend(Backend): if job.isCancelled() or job.getError() or job.getResult() == StartSliceJob.StartJobResult.Error: return + if job.getResult() == StartSliceJob.StartJobResult.MaterialIncompatible: + if Application.getInstance().getPlatformActivity: + self._error_message = Message(catalog.i18nc("@info:status", + "The selected material is imcompatible with the selected machine or configuration.")) + self._error_message.show() + self.backendStateChange.emit(BackendState.Error) + else: + self.backendStateChange.emit(BackendState.NotStarted) + return + if job.getResult() == StartSliceJob.StartJobResult.SettingError: if Application.getInstance().getPlatformActivity: self._error_message = Message(catalog.i18nc("@info:status", "Unable to slice with the current settings. Please check your settings for errors.")) diff --git a/plugins/CuraEngineBackend/StartSliceJob.py b/plugins/CuraEngineBackend/StartSliceJob.py index efc36e6150..d737e684ad 100644 --- a/plugins/CuraEngineBackend/StartSliceJob.py +++ b/plugins/CuraEngineBackend/StartSliceJob.py @@ -24,6 +24,7 @@ class StartJobResult(IntEnum): Error = 2 SettingError = 3 NothingToSlice = 4 + MaterialIncompatible = 5 ## Formatter class that handles token expansion in start/end gcod @@ -86,7 +87,7 @@ class StartSliceJob(Job): material = extruder_stack.findContainer({"type": "material"}) if material: if material.getMetaDataEntry("compatible") == False: - self.setResult(StartJobResult.SettingError) + self.setResult(StartJobResult.MaterialIncompatible) return # Don't slice if there is a per object setting with an error value.