multi_material_print
Prints multiple objects in different materials or colors on one build plate by building a multi-material 3MF, mapping AMS slots, slicing, and sending the job to a supported 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. On a printer
sliced with more than one nozzle each filament keeps its own
material's temperatures
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: Match each filament to a loaded spool of its material and
colour before slicing (default ``True``); refused when one is not
loaded.
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`` on the plate a
call without one built (``plate_path``), proving it was shown to
the person before printing. The call carrying it prints that
plate, for the same objects, once the person says go: a print
is shown to its owner before it starts.
filament_map: Only for a printer with more than one nozzle: the
nozzle (1 for the first) each filament prints from, one number
per filament (``[2, 1]`` puts filament 1 on nozzle 2). Filaments
are numbered in the order their objects first appear in
``objects_json``, one per material and colour (the result's
``filament_index`` is that number less one). Leave unset to let
the slicer map them. A map that does not fit is refused before
slicing, as ``slice_model`` refuses it.
mixed_nozzle_experiment: The person has said yes, for this print, to a slice refused with
``MULTI_NOZZLE_MIXED_SIZES`` (nozzles of different sizes at once, an experiment). Only
on their yes, each time; ``slice_model`` says what follows.
soft_nozzle_confirmed: The owner has said to print anyway a slice
refused with ``ABRASIVE_ON_SOFT_NOZZLE`` (an abrasive filament
through a nozzle on record that is not wear-resistant). Only on
their word, never on your own judgement.
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 | Match each filament to a loaded spool of its material and colour before slicing (default ``True``); refused when one is not loaded. Default: true. | |
| printer_id | No | Printer model ID for profile selection. | |
| slicer_path | No | Explicit path to slicer binary. | |
| filament_map | No | Only for a printer with more than one nozzle: the nozzle (1 for the first) each filament prints from, one number per filament (``[2, 1]`` puts filament 1 on nozzle 2). Filaments are numbered in the order their objects first appear in ``objects_json``, one per material and colour (the result's ``filament_index`` is that number less one). Leave unset to let the slicer map them. A map that does not fit is refused before slicing, as ``slice_model`` refuses it. | |
| 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`` on the plate a call without one built (``plate_path``), proving it was shown to the person before printing. The call carrying it prints that plate, for the same objects, once the person says go: 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%"}'``). | |
| soft_nozzle_confirmed | No | The owner has said to print anyway a slice refused with ``ABRASIVE_ON_SOFT_NOZZLE`` (an abrasive filament through a nozzle on record that is not wear-resistant). Only on their word, never on your own judgement. Default: false. | |
| mixed_nozzle_experiment | No | The person has said yes, for this print, to a slice refused with ``MULTI_NOZZLE_MIXED_SIZES`` (nozzles of different sizes at once, an experiment). Only on their yes, each time; ``slice_model`` says what follows. Default: false. |