Repository navigation
editor: add fill, color picking and dimensioned voxel shapes - #4895
Conversation
d18541d to
ecf26c0
Compare
|
Rebased onto the rewritten parent: the stack below was replayed onto master after #4882 merged, so this layer's owned commits ( |
ecf26c0 to
b466f11
Compare
b466f11 to
8ff746c
Compare
|
Holding review: upstream PR #4893 is not yet approved. This stacked PR will be re-evaluated once the upstream lands an approval label. |
jakildev
left a comment
There was a problem hiding this comment.
Review — editor: add fill, color picking and dimensioned voxel shapes
Verdict: approve
Stacked on #4893 (cross-author). Reviewing the child diff only — upstream is approved separately. Approval assumes #4893 lands first; the new toolbar code depends on kSculptButtons / sculptButtonPos indexing and the picking helpers in editor_picking.hpp, so a change to those upstream between approval and merge needs a rebase here.
Big picture: the change does what the title and body say, and the approach is sound. Bucket is a pure enclosedPlaneCells helper that collects the region before any edit, so an open outline can never leave a partial fill. It commits through the existing applyEditRaw + commitStroke path, so Undo/Redo is one record. Picker returns a transient kSampled (-1) foreground that never touches the saved swatches. Shapes reuses addVoxelPart + commitPartCreation, so Undo/Redo and persistence come for free.
Checks on head 8ff746c33: every statusCheckRollup entry is SUCCESS or SKIPPED (comment-refs, linux-build, format-check, header-checks, instruction-size, no-plan-files, closes-lint, whitespace, fleet-tests). The swap-approval-label SKIPPED entries are the expected labeler no-op.
What I verified in the tree:
activeSwatchIdx_ == -1is safe at every consumer.palette_.color()handleskSampled. The class-paint paths atmain.cpp:4170-4194and the status label guard>= 0.EditorPalette::edit(-1, …)returns false, and Edit is also disabled for the sampled selection. Add parses the hex field, whichrefreshfills from the sampled color, so Add persists it.enclosedPlaneCells: the straight-ray prefilter only ever probes cells that are in-bounds, because it stops at the first occupied or edge cell. The BFS never steps out of bounds because only non-edge cells are enqueued. Diagonal contact does not leak (covered by a test), and a hidden-layer cell counts as a wall and skips that candidate.- Toolbar remap:
kSculptButtonsindices 0–8 keep their old gesture IDs, so existing sessions are unaffected. New IDs are 9 (Bucket), 10 (Picker), 11 (Shapes). Thei < 5tool branch maps exactly onto the table'stool_entries. updateSculptToolbar()now runs ahead of the loft early return, so clicking a tool exits loft mode. This is intentional andg_loftTool.active_ = falseis set in the tool branch.- The shapes panel's widgets are exempt from the workspace visibility sweep and are closed on workspace change.
containsCursoris part ofoverWidget, so clicks on the panel do not reach the scene. - No comment carries an issue or PR number, and no
glm::/std::math is added outside the allowed set.
Evidence caveat (not blocking): the native workflows were run on macOS/Metal only. The PR body discloses the six baseline editor failures it did not introduce, so the editor suite is not all-green. Windows and Linux render smoke is outside this review.
Nits (follow-up)
creations/editors/voxel_editor/sculpt_panel.hpp:1119— the Shapes button position{1072, 60}is a magic literal separate fromkSculptToolbarPos/ stride. A named constant would keep the layout checks readable when the toolbar is next touched.creations/editors/voxel_editor/editor_picking.hpp:9— the new include is out of the existingirreden/render/...ordering, andstd::spanis used without<span>. It builds today through a transitive include; add<span>while here.creations/editors/voxel_editor/editor_picking.hpp:119-145— the pooled (non-dense) path runscastGridRayonce per active voxel of every such set on each Picker click. Fine for click-rate use, but a scene with a large rotated set will hitch on the click. A bounding-box early-out per set would bound it.
Praise
- The Bucket helper's linear straight-ray prefilter rejects blank candidate slices without allocating a plane-sized visit map.
EmptyFillSliceRejectsWithALinearProbepins the 129-probe bound. - Cell/solid closed intersection with a boundary epsilon keeps the requested occupied bounds for thin and even extents, and the 7³ counts are pinned in both the unit test and the native workflow.
Test plan the author should run before merge
- Re-run
material_toolsandshapes_workflowon the merge result after #4893 lands. - Windows/Linux GL editor smoke is covered by the existing
fleet:needs-*-smokelanes.
Escalation: none. Safe for merge.
🤖 Reviewed by Claude Sonnet 5.5 (review-pr skill)
Opus recheck not required.
The evidence directories now live at media commit 3c10708; master keeps no committed PR screenshots. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
8ff746c to
b8a4c94
Compare
Summary
Sculpt now exposes Brush, Bucket, Picker, and Recolor. Bucket fills a closed empty outline on one local axis plane and rejects open boundaries before editing. It creates one undo record. Picker samples unlit voxel RGB and switches to Recolor, which changes occupied cells without adding geometry. Unsaved sampled colors remain available as the foreground color even when the palette is full; Add saves one as a swatch.
Shapes opens a dropdown for Cube, Sphere, Cone, Cylinder, and Pyramid, with length, width, and height fields in whole voxels from 1 to 64. Spawn creates a separate editable part in the active color and focuses it. Existing part creation handles Undo/Redo and persistence. Nonuniform dimensions stretch round primitives. Cell-solid intersection preserves the requested occupied bounds for even and thin extents.
Original implementation validation
28 focused grid, palette, source-color sampling and primitive tests passed.
Native material_tools passed 12/12 at alternating 30° and 67°, with zero layout findings. The workflow checks open-outline rejection, Brush closing the outline, nine-cell fill, Undo/Redo, custom RGB picking, recolor and empty-floor no-op using every authored cell's actual color and occupancy.
Native shapes_workflow passed 9/9 with zero layout findings. Typed dimensions, all five shapes, nonuniform Cube, thin Sphere, selected editable part, colors, and Undo/Redo matched exact counts and occupied bounds.
Native palette_workflow passed 8/8 with zero layout findings, including GPL round trips and color persistence.
Native region_tools passed 25/25 and camera_gestures passed 44/44, both with zero layout findings. Header, comment-reference, and whitespace checks passed.
Built IRVoxelEditor in the isolated macOS worktree.
Screenshots
Limits
Picker supports dense and transformed GRID voxels. Detached/private-canvas and skinned sources need Local Edit before sampling. Bucket deliberately confines edits to the chosen enclosure instead of applying symmetry copies.
Stack validation — 2026-11-06
Replayed the owned editor commits onto merged master
f7b1dbfa2, preserving the four-PR chain. Range-diff inspection found no lost runtime hunks. Moved detailed validation/session contracts intodocs/design/editor-validation.mdto fix instruction-size CI. Corrected the newly inherited document-transition fixture's stale File/Discard click centers and made composite Save As repeatable.Validated the combined stack at
683a6017c8a7be6964c5872282cba5d982c839a3on macOS/Metal:Follow-up integration — 2026-11-07
The two parked follow-ups are reconciled in dependency order: #4903 → #4908 → #4918. #4908 maps Actions to the current tools and integer fields, isolates modal input, and keeps remapped badges synchronized. #4918 preserves the Shapes/dock UI gate and diagnoses replay clicks swallowed by UI.
Current evidence: 273 focused unit tests pass. The combined native registry covers 75 cases and 1,524 assertions; all 73 pre-existing case verdicts and failure sets are unchanged, and both new click-occlusion controls behave as expected. Six baseline failures remain: fill_ghost, click_orbit, mode_preview, component_field_key (layout findings), text_input_command_capture, and test_recipe_reapply. These are disclosed with exact results in #4918; this is not an all-green editor suite. Per-case comparison. The overlap gate is
overlapwith clean trial merges and no blockers. This PR is ready for review in stack order; no merge or fleet approval is claimed.Overlap gate
fleet-pr-overlap --self-pr 4895: VERDICT: overlap (exit 1). All shared-path trial merges are clean; no blocking or base-conflict rows.Upstream rows: #4893 (4 paths).
#4896, #4903, #4908, #4918: identical clean grades on 15 shared paths
The gate reports the following rows for #4896; the same paths are graded
cleanfor #4903, #4908, #4918.