From 3a46a337ff39e1138ecbf31581b81667304f9aaf Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 15 Aug 2017 14:15:38 +0200 Subject: [PATCH] In SliceInfo, use the global stack if it is a single-extrusion machine CURA-4167 Single extrusion machines don't have extruder stacks in the current architecture. --- plugins/3MFWriter/ThreeMFWorkspaceWriter.py | 2 -- plugins/SliceInfoPlugin/SliceInfo.py | 7 +++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/3MFWriter/ThreeMFWorkspaceWriter.py b/plugins/3MFWriter/ThreeMFWorkspaceWriter.py index f805936ab5..0a915d610e 100644 --- a/plugins/3MFWriter/ThreeMFWorkspaceWriter.py +++ b/plugins/3MFWriter/ThreeMFWorkspaceWriter.py @@ -2,11 +2,9 @@ from UM.Workspace.WorkspaceWriter import WorkspaceWriter from UM.Application import Application from UM.Preferences import Preferences from UM.Settings.ContainerRegistry import ContainerRegistry -from UM.Settings.ContainerStack import ContainerStack from cura.Settings.ExtruderManager import ExtruderManager import zipfile from io import StringIO -import copy import configparser diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py index 0af9c85607..57df84ffc4 100755 --- a/plugins/SliceInfoPlugin/SliceInfo.py +++ b/plugins/SliceInfoPlugin/SliceInfo.py @@ -76,8 +76,11 @@ class SliceInfo(Extension): data["active_machine"] = {"definition_id": global_container_stack.definition.getId(), "manufacturer": global_container_stack.definition.getMetaData().get("manufacturer","")} data["extruders"] = [] - extruders = list(ExtruderManager.getInstance().getMachineExtruders(global_container_stack.getId())) - extruders = sorted(extruders, key = lambda extruder: extruder.getMetaDataEntry("position")) + extruder_count = len(global_container_stack.extruders) + extruders = [] + if extruder_count > 1: + extruders = list(ExtruderManager.getInstance().getMachineExtruders(global_container_stack.getId())) + extruders = sorted(extruders, key = lambda extruder: extruder.getMetaDataEntry("position")) if not extruders: extruders = [global_container_stack]