feat(cli): add --inspect-paint JSON paint dump (Orca #14608) - #46
Merged
Merged
Conversation
Port --inspect-paint from OrcaSlicer OrcaSlicer#14608 onto Edge. The action dumps per-facet supports/seam/MMU/fuzzy paint state as JSON and exits. Handler lives in Snapmaker_Orca.cpp (not OrcaSlicer.cpp). Exclusive-action rejection mirrors --inspect-mesh / --export-settings - from Edge #36/#39/#40: --slice, --strict, --export-settings, --inspect-mesh, --progress-json, --hub, and --hms-lookup are rejected with CLI_INVALID_PARAMS (status 254). Sources use the same absolute paths as other inspects (resolve_cli_input_path). Co-authored-by: aceRage <aceRage@users.noreply.github.com>
…datadir-test Orca OrcaSlicer#14608 merges CLI inputs into one Model, but the handler still dumped inspect_to_json once per leftover Model, concatenating documents on stdout. Fold every loaded model into a single objects/summary document. --migrate-datadir-test is a CLIMisc early stdout exit (like --hub / --hms-lookup), so it never appears in m_actions; reject it at the handler and in the paint exclusivity gate. Co-authored-by: aceRage <aceRage@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Port of OrcaSlicer #14608 (
--inspect-paint): dump per-facet supports / seam / MMU / fuzzy paint state as JSON to stdout, then exit. Machine-readable alternative to the paint gizmos.CLI handler is wired in
src/Snapmaker_Orca.cpp(notOrcaSlicer.cpp). Exclusive-action rejection mirrors Edge #36 / #39 / #40 (--inspect-mesh,--strict,--export-settings -).What it emits
Per object → volume → paint layer, plus a top-level
summary. Empty layers collapse to{"empty": true}. Non-empty layers list each present state with facet count, area in mm², and a mesh-local bounding box over the painted triangles only (FacetsAnnotation::get_facets_strictreturns the whole source vertex list).Layer keys:
supports,seam,mmu_segmentation(extruder_1..ExtruderMax),fuzzy_skin. Paint-depth / ImageMap facet layers are not folded into this JSON.sourceslists every input file as absolute paths (resolve_cli_input_path, same as--inspect-mesh).Multi-input: Orca OrcaSlicer#14608 merges CLI inputs into one
Modelbefore actions and lists every path insources. The original handler still calledinspect_to_jsononce per leftoverModel, which concatenated JSON documents on stdout.PaintCLI::inspect_to_jsonnow takes every loaded model and emits one JSON value: objects are concatenated (globalindex), with a singlesummary. Two STLs → one parseable document,sourceslength 2.Edge adapt
src/slic3r/Utils/PaintCLI.{hpp,cpp}+ CMake;inspect_paintaction inPrintConfig.cpp.--slice,--strict,--export-settings(including-),--inspect-mesh,--progress-json,--hub,--hms-lookup,--migrate-datadir-test; require an input file or--load-assemble-list.--migrate-datadir-testis CLIMisc (not an action), so it is rejected at its early-exit handler and in the paint exclusivity gate, matching--hub/--hms-lookup.--inspect-mesh --inspect-paintfails at the inspect-mesh gate first.--ground-*transforms are accepted and have no effect (paint is mesh-local).--inspect-meshstill allows--strict(Edge feat(cli): add --ground-* and --inspect-mesh via shared LayOnFace (Orca #15073) #40);--inspect-paintdoes not, matching upstream CLI: --inspect-paint — dump per-facet paint state as JSON OrcaSlicer/OrcaSlicer#14608.Screenshots/Recordings/Graphs
N/A (CLI JSON dump; paint gizmos unchanged).
Tests
Not run: this environment has no build tree (
build/absent), so the binary and Catch2 suites were not compiled.Accept criteria (to verify when a build is available)
Snapmaker_Orca --inspect-paint painted.3mf→ valid JSON; summary counts match GUI paint."empty": true,sourcesabsolute.Snapmaker_Orca --inspect-paint a.stl b.stl→ one JSON value (python -m json.tool/jq .succeeds; not two documents concatenated).sourceshas both absolute paths;objectsincludes geometry from both files;summary.objectsis the combined count.CLI_INVALID_PARAMS(−2) for: no input; combined with--slice,--strict,--export-settings -,--inspect-mesh,--migrate-datadir-test.--inspect-mesh/--ground-*still work; paint-depth GUI unchanged.--inspect-paintwithout input, or stacked with--slice/--strict/--export-settings -/--inspect-mesh/--migrate-datadir-test, is rejected before load (or at the migrate early-exit) via the same exclusive-action pattern as--inspect-mesh.