Add Skip G-code config block to exclude the config comments from G-code files#12455
Add Skip G-code config block to exclude the config comments from G-code files#12455Felixoid wants to merge 1 commit into
Skip G-code config block to exclude the config comments from G-code files#12455Conversation
|
Does it look OK to merge? |
|
Will this be merged ? |
|
Dear @SoftFever, could you take a look, please? |
|
Dear @Felix14-v2, could you review this PR too, please? It's a major regression for some Anycubic printers; see the linked issues |
|
I think you should ask developers directly in Discord. I'm just a regular user (and a translator and tester at the same time), so I don't have influence on the project. But I added this regression to the tracking issue. If you know any other confirmed regressions, please, mention them there as well. |
|
@robertbaker, not quite sure what you exactly mean. I don't have this printer. You suggest cherry-picking/rebasing my PR on top of yours? You can simply generate G-code from your branch, and then remove It will be the same result. Or, you can |
|
would be great to merge this, myself and other ppl are suffering from this issue, only fix, for me, is to go back to OrcaSlicer v2.3.1 Official Release |
|
In discord, I got feedback that this fix is undesirable. The workaround would be changing the format of the setting to the following: But I am not sure if it even works for the orca parser. My personal easy-fix is adding the following line to a
The problem solved, and probably it's a temporary fix until the |
I think that's not an option for Windows users |
|
For Win, it should be a dedicated PowerShell script @echo off
powershell -Command "(Get-Content '%1') | Where-Object { $_ -notmatch '^; filament_colour_type = ' } | Set-Content '%1'"The script should then be added to the Can you verify if it works? |
THIS is undesirable.... PLEASE keep this in mind before upgrading your printer... |
|
We need @SoftFever opinion here |
|
@Felixoid my comment was just a warning against hastily installing new firmware if you, as a power user, care about Rinkhals! You did a great job identifying the cause of the regression, among a multitude of commits. You really deserve a cold beer. |
|
I've already mentioned that in Discord, but it worth mentioning there as well that this is not the only printer which firmware has issues with parsing slicer metadata. PrusaSlicer has a build-in post-processing features (like replacing/removing all the desired strings) for cases like that, but implementing it would be harder than just adding an option to the printer profile settings to not write the metadata to gcode files. This would greatly improve compatibility with some end-of-life printers. The only disadvantage there is that this uncommon feature requires some space in the UI for yet another option. But I think that this can be easily solved by marking it as a developer-level option, especially since it is necessary only for profile makers. So it will be hidden by default and only visible after enabling developer mode. |
|
Implementing such a complex feature (post-processing) is beyond my current capabilities. I can probably try to add an option |
I could not get that powershell script to work, so I reworked it to python alternative and added to my postprocessing script |
c4a1a43 to
0db2ff4
Compare
Skip G-code config block to exclude the config comments from G-code files
|
I pushed another change. Under the |
Workaround for Windows users (OrcaSlicer 2.3.2)Root cause: OrcaSlicer 2.3.2 generates Why some files work: Files where Fix for Windows (OrcaSlicer post-processing script)
@echo off
set TMPFILE=%~1.tmp
findstr /v /c:"; filament_colour_type" "%~1" > "%TMPFILE%"
move /y "%TMPFILE%" "%~1"
In OrcaSlicer go to: Process → Others → Post-processing Scripts Add the full path to the .bat file
⚠️ Test from CMD (not PowerShell) when testing manually
|
|
I tested this PR recently, and skipping the config metadata completely fixed the problem with G28 triggering at the end of the print (Picaso firmware tries to execute all Gcode commands found in the config block). @Felixoid huge thanks for the solution! The only issue I found is that (in my opinion) the setting should be placed in the printer profile settings ( @SoftFever could you consider this PR as a compatibility improvement candidate for the 2.4.0 release? |
|
Sounds good,
I see, it's right there |
|
I'll replace screenshot after the binary is rebuilt locally |
f8cf31c to
bcf377f
Compare
|
Done, the PR is ready to review and merge |
Description
gklib crashes attempting to parse the following line:
; filament_colour_type = 1;1;1;1There's an upstream issue in ANYCUBIC-3D/Klipper-go#13, but without the fix, it's a major regression.
After discussion, skipping the entire
CONFIG_BLOCKseemed like a better approach to fix all parsers' issues with outdated printers globally.Screenshots/Recordings/Graphs
Tests
A simple test to check
CONFIG_BLOCK_STARTandCONFIG_BLOCK_ENDare absent when the option is enabled.Notes
Fix #12444 after #10780
Fix #12033
I narrowed down the issue to this particular line, completely crashing the G-code parser.