How to port a postprocessor to new cura

Discussion of Ultimaker's open-source Cura software
User avatar
drayson
Reactions:
Posts: 254
Joined: February 15th, 2016, 5:04 am
Location: Graz, Austria
3D Printer(s): UMO with mods :-)

Re: How to port a postprocessor to new cura

Post by drayson »

:-) Great, thanks for confirming that my company has a shitty system *lol*

At home, it seems to work too without issues, just the usual error80

b.t.w.: I like your modded print platform background :-)
User avatar
Amedee
Reactions:
Posts: 599
Joined: February 15th, 2016, 11:10 am
Location: Brussels, Belgium
3D Printer(s): UMO / UMO+
Contact:

Re: How to port a postprocessor to new cura

Post by Amedee »

drayson wrote:b.t.w.: I like your modded print platform background :-)
:-P Yeah, I did that while experimenting the inheritance in the machine definitions ;)
User avatar
Amedee
Reactions:
Posts: 599
Joined: February 15th, 2016, 11:10 am
Location: Brussels, Belgium
3D Printer(s): UMO / UMO+
Contact:

Re: How to port a postprocessor to new cura

Post by Amedee »

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)
Is there a commit tag which correspond to the 2.1.1 release, and if yes where?

I am a bit lost in the sources...
I wanted to make a pull request for TWeakAtZ, but I can't find the version which is in 2.1.1 (5.0)

https://github.com/Ultimaker/Cura refers to https://github.com/nallath/PostProcessingPlugin, but latest version there for the script is 4.9.94...
nallath
Reactions:
Posts: 267
Joined: February 16th, 2016, 3:12 am
3D Printer(s): Ultimaker

Re: How to port a postprocessor to new cura

Post by nallath »

https://github.com/nallath/PostProcessi ... n/tree/2.1 <- This is the linked branch for the 2.1 release.
User avatar
Amedee
Reactions:
Posts: 599
Joined: February 15th, 2016, 11:10 am
Location: Brussels, Belgium
3D Printer(s): UMO / UMO+
Contact:

Re: How to port a postprocessor to new cura

Post by Amedee »

But in that one, TweakAtZ.py is "4.9.94", and in the one I got with Cura 2.1.1 it is "5.0"!

Diff between 2.1 and 2.1.1 on my system:

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
So there is a more recent version 'somewhere'...
User avatar
Amedee
Reactions:
Posts: 599
Joined: February 15th, 2016, 11:10 am
Location: Brussels, Belgium
3D Printer(s): UMO / UMO+
Contact:

Re: How to port a postprocessor to new cura

Post by Amedee »

I eventually found it there --> https://github.com/Dim3nsioneer/Cura-Plugins

Not sure how you manage your releases, but you should probably remove that script from your repo and point at it as a contrib script.

(And there is 5.0.1 which fixes my issues...)
nallath
Reactions:
Posts: 267
Joined: February 16th, 2016, 3:12 am
3D Printer(s): Ultimaker

Re: How to port a postprocessor to new cura

Post by nallath »

Yeah that's probably a better idea. Not sure if our script right now handles that correctly, but we should look into it.
Post Reply

Return to “Cura”