Skip to content

feat: exports open in Bambu Studio with their process; shambu verify; include order fix (0.6.0) - #10

Merged
Shavvimal merged 48 commits into
mainfrom
gui-bookkeeping-0.6.0
Oct 29, 2026
Merged

Shavvimal merged 48 commits into
mainfrom
gui-bookkeeping-0.6.0

Conversation

@Shavvimal

Copy link
Copy Markdown
Owner

Why

On 29 October a shambu project opened in Bambu Studio 02.08.02.61 showed the stock 0.20mm Standard @BBL X2D process: 2 walls, 15 % grid, no PLA interface, and the GUI re-sliced at 157 g instead of 216 g. Post-mortem: docs/errors/2026-10-29-gui-open-drops-process.md. Spec and review record: docs/specs/2026-10-29-gui-preset-bookkeeping.md.

Root cause, confirmed in the Studio source at tag v02.08.02.61: shambu exported the process as a user preset that exists only in the file, with different_settings_to_system = ["", "", "", ""]. Studio resets every key not named in that list to the base preset (Preset.cpp:2258-2269, PrintConfig.cpp:9218), then selects the base clean. Per-object settings never pass through presets, which is why the per-object recipes survived.

Two more defects found on the way: presets.resolve() merged include templates after the preset's own keys (Studio: parent, include, leaf; PresetBundle.cpp:5109, :5142-5144, :5158), so the headless slice used three X2D filament values the GUI never uses; and skeleton_/skin_infill_density did not follow sparse_infill_density as the GUI couples them (Tab.cpp:2106-2111).

What changes

  • Every export writes print_settings_id = the base system preset, inherits_group[slot] = "", and different_settings_to_system[slot] = sorted(explicit overrides ∪ keys that differ from the base), merged with the CLI's own entries, for the process, each filament and the printer. Sliced exports keep their G-code (bookkeeping-only write). slice --settings-from does the same and keeps the input's listed keys.
  • presets.resolve() in Studio's order; diff_keys(); the derived infill keys.
  • dual-material-interface is an [object] recipe (where the GUI keeps it); two-filament-plate carries the plate-wide keys; a mis-scoped recipe gets a WARN.
  • shambu patch FILE --process-set KEY=VALUE / --process-unset KEY, keeping the list right; inspect shows the override lists.
  • shambu verify FILE.3mf --against SPEC reports every process, filament, printer, map, bed, object setting and position that differs from the spec, with the Studio reason; exit 0 no FAIL, 1 any FAIL or a spec that does not load, 3 a project that does not read.
  • The hand-back: the process shows the base (modified) with the override values to confirm; a project with objects always opens unsliced (Plater.cpp:9578-9581); the GUI estimate must land within 1 min and 1 g of shambu's, else save the project under a new name and shambu verify it; Print only then. No bypass of the GUI anywhere.
  • shambu open warns when Studio was already running.

Verification

  • make check: ruff, mypy, pytest green (see the last commit's CI).
  • Live run on the two-filament sweeper plate with the real Studio CLI: exit 0, print_settings_id 0.20mm Standard @BBL X2D, 16 listed process keys, system filament ids, Studio estimate 7 h 37 min / 241.0 g; shambu verify on that export exits 0 (98 items). shambu verify on the 29 October GUI-saved file lists the resets (wall_loops 4→2, sparse_infill_density, brim_type, support_interface_filament 2→0, ...) with the Preset.cpp cite.
  • Reviews: Codex gpt-6-astra high, one design round and five code rounds (per worktree, then two final passes on the merged branch, by module), and a rubric review per worktree against REVIEW-RUBRIC.md; every accepted finding and each dismissal is recorded in the spec, sections 9 to 11.
  • Still to run by the owner (spec section 6): open the fresh export in Studio, confirm the modified process and the PLA interface on the auxiliary nozzle, slice, compare with the report, save, shambu verify the save.

…iff_keys for the preset bookkeeping; spec and post-mortem for the GUI process loss
…des ∪ diff, secondary filament slots, verifier)
…d) with the override values, the plate unsliced, the GUI slice as the check
… mirror the GUI's derived infill keys; fix Plan's filament_resolution argument
…ts, settings, filaments, maps, plates, objects, positions)
…ight is global and lives in two-filament-plate
…er-key note, interface key provenance, shorter Next line
…, split numeric vectors only, PatchSet enforces declared touches
…ch, keep the input's lists on slice --settings-from, resolve the inherits parent first, refuse filament and printer keys in --process-set
…rints only after a match, names the search box
…pin, object filament and plate, embedded copies, plate map mode, variant blocks, project options, tower keys, exit 1 for a bad spec; open warning wording
…n shambu's chain does not define it (Studio lists only keys that differ from its base)
…eset); the fake export can write the loaded presets and object settings as the CLI does
…) for Pipeline.plan and verify.expected_object_settings
…the colour count before it names a slot, so slots 0..N+1 in ascending order work
… the explicit process values before the bookkeeping patch; a mismatch is a verify problem and keeps the export in the run folder; the test fakes write the loaded presets as the CLI does
….slot_keys), FAIL any inherits_group parent other than the system base for every slot, and keep the % sign significant except for percent-only keys
… (modified) suffix, no Print until verify exits 0, each filament on its planned nozzle, a bad spec is exit 1, the open WARN asks to check the front window
…parent per slot, percent-only keys; hand-back and docs text
@Shavvimal
Shavvimal merged commit f0664fa into main Oct 29, 2026
5 checks passed
@Shavvimal
Shavvimal deleted the gui-bookkeeping-0.6.0 branch October 29, 2026 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant