From fc7f225e3a97144d5d6dfd834172de56893ea8e9 Mon Sep 17 00:00:00 2001 From: daid303 Date: Thu, 14 Mar 2013 11:55:53 +0100 Subject: [PATCH] Better display dual-extrusion paths. --- Cura/gui/util/opengl.py | 4 ++-- Cura/util/gcodeInterpreter.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Cura/gui/util/opengl.py b/Cura/gui/util/opengl.py index 8d3f727c..dc7deb67 100644 --- a/Cura/gui/util/opengl.py +++ b/Cura/gui/util/opengl.py @@ -430,7 +430,7 @@ def DrawGCodeLayer(layer, drawQuick = True): moveColor = [0, 0, 1, 0.5] retractColor = [1, 0, 0.5, 0.5] supportColor = [0, 1, 1, 1] - extrudeColor = [1, 0, 0, 1] + extrudeColor = [[1, 0, 0, 1], [0, 1, 1, 1], [1, 1, 0, 1], [1, 0, 1, 1]] innerWallColor = [0, 1, 0, 1] skirtColor = [0, 0.5, 0.5, 1] prevPathWasRetract = False @@ -459,7 +459,7 @@ def DrawGCodeLayer(layer, drawQuick = True): elif path.pathType == 'SKIRT': c = skirtColor else: - c = extrudeColor + c = extrudeColor[path.extruder] if path.type == 'retract': c = retractColor if path.type == 'extrude' and not drawQuick: diff --git a/Cura/util/gcodeInterpreter.py b/Cura/util/gcodeInterpreter.py index 63346867..19b68ace 100644 --- a/Cura/util/gcodeInterpreter.py +++ b/Cura/util/gcodeInterpreter.py @@ -67,6 +67,7 @@ class gcode(object): pathType = 'CUSTOM'; currentLayer = [] currentPath = gcodePath('move', pathType, layerThickness, pos.copy()) + currentPath.extruder = currentExtruder currentPath.list[0].e = totalExtrusion currentPath.list[0].extrudeAmountMultiply = extrudeAmountMultiply currentLayer.append(currentPath) @@ -158,6 +159,7 @@ class gcode(object): layerThickness = abs(oldPos.z - pos.z) if currentPath.type != moveType or currentPath.pathType != pathType: currentPath = gcodePath(moveType, pathType, layerThickness, currentPath.list[-1]) + currentPath.extruder = currentExtruder currentLayer.append(currentPath) newPos = pos.copy() newPos.e = totalExtrusion -- 2.30.2