Update scene document version and modify upsert entity command

This commit is contained in:
2026-03-31 05:50:35 +02:00
parent 8253b7103b
commit 212ec66041
2 changed files with 2 additions and 6 deletions

View File

@@ -34,7 +34,6 @@ export function createUpsertEntityCommand(options: UpsertEntityCommandOptions):
execute(context) {
const currentDocument = context.getDocument();
const currentEntity = currentDocument.entities[nextEntity.id];
const isNewEntity = currentEntity === undefined;
if (currentEntity !== undefined && currentEntity.kind !== nextEntity.kind) {
throw new Error(`Entity ${nextEntity.id} is a ${currentEntity.kind}, not a ${nextEntity.kind}.`);
@@ -61,10 +60,6 @@ export function createUpsertEntityCommand(options: UpsertEntityCommandOptions):
});
context.setSelection(setSingleEntitySelection(nextEntity.id));
context.setToolMode("select");
if (options.label === undefined) {
this.label = createDefaultEntityCommandLabel(nextEntity, isNewEntity);
}
},
undo(context) {
const currentDocument = context.getDocument();

View File

@@ -3,12 +3,13 @@ import type { EntityInstance } from "../entities/entity-instances";
import { cloneMaterialRegistry, createStarterMaterialRegistry, type MaterialDef } from "../materials/starter-material-library";
import { createDefaultWorldSettings, type WorldSettings } from "./world-settings";
export const SCENE_DOCUMENT_VERSION = 6 as const;
export const SCENE_DOCUMENT_VERSION = 7 as const;
export const FOUNDATION_SCENE_DOCUMENT_VERSION = 1 as const;
export const BOX_BRUSH_SCENE_DOCUMENT_VERSION = 2 as const;
export const FACE_MATERIALS_SCENE_DOCUMENT_VERSION = 3 as const;
export const RUNNER_V1_SCENE_DOCUMENT_VERSION = 4 as const;
export const FIRST_ROOM_POLISH_SCENE_DOCUMENT_VERSION = 5 as const;
export const WORLD_ENVIRONMENT_SCENE_DOCUMENT_VERSION = 6 as const;
export interface SceneDocument {
version: typeof SCENE_DOCUMENT_VERSION;