chiark / gitweb /
Merge tag '15.01-RC8' into upstream
[cura.git] / Cura / util / gcodeInterpreter.py
index 6556f360303abb8febe52a04676e06acf7274cc3..bf711668ce41d2fd920b8c19d7f872e83571ec48 100644 (file)
@@ -123,16 +123,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
@@ -289,6 +280,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)