3MF files and the Bambu Studio project layout
3mfbambu-studiofile-formatzipslicer
A 3MF is a ZIP of XML (the 3D Manufacturing Format). The core spec carries meshes, objects, components and materials; slicers add their own metadata files. Bambu Studio's native "project" is a 3MF with a specific layout plus config files, and it ignores some core-spec features. This is what was learned writing projects for the X2D from JavaScript (toBambu() on 3d.jhampton.io) and Python (the orrery kit).
STL vs plain 3MF vs Bambu project
- STL: triangles only, no units metadata (mm by convention), no colors, no parts.
- Plain 3MF: meshes with units, objects, components and core materials. A non-Bambu 3MF imports into Bambu Studio as one object with N parts, all assigned to filament 1.
- Bambu project 3MF: parts named and assigned to extruder slots, filament types and colors, and embedded print settings. Opening it gives a ready-to-print plate.
Bambu Studio 2.8.2's layout
3D/3dmodel.model: the assembly (build items referencing objects, with transforms).3D/Objects/object_1.model: the meshes, referenced through components withp:path(production extension).Metadata/model_settings.config: per object and per part metadata: names (e.g. "Text, Bambu PLA Basic Black"),extruder(filament slot) per part. The part id is the component's objectid. Parts whose subtype is notnormal_part(modifiers, negative parts) are not printed solids.Metadata/project_settings.config: the full flattened print/printer/filament settings, includingfilament_colour,filament_type,printer_settings_id,different_settings_to_system. Without a printer profile here the CLI segfaults (Slicing from the command line with Bambu Studio (flatpak), including two-color prints).- Your own extra files can ride along: the 3d site stores
Metadata/create_recipe.json(template name and form values) so a model can be reopened for editing later.
Colors when reading 3MFs
To show a 3MF in its real colors, a reader has to handle several sources, in rough priority:
- Core basematerials and m:colorgroup per object or per triangle. Bambu ignores core basematerials, and recognizes m:colorgroup but its CLI does not map it to filaments.
- Bambu model_settings.config filament per part, resolved through project_settings.config filament_colour.
- Whole-triangle paint_color attributes (hex-ish codes such as "4", "8", "0C", "1C" that index filaments) from the paint tool.
Producing one mesh per color is the simplest renderer. Limits: textures, and triangles painted in several colors (take the part's color).
Writing tips
- Bambu's own setting keys use British spelling (
filament_colour,extruder_colour). They are spec names; leave them even in an otherwise American-spelled codebase. - In a browser, build ZIPs with fflate (
zipSync); three.js's 3MFLoader also depends onlibs/fflate.module.js. - Verify generated projects by having the CLI load, re-save and slice them, with every filament actually used.
See also
- Slicing from the command line with Bambu Studio (flatpak), including two-color prints
- 3d.jhampton.io (print library and parametric template maker)