Fence joins the node.slots paint model with one paintable 'surface' slot (merged post/base/rail geometry is a single mesh). Resolution order matches slab: textures-off joinery role -> node.slots.surface ref -> legacy inline material/preset -> declared default (library:wood-finewood27). Tags the mesh userData.slotId='surface' and wires capabilities.slots + paint. Stops borrowing DEFAULT_STAIR_MATERIAL. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
15 lines
505 B
TypeScript
15 lines
505 B
TypeScript
import type { AnyNode, FenceNode } from '@pascal-app/core'
|
|
import { createSlotPaintCapability, previewGeometrySlot } from '../shared/slot-paint'
|
|
|
|
export const fencePaint = createSlotPaintCapability({
|
|
resolveRole: () => 'surface',
|
|
applyPreview: previewGeometrySlot,
|
|
legacyEffective: (node: AnyNode) => {
|
|
const fence = node as FenceNode
|
|
if (fence.materialPreset || fence.material) {
|
|
return { material: fence.material, materialPreset: fence.materialPreset }
|
|
}
|
|
return null
|
|
},
|
|
})
|