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:
co-authored by
Claude Opus 4.8
parent
c6423e7c73
commit
6b67ab6949
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user