From: daid Date: Sat, 10 Jan 2015 09:02:10 +0000 (+0100) Subject: Fixed #1078 X-Git-Tag: 15.01-RC8~10 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=2f728760e10d468ab1a997204ffd2659b923617b;p=cura.git Fixed #1078 --- diff --git a/Cura/util/gcodeInterpreter.py b/Cura/util/gcodeInterpreter.py index 95b42d75..1c8532c9 100644 --- a/Cura/util/gcodeInterpreter.py +++ b/Cura/util/gcodeInterpreter.py @@ -124,16 +124,7 @@ class gcode(object): return currentLayer = [currentPath] line = line[0:line.find(';')] - T = getCodeInt(line, 'T') - if T is not None: - if currentExtruder > 0: - posOffset[0] -= profile.getMachineSettingFloat('extruder_offset_x%d' % (currentExtruder)) - posOffset[1] -= profile.getMachineSettingFloat('extruder_offset_y%d' % (currentExtruder)) - currentExtruder = T - if currentExtruder > 0: - posOffset[0] += profile.getMachineSettingFloat('extruder_offset_x%d' % (currentExtruder)) - posOffset[1] += profile.getMachineSettingFloat('extruder_offset_y%d' % (currentExtruder)) - + G = getCodeInt(line, 'G') if G is not None: if G == 0 or G == 1: #Move @@ -282,6 +273,17 @@ class gcode(object): extrudeAmountMultiply = s / 100.0 else: print "Unknown M code:" + str(M) + else: + T = getCodeInt(line, 'T') + if T is not None: + if currentExtruder > 0: + posOffset[0] -= profile.getMachineSettingFloat('extruder_offset_x%d' % (currentExtruder)) + posOffset[1] -= profile.getMachineSettingFloat('extruder_offset_y%d' % (currentExtruder)) + currentExtruder = T + if currentExtruder > 0: + posOffset[0] += profile.getMachineSettingFloat('extruder_offset_x%d' % (currentExtruder)) + posOffset[1] += profile.getMachineSettingFloat('extruder_offset_y%d' % (currentExtruder)) + for path in currentLayer: path['points'] = numpy.array(path['points'], numpy.float32) path['extrusion'] = numpy.array(path['extrusion'], numpy.float32)