multi_material_print
Print multiple objects in different materials or colors on one build plate by specifying each object's file and material. Ensures per-object filament assignments and automatic AMS slot mapping for a unified print job.
Instructions
Print multiple objects in different materials/colors on one build plate.
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 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"``).
The tool automatically:
1. Looks up each material's properties (temps, colors)
2. Builds a multi-object 3MF with per-object material assignments
3. Generates merged slicer overrides (uses the highest-temp material)
4. Checks AMS slots for matching materials
5. Slices and prints with correct AMS mapping
Requires PrusaSlicer or OrcaSlicer installed locally.
Args:
objects_json: JSON array of objects with ``file_path`` and
``material_id`` keys (see example above).
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: Additional slicer overrides JSON.
slicer_path: Explicit path to slicer binary.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| auto_ams | No | ||
| printer_id | No | ||
| slicer_path | No | ||
| objects_json | Yes | ||
| printer_name | No | ||
| extra_overrides | No |