From e77d55ee23804a8eddbdfde76171f887019d85c5 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Tue, 12 May 2026 22:07:36 +0200 Subject: [PATCH] Support committing transformations for multiple path points --- .../commit-transform-session-command.ts | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/commands/commit-transform-session-command.ts b/src/commands/commit-transform-session-command.ts index a6c4eead..eca19e4d 100644 --- a/src/commands/commit-transform-session-command.ts +++ b/src/commands/commit-transform-session-command.ts @@ -3,6 +3,7 @@ import { createApplyBatchSelectionTransformCommand } from "./apply-batch-selecti import { createResizeBoxBrushCommand } from "./resize-box-brush-command"; import { createRotateBoxBrushCommand } from "./rotate-box-brush-command"; import { createSetPathPointPositionCommand } from "./set-path-point-position-command"; +import { createSetPathPointPositionsCommand } from "./set-path-point-positions-command"; import { createSetBoxBrushTransformCommand } from "./set-box-brush-transform-command"; import { createUpsertEntityCommand } from "./upsert-entity-command"; import { createUpsertModelInstanceCommand } from "./upsert-model-instance-command"; @@ -52,6 +53,12 @@ function createTransformCommandLabel(session: ActiveTransformSession): string { case "pathPoint": targetLabel = "path point"; break; + case "pathPoints": + targetLabel = + session.target.items.length === 1 + ? "path point" + : `${session.target.items.length} path points`; + break; case "entity": targetLabel = session.target.entityKind === "cameraRig" @@ -330,6 +337,19 @@ export function createCommitTransformSessionCommand( position: session.preview.position, label: createTransformCommandLabel(session) }); + case "pathPoints": + if (session.preview.kind !== "pathPoints") { + throw new Error("Path point multi-transform preview is invalid."); + } + + return createSetPathPointPositionsCommand({ + pathId: session.target.pathId, + updates: session.preview.items.map((item) => ({ + pointId: item.pointId, + position: item.position + })), + label: createTransformCommandLabel(session) + }); case "modelInstance": { if (session.preview.kind !== "modelInstance") { throw new Error("Model instance transform preview is invalid.");