feat(materials): free rotate session overlays and show save progress

Match NPC drag-to-rotate on the material frame during playback, and change the add/edit Save button to Saving… while import runs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Ivan Fontosh
2026-07-21 14:56:42 +08:00
parent 0cab7ce7ca
commit c1c332364c
8 changed files with 238 additions and 67 deletions
+13 -3
View File
@@ -18,6 +18,13 @@ function emptyState(): MaterialsOverlayState {
};
}
function initialLayout(rotationDeg?: number): MaterialsOverlayLayout {
return clampMaterialsLayout({
...DEFAULT_MATERIALS_OVERLAY_LAYOUT,
rotationDeg: rotationDeg ?? 0,
});
}
export class MaterialsOverlayStore {
private state: MaterialsOverlayState = emptyState();
@@ -46,7 +53,7 @@ export class MaterialsOverlayStore {
this.state = {
revision: this.state.revision + 1,
activeMaterialId: event.materialId,
layout: { ...DEFAULT_MATERIALS_OVERLAY_LAYOUT },
layout: initialLayout(event.rotationDeg),
zoomTool: this.state.zoomTool,
};
return this.state;
@@ -57,7 +64,7 @@ export class MaterialsOverlayStore {
this.state = {
revision: this.state.revision + 1,
activeMaterialId: event.materialId,
layout: { ...DEFAULT_MATERIALS_OVERLAY_LAYOUT },
layout: initialLayout(event.rotationDeg),
zoomTool: this.state.zoomTool,
};
return this.state;
@@ -67,7 +74,10 @@ export class MaterialsOverlayStore {
this.state = {
...this.state,
revision: this.state.revision + 1,
layout: clampMaterialsLayout(event.layout),
layout: clampMaterialsLayout({
...this.state.layout,
...event.layout,
}),
};
return this.state;
}