-
Notifications
You must be signed in to change notification settings - Fork 31
creating to post-processing script #31
Comments
I think a good place to start is to copy one of the scripts that is already in that scripts folder. You adding lines should normally not stop Cura from recognising it, unless you made a Python syntax error. Be aware that we use spaces for indenting in all of the pre-made scripts (you can use your preferred way of indenting, but if you mix indenting styles in one file you're asking for trouble). Alternatively, you might want to check out if you can use the |
You did give it a unique |
If you can make it sort-of generic, I think it'd be nice to merge it once you've got it working. Like, if you can make it apply a shear, or some other useful or aesthetic modification. The PostProcessing structure was specifically designed to allow for as many community contributions as possible. |
Doesn't look like anything is wrong with that. To help with debugging, take a look at the logs of Cura, found in |
Hey guys, I am able to show my own script in Cura but still having problem making changes and making them loaded. Here is an example: I stripped out most of the codes from one of the existing scripts and made these 2. One loads fine (xycorrect-cleaned up.py) and one doesn't (xycorrect.py). And the difference is only one character (y=0. instead of x=0.) I have some programming experience but not in python. Could you put to a reference where I can learn simply syntax for Python that would work in this context. |
The file you provided mixes tabs and spaces for indenting. In Python, indentation matters, and tabs are counted as having a width of one character. That's why your script doesn't work. In your "cleaned up" version, you use spaces everywhere to indent. |
Thanks. That took care of that. Notepad++ use tab instead of space and I just needed to change a setting. Please help me understand the data structure. I use PauseAtHeight.py as reference. in the code, the data refers to the silced gcode from Cura. It is broken down into layers, and then in each layer, there are individual lines of gcodes. If I want to, say change every gcode line that starts with G0 or G1 into G0 X35 Y35, here is a code I created using codes from PauseAtHeight
-- |
To update the
|
Hi team,
I am looking to create a post processing script that will examine gcode and make some modification to the g0 / g1 x/y values for my DIY printer. I am not quite sure where to start. I tried to edit script directly in C:\Program Files\Cura 2.3\plugins\PostProcessingPlugin\scripts . It would work if I just change a value but if I add additional lines of codes Cura would not recognize the script t all.
Is there are way to create own script and added to cura? Thanks.
The text was updated successfully, but these errors were encountered: