Skip to content

Add native Bambu Studio .3mf export with layer color swaps - #67

Merged
hvoss-tech merged 11 commits into
hvoss-tech:mainfrom
rbd3453:feature/bambu-3mf-export
Nov 16, 2026
Merged

hvoss-tech merged 11 commits into
hvoss-tech:mainfrom
rbd3453:feature/bambu-3mf-export

Conversation

@rbd3453

@rbd3453 rbd3453 commented Nov 13, 2026

Copy link
Copy Markdown
Contributor
  • Implement autoforge.helpers.export_3mf for native Bambu Studio / OrcaSlicer OPC archive packaging
  • Parse swap_instructions.txt to sequence layer tool changes with exact top_z boundaries
  • Auto-center models on build plate with z=0 flush alignment
  • Configure dual-variant H3C filament profiles and 100% zig-zag infill to prevent profile reset warnings
  • Add one-click .3mf download in WebUI FileMenu and bundle into project export ZIP
filemenu openproject

- Implement autoforge.helpers.export_3mf for native Bambu Studio / OrcaSlicer OPC archive packaging
- Parse swap_instructions.txt to sequence layer tool changes with exact top_z boundaries
- Auto-center models on build plate with z=0 flush alignment
- Configure dual-variant H3C filament profiles and 100% zig-zag infill to prevent profile reset warnings
- Add one-click .3mf download in WebUI FileMenu and bundle into project export ZIP
@rbd3453
rbd3453 marked this pull request as ready for review November 13, 2026 17:54
The 3mf export was hardwired to a single Bambu printer. It now builds the
project from OrcaSlicer's own printer, process and filament presets.

- Bundle a small index of Orca's printers (1167 of them), not the profiles
- Fetch a printer's profile files from Orca's GitHub on first use and cache them
- Swaps come from the solution/sliders instead of parsing the instructions text
- Printers without AMS/MMU/tool changer pause with their own pause G-code
- Add a flush matrix and keep the wipe tower spot on the bed, or Orca won't slice
- Faster STL reading with numpy
- No automatic 3mf at the end of every run; --orca_printer for the CLI
- File > Slicer project opens a dialog: search or brand/printer/nozzle
- Choose between the printer's own filament changes and pausing for a hand swap
- The choice is saved in the project, so the export zip includes the 3mf too
- Send the resolved base filament with the zip and 3mf requests
- Export runs as a background task with progress, cancel and a one-time download
- Load a printer's profiles ahead of time, downloads in parallel
- Read the STL while the printer settings load
- Faster vertex merging, mesh cache for re-exports, zip level 1
- Ask for the printer only the first time, then export in one click
- Progress card with stage, percentage, cancel and retry
- Picker: search with keyboard, popular printers, 0.4 mm nozzle first
- Printer section in the settings; reset keeps the printer
- Fetch the printer's profiles while it is being picked
- Use the printer's preset for the nozzle the result was made with
- Warn when the printer has no preset for that nozzle (dialog, export card, zip, CLI)
- Picker offers the preset closest to the configured nozzle first
- Prefetch the preset the export will actually use
- Picking a printer no longer marks the result as outdated
- Optional AutoForge print settings (on by default), from published colour-layer presets
- Write every option with Orca's defaults; a missing one came from another printer
- Leave different_settings_to_system empty so Orca uses the project as written
- Clamp values to Orca's ranges and fix profile contradictions it refuses
- Convert legacy wall_infill_order and hybrid supports like Orca does on load
- Split a base thicker than a small nozzle into whole layers
- Use the native rectilinear name, drop pellet and 2 mm+ nozzle printers
- Every one of the 1162 printers slices in OrcaSlicer 2.5, with and without the settings
- Checkbox in the printer dialog with a list of what it changes
- Remembered with the printer, shown in the settings, kept on reset
- Hand swaps are pause entries in the 3mf instead of change-filament G-code
- OrcaSlicer skips that G-code on the first tool change, which on Bambu was the first swap
- Raise the printer's max layer height when AutoForge's layers are thicker
- Integration test checks layer and base heights in the G-code, incl. Bambu hand swaps
- tests/test_orca_printer_sweep.py: one test per printer and mode, off unless AUTOFORGE_ORCA_SWEEP is set
- Slices in parallel, then retries failures one at a time
- Shared slicing and G-code checks in tests/orca_slicing.py, unit-tested
- List every option as changed, so Orca doesn't load the printer's stock profile
- Rename the print settings option to AutoForge print settings
@hvoss-tech hvoss-tech self-assigned this Nov 16, 2026
@hvoss-tech
hvoss-tech merged commit c95c7ea into hvoss-tech:main Nov 16, 2026
@hvoss-tech

Copy link
Copy Markdown
Owner

Thanks for the PR.

I expanded it a bit, as your PR only focused the H3C printer. Now users can simply select the printer from a list they want and the 3mf is created for exactly that printer. I also added recommended settings for the 3mf from some online guides.

@rbd3453

rbd3453 commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

Very cool, thank you for everything on this project!

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.

2 participants