Re: How to port a postprocessor to new cura
Posted: May 25th, 2016, 7:04 pm
![Smile :-)](./images/smilies/icon_e_smile.gif)
At home, it seems to work too without issues, just the usual error80
b.t.w.: I like your modded print platform background
![Smile :-)](./images/smilies/icon_e_smile.gif)
A place for people to learn 3D Printing!
http://3dprintingforum.us/
drayson wrote:b.t.w.: I like your modded print platform background
Is there a commit tag which correspond to the 2.1.1 release, and if yes where?nallath wrote:Reporting it is always a good idea. If you have issues, report them on github. I'm the only Cura dev that reads this forum (and i'm very prone to forget things)
Code: Select all
$ diff -u Cura-2.1.0.app/Contents/Resources/cura/plugins/PostProcessingPlugin/scripts/TweakAtZ.py Cura.app/Contents/Resources/cura/plugins/PostProcessingPlugin/scripts/TweakAtZ.py
--- Cura-2.1.0.app/Contents/Resources/cura/plugins/PostProcessingPlugin/scripts/TweakAtZ.py 2016-04-13 01:35:12.000000000 +0200
+++ Cura.app/Contents/Resources/cura/plugins/PostProcessingPlugin/scripts/TweakAtZ.py 2016-05-19 15:47:08.000000000 +0200
@@ -28,6 +28,7 @@
##V4.9.92: Modifications for Cura 15.10
##V4.9.93: Minor bugfixes (input settings) / documentation
##V4.9.94: Bugfix Combobox-selection; remove logger
+##V5.0: Bugfix for fall back after one layer and doubled G0 commands when using print speed tweak, Initial version for Cura 2.x
## Uses -
## M220 S<factor in percent> - set speed factor override percentage
@@ -43,7 +44,7 @@
import re
class TweakAtZ(Script):
- version = "4.9.94"
+ version = "5.0"
def __init__(self):
super().__init__()
@@ -386,7 +387,7 @@
if ";Generated with Cura_SteamEngine" in line:
TWinstances += 1
modified_gcode += ";TweakAtZ instances: %d\n" % TWinstances
- if not ("M84" in line or "M25" in line or ("G1" in line and TweakPrintSpeed and state==3) or
+ if not ("M84" in line or "M25" in line or ("G1" in line and TweakPrintSpeed and (state==3 or state==4)) or
";TweakAtZ instances:" in line):
modified_gcode += line + "\n"
IsUM2 = ("FLAVOR:UltiGCode" in line) or IsUM2 #Flavor is UltiGCode!
@@ -441,9 +442,9 @@
y = self.getValue(line, "Y", None)
e = self.getValue(line, "E", None)
f = self.getValue(line, "F", None)
- if TweakPrintSpeed and state==3:
+ if 'G1' in line and TweakPrintSpeed and (state==3 or state==4):
# check for pure print movement in target range:
- if "G1" in line and x != None and y != None and f != None and e != None and newZ==z:
+ if x != None and y != None and f != None and e != None and newZ==z:
modified_gcode += "G1 F%d X%1.3f Y%1.3f E%1.5f\n" % (int(f/100.0*float(printspeed)),self.getValue(line,"X"),
self.getValue(line,"Y"),self.getValue(line,"E"))
else: #G1 command but not a print movement
@@ -508,4 +509,4 @@
modified_gcode += TweakStrings[key] % float(old[key])
data[index] = modified_gcode
index += 1
- return data
\ No newline at end of file
+ return data