Skip to content

VertexPaint: Slice B — Paint-aware shading-mode authoring (UI + brush behaviour) #633

Description

@fernandotonon

Parent epic: #631
Depends on: Slice A (#632).

Goal

Expose the shading-mode data model to the user. Add the per-face mode picker, the "Paint as Flat / Paint as Smooth" stroke override, and the visual indicator that distinguishes flat from smooth faces while editing.

Scope

  • VertexPaintController singleton (src/VertexPaintController.{h,cpp}) — new home for the authoring API:
    • setStrokeShadingMode(FaceShadingMode | Inherit) — the stroke-level override.
    • setFaceShadingModes(faceIndices, mode) — bulk operation.
    • getMeshShadingSummary(mesh) — for UI display ("12 flat faces, 234 smooth faces").
  • Per-face mode picker in the inspector:
    • With a face (or set of faces) selected, a new "Shading" panel offers four buttons: Smooth / Flat / Textured / Textured Smooth.
    • Disabled (greyed) modes when the face has no material with a texture (Textured / Textured Smooth need a base map; the picker offers them anyway with a tooltip explaining the prereq).
    • Multi-select aware: setting a mode applies to all selected faces in one undo step.
  • Stroke-level override in the brush toolbar:
    • Three buttons: "Paint as Flat" / "Paint as Smooth" / "Inherit face mode" (default).
    • "Inherit face mode" means: a stroke that touches a flat face writes its single colour; a stroke that touches a smooth face writes per-corner colours. The user gets predictable results when painting on a mixed mesh.
    • "Paint as Flat" forces every touched face into Flat mode and sets its colour to the brush colour. Useful for blocking-in flat-shaded sections fast.
    • "Paint as Smooth" forces touched faces into Smooth mode and writes per-corner colours. Useful for converting an imported flat-shaded mesh into a smoother look.
  • Visual indicator:
    • In Edit Mode with face-selection active, flat faces display with a small dot-grid overlay at the face centre so the user can tell at a glance which faces are flat-shaded.
    • Toggle: "View → Show face shading mode" (default ON in Edit Mode).
  • Undo:
  • Status bar / inspector summary: shows the per-mesh shading summary ("Smooth: 234 / Flat: 12 / Textured: 0") so users can verify their work.

Acceptance Criteria

  • Inspector picker switches selected faces between modes correctly.
  • Stroke-level "Paint as Flat" converts touched smooth faces to Flat and writes the brush colour as the face's single colour.
  • Stroke-level "Paint as Smooth" converts touched flat faces to Smooth and writes per-corner colours.
  • "Inherit face mode" behaves predictably on a mixed mesh.
  • Visual flat-face indicator renders correctly when Edit Mode face selection is active.
  • Multi-select bulk mode change works in one undo step.
  • Per-mesh summary updates live as modes change.
  • No regression in existing vertex paint (default behaviour with no stroke override matches today's behaviour on all-smooth meshes).
  • Sentry breadcrumbs paint.vertex.shading_mode and paint.vertex.stroke_override per action.
  • Headless-CI tests for each stroke-override mode on fixture meshes.

Effort

~6 days.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestuivertex-paintVertex colour authoring: shading modes, per-face/per-vertex interpolation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions