feat(paint-slots): create-in-place scene materials + paint-panel polish

Custom-create now pre-creates a scene material and opens its inline editor
in the build pane (no separate right-side PaintPanel, which is removed);
the brush + "Paint with" use a scene: ref so painting stores the ref and
edits propagate everywhere. Slot preview (shared + item) resolves scene
refs so hover shows the real material.

Material properties editor uses the shared SliderControl for roughness/
metalness/opacity; row action buttons use Tooltip instead of title; the
color input renders as a clean filled swatch.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Wassim SAMAD
2026-06-18 11:46:45 -04:00
co-authored by Claude Opus 4.8
parent c6423e7c73
commit 6b67ab6949
9 changed files with 140 additions and 176 deletions
+8 -1
View File
@@ -169,7 +169,14 @@ function buildPreviewMaterial(
materialPreset: string | undefined,
): Material | null {
const shading = useViewer.getState().shading
if (materialPreset) return createMaterialFromPresetRef(materialPreset, shading)
if (materialPreset) {
const parsed = parseMaterialRef(materialPreset)
if (parsed?.kind === 'scene') {
const sceneMaterial = useScene.getState().materials[parsed.id as SceneMaterialId]
return sceneMaterial ? createMaterial(sceneMaterial.material, shading) : null
}
return createMaterialFromPresetRef(materialPreset, shading)
}
if (material) return createMaterial(material, shading)
return null
}
+8 -1
View File
@@ -134,7 +134,14 @@ export function buildSlotPreviewMaterial(
materialPreset: string | undefined,
): Material | null {
const shading = useViewer.getState().shading
if (materialPreset) return createMaterialFromPresetRef(materialPreset, shading)
if (materialPreset) {
const parsed = parseMaterialRef(materialPreset)
if (parsed?.kind === 'scene') {
const sceneMaterial = useScene.getState().materials[parsed.id as SceneMaterialId]
return sceneMaterial ? createMaterial(sceneMaterial.material, shading) : null
}
return createMaterialFromPresetRef(materialPreset, shading)
}
if (material) return createMaterial(material, shading)
return null
}