wrap_gcode_as_3mf
Convert PrusaSlicer G-code into a Bambu-compatible 3MF file by adding required start/end sequences, enabling Bambu Lab printers to accept and print the file.
Instructions
Wrap raw PrusaSlicer G-code in a Bambu-compatible 3MF (Bambu Lab only).
Bambu printers require the proprietary BambuStudio start/end sequences
(motor enable, AMS load, extrusion calibration) to function correctly.
This tool takes PrusaSlicer G-code output and packages it into a 3MF
that the printer will accept.
Args:
gcode_path: Absolute path to a PrusaSlicer ``.gcode`` file on the
local filesystem. The file must have been sliced with
``--use-relative-e-distances`` and empty start/end G-code.
hotend_temp: Hotend temperature in °C (default 220 for PLA).
bed_temp: Bed temperature in °C (default 65 for PLA).
filament_type: Filament type string — ``"PLA"``, ``"PETG"``,
``"ABS"``, etc.
source_3mf_path: Optional path to a source 3MF to copy
thumbnails and geometry from.
num_filaments: Number of filaments (>1 for multi-color prints).
filament_colors: List of hex color strings per filament
(e.g. ``["#898989FF", "#161616FF"]``).
filament_types: List of filament type strings per filament
(e.g. ``["PLA", "PLA"]``).
thumbnail_path: Optional path to a PNG image to embed as the
3MF thumbnail (shown on the printer's display).
stl_path: Optional path to the source STL file. When provided,
a thumbnail is auto-generated from the model geometry via
OpenSCAD (512x512, shown on the Bambu printer screen).
Returns a dict with ``output_path`` pointing to the generated 3MF.
Use ``upload_file()`` to send it to the printer, then ``start_print()``
to begin printing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bed_temp | No | ||
| stl_path | No | ||
| gcode_path | Yes | ||
| hotend_temp | No | ||
| resume_mode | No | ||
| filament_type | No | PLA | |
| num_filaments | No | ||
| filament_types | No | ||
| thumbnail_path | No | ||
| filament_colors | No | ||
| source_3mf_path | No |