diff options
| author | Maze Winther <mazewinther@gmail.com> | 2026-04-06 01:23:47 +0200 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2026-04-06 01:23:47 +0200 |
| commit | fcc09e80e253831a163e2e4941542e0b34f80740 (patch) | |
| tree | 4cc7aafd0756bb3fa23dfd41080237e462b5ecf2 /apps/web/src/core/managers/timeline-manager.ts | |
| parent | c56d6f8188cc1c0e72d75611269a8bda7b79e727 (diff) | |
| parent | dedb13546a16235e7d6649961d0c9b235f62aa34 (diff) | |
| download | opencut-fcc09e80e253831a163e2e4941542e0b34f80740.tar.gz | |
Merge branch 'temp'
Diffstat (limited to 'apps/web/src/core/managers/timeline-manager.ts')
| -rw-r--r-- | apps/web/src/core/managers/timeline-manager.ts | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/apps/web/src/core/managers/timeline-manager.ts b/apps/web/src/core/managers/timeline-manager.ts index a6f2462a..3abde47b 100644 --- a/apps/web/src/core/managers/timeline-manager.ts +++ b/apps/web/src/core/managers/timeline-manager.ts @@ -16,6 +16,7 @@ import type { AnimationPath, AnimationInterpolation, AnimationValue, + ScalarCurveKeyframePatch, } from "@/lib/animation/types"; import { getLastFrameTime } from "opencut-wasm"; import { BatchCommand } from "@/lib/commands"; @@ -35,6 +36,7 @@ import { UpsertKeyframeCommand, RemoveKeyframeCommand, RetimeKeyframeCommand, + UpdateScalarKeyframeCurveCommand, AddClipEffectCommand, RemoveClipEffectCommand, UpdateClipEffectParamsCommand, @@ -512,6 +514,45 @@ export class TimelineManager { this.editor.command.execute({ command }); } + updateKeyframeCurves({ + keyframes, + }: { + keyframes: Array<{ + trackId: string; + elementId: string; + propertyPath: AnimationPath; + componentKey: string; + keyframeId: string; + patch: ScalarCurveKeyframePatch; + }>; + }): void { + if (keyframes.length === 0) { + return; + } + + const commands = keyframes.map( + ({ + trackId, + elementId, + propertyPath, + componentKey, + keyframeId, + patch, + }) => + new UpdateScalarKeyframeCurveCommand({ + trackId, + elementId, + propertyPath, + componentKey, + keyframeId, + patch, + }), + ); + const command = + commands.length === 1 ? commands[0] : new BatchCommand(commands); + this.editor.command.execute({ command }); + } + upsertEffectParamKeyframe({ trackId, elementId, |
