+ // Fill the host's scroll slot and own the scroll internally: the eraser /
+ // reset row stays pinned (shrink-0) while only the material list below
+ // scrolls. The category tabs pin too (sticky, inside the scroll region).
+
+
- {
- // Custom-create: pre-create a scene material and select it as the
- // brush via a `scene:` ref so painting stores the ref and edits to
- // it propagate everywhere. The user edits it inline in the scene-
- // material list below (auto-opened) — no separate right-side pane.
- const id = generateSceneMaterialId()
- const count = Object.keys(useScene.getState().materials).length
- useScene.getState().addSceneMaterial({ id, name: `Material ${count + 1}`, material })
- setActivePaintMaterial({
- materialPreset: toSceneMaterialRef(id),
- sourceTarget: activePaintTarget,
- })
- setAutoEditMaterialId(id)
- }}
- onSelectMaterialPreset={(materialPreset) => {
- setActivePaintMaterial({ materialPreset, sourceTarget: activePaintTarget })
- }}
- selectedMaterialPreset={activePaintMaterial?.materialPreset}
- value={activePaintMaterial?.material}
- />
- {materialCount > 0 ? (
-
-
-
- ) : null}
+
+ {
+ // Custom-create: pre-create a scene material and select it as the
+ // brush via a `scene:` ref so painting stores the ref and edits to
+ // it propagate everywhere. The user edits it inline in the scene-
+ // material list below (auto-opened) — no separate right-side pane.
+ const id = generateSceneMaterialId()
+ const count = Object.keys(useScene.getState().materials).length
+ useScene.getState().addSceneMaterial({ id, name: `Material ${count + 1}`, material })
+ setActivePaintMaterial({
+ materialPreset: toSceneMaterialRef(id),
+ sourceTarget: activePaintTarget,
+ })
+ setAutoEditMaterialId(id)
+ }}
+ onSelectMaterialPreset={(materialPreset) => {
+ setActivePaintMaterial({ materialPreset, sourceTarget: activePaintTarget })
+ }}
+ selectedMaterialPreset={activePaintMaterial?.materialPreset}
+ value={activePaintMaterial?.material}
+ />
+ {materialCount > 0 ? (
+
+
+
+ ) : null}
+
)
}
diff --git a/packages/editor/src/components/ui/controls/material-picker.tsx b/packages/editor/src/components/ui/controls/material-picker.tsx
index e0b5469f..6dd019e6 100644
--- a/packages/editor/src/components/ui/controls/material-picker.tsx
+++ b/packages/editor/src/components/ui/controls/material-picker.tsx
@@ -96,7 +96,7 @@ export function MaterialPicker({