multi_material_print
Prints multiple objects in different materials or colors on one build plate, assigning each object its own filament and slicing for a compatible AMS printer.
Instructions
Print multiple objects in different materials/colors on one build plate.
**Only a printer Kiln drives can make this print** — today a Bambu with
an AMS. At any other printer (a Klipper MMU Kiln can read but not
route, or a single-feed machine) a multi-filament plate is REFUSED
before slicing with code ``MULTI_MATERIAL_NOT_DRIVEN``: the objects
would all come out in one filament. The refusal carries what Kiln saw
on the printer (``multi_material``) and the composed file
(``multi_material_3mf``), so the user can slice it in a slicer that
drives their unit. A single-filament plate is never refused.
Takes a JSON array of objects, each with a model file and material
assignment. Builds a multi-material 3MF file with per-object filament
assignments, slices it, auto-maps materials to AMS slots, and prints.
This is how you print "object A in red PLA, object B in black PETG"
in a single print job.
Example: Print a bracket in PETG and a cover in PLA::
multi_material_print(
objects_json='[
{"file_path": "/path/to/bracket.stl", "material_id": "petg"},
{"file_path": "/path/to/cover.stl", "material_id": "pla"}
]',
printer_name="my_bambu",
printer_id="bambu_a1",
)
Each object in the JSON array supports:
- ``file_path`` (required): Path to STL/OBJ/GLB mesh file.
- ``material_id`` (required): Material identifier (e.g. ``"petg"``).
- ``name`` (optional): Display name for the object.
- ``color`` (optional): Hex color override (e.g. ``"#FF0000"``).
- ``group`` (optional): Objects sharing a group index are placed
coincident (for meshes that share one coordinate space, like a
body and its inlay). By default every object is its own group
and gets its own spot on the plate.
The tool automatically:
1. Looks up each material's properties (temps, colors)
2. Arranges the objects side by side on the plate (per ``group``)
and builds a multi-object 3MF with per-object material assignments
3. Sets the plate for its materials: the hottest one's temperatures,
the slowest one's melt rate, the gentlest cooling
4. Checks AMS slots for matching materials
5. Slices and prints with correct AMS mapping
Requires PrusaSlicer or OrcaSlicer installed locally.
The emitted 3MF (``multi_material_3mf`` in the result) also opens in
Bambu Studio, which keeps the per-object materials but re-derives
print settings itself — the result's ``slicer_note`` explains this;
relay it to the user when handing over the file.
Args:
objects_json: JSON array of objects, each
``{"file_path": …, "material_id": …}`` (STL/OBJ/GLB path;
material key such as ``"petg"``), with optional ``name``,
``color`` (hex) and ``group`` (objects sharing a group index
are placed coincident).
printer_name: Registered printer name in fleet.
printer_id: Printer model ID for profile selection.
auto_ams: Auto-detect AMS slot mapping (default ``True``).
extra_overrides: Optional JSON object of slicer overrides merged on
top of the material settings (e.g.
``'{"fill_density": "30%"}'``).
slicer_path: Explicit path to slicer binary.
preview_token: Token from ``issue_preview_token`` proving the plate
was shown to the person before printing. Required beside their
go-ahead: a print is shown to its owner before it starts.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"objects_json": "<objects_json>"
},
"name": "multi_material_print"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| auto_ams | No | Auto-detect AMS slot mapping (default ``True``). Default: true. | |
| printer_id | No | Printer model ID for profile selection. | |
| slicer_path | No | Explicit path to slicer binary. | |
| objects_json | Yes | JSON array of objects, each ``{"file_path": …, "material_id": …}`` (STL/OBJ/GLB path; material key such as ``"petg"``), with optional ``name``, ``color`` (hex) and ``group`` (objects sharing a group index are placed coincident). | |
| printer_name | No | Registered printer name in fleet. | |
| preview_token | No | Token from ``issue_preview_token`` proving the plate was shown to the person before printing. Required beside their go-ahead: a print is shown to its owner before it starts. | |
| extra_overrides | No | Optional JSON object of slicer overrides merged on top of the material settings (e.g. ``'{"fill_density": "30%"}'``). |