Skip to content

Conversation

@wyl2003
Copy link

@wyl2003 wyl2003 commented Dec 2, 2025

Problem

Post-processing scripts were executed correctly when exporting gcode files after slicing, but were not executed when sending gcode directly to the printer.

Root Cause

In BackgroundSlicingProcess.cpp, the finalize_gcode() function calls run_post_process_scripts() to execute post-processing scripts when exporting G-code. However, in SendToPrinter.cpp, the handle_send_gcode() function directly used the temporary G-code file path to send to the printer, bypassing the post-processing step entirely.

Solution

  • Added libslic3r/GCode/PostProcessor.hpp header include in SendToPrinter.cpp
  • Added run_post_process_scripts() call in handle_send_gcode() function after obtaining the gcode file path and before uploading
  • Post-processing is only executed in non-gcode-only mode (consistent with export logic)
  • Added exception handling to ensure post-processing failures don't block the send workflow

Files Changed

  • src/slic3r/GUI/print_manage/App/SendToPrinter.cpp

This should fix issue #449.

Added post-processing script execution before sending G-code to the printer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant