mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-20 17:50:12 +02:00
feat(slicing): build-plate override in the SliceModal (#1337)
Slicing an STL via the integrated slicer always defaulted to whatever
curr_bed_type lived in the chosen process preset (typically "Cool
Plate"), which the slicer CLI rejected for high-temp filaments with
"Plate 1: Cool Plate does not support filament 1". The user had no
way to switch plates without cloning the preset in BambuStudio.
The Slice modal now exposes a Build plate dropdown with the six
canonical BambuStudio / OrcaSlicer plates (Cool Plate, Cool Plate
SuperTack, Engineering Plate, High Temp Plate, Textured PEI Plate,
Smooth PEI Plate) plus an "Auto (use process preset)" option that
preserves the previous behavior. Positioned between Process profile
and Filament rows so a long filament list never pushes it off the
modal's scrolled viewport, and always enabled regardless of whether
the user picked a Printer Preset Bundle.
A new bed_type field on SliceRequest flows through both dispatch
paths:
- Resolved-preset path: _patch_process_bed_type overwrites
curr_bed_type on the process JSON before forwarding to the sidecar.
Works end-to-end today, no sidecar change needed.
- Bundle dispatch path: slice_with_bundle adds a bedType form field
to the sidecar multipart. The sidecar (maziggy/orca-slicer-api
fork) needs a matching change to honor it as --curr_bed_type on
the CLI invocation; until then the field is silently ignored and
the slice runs with the bundle's default plate.
This commit is contained in:
@@ -435,6 +435,7 @@ class SlicerApiService:
|
||||
filament_names: list[str],
|
||||
plate: int | None = None,
|
||||
export_3mf: bool = False,
|
||||
bed_type: str | None = None,
|
||||
request_id: str | None = None,
|
||||
on_progress: Callable[[dict], None] | None = None,
|
||||
) -> SliceResult:
|
||||
@@ -476,6 +477,16 @@ class SlicerApiService:
|
||||
data["plate"] = str(plate)
|
||||
if export_3mf:
|
||||
data["exportType"] = "3mf"
|
||||
if bed_type is not None:
|
||||
# #1337: bed-plate override flows through to the sidecar as a
|
||||
# standalone field. The sidecar wraps this as --curr_bed_type on
|
||||
# the CLI invocation, overriding whatever the bundle's process
|
||||
# JSON specifies. Bambuddy can't patch the bundle's JSON locally
|
||||
# (the sidecar materialises it from disk), so this round-trip is
|
||||
# the only path. Silently no-ops on sidecar versions that don't
|
||||
# yet recognise the field — the user's slice still runs with the
|
||||
# bundle's default plate, no crash.
|
||||
data["bedType"] = bed_type
|
||||
if request_id is not None:
|
||||
data["requestId"] = request_id
|
||||
|
||||
|
||||
Reference in New Issue
Block a user