From 401cc35743aafc4c8bdfb8055501650390bde88b Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Wed, 29 Apr 2026 10:37:39 +0200 Subject: refactor: animate params over time --- apps/web/src/core/managers/timeline-manager.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'apps/web/src/core/managers') diff --git a/apps/web/src/core/managers/timeline-manager.ts b/apps/web/src/core/managers/timeline-manager.ts index 5531f437..dfabca01 100644 --- a/apps/web/src/core/managers/timeline-manager.ts +++ b/apps/web/src/core/managers/timeline-manager.ts @@ -20,10 +20,9 @@ import { isElementMuted } from "@/timeline/audio-state"; import type { AnimationPath, AnimationInterpolation, - AnimationValue, - AnimationValueForPath, ScalarCurveKeyframePatch, } from "@/animation/types"; +import type { ParamValue } from "@/params"; import { getElementLocalTime, resolveAnimationPathValueAtTime, @@ -487,7 +486,7 @@ export class TimelineManager { elementId: string; propertyPath: AnimationPath; time: MediaTime; - value: AnimationValue; + value: ParamValue; interpolation?: AnimationInterpolation; keyframeId?: string; }>; @@ -538,7 +537,7 @@ export class TimelineManager { // Pre-sample values at playhead for each (element, property) pair. // This preserves "what you see is what you get" when all keyframes are deleted. const playheadTime = this.editor.playback.getCurrentTime(); - const valueAtPlayheadMap = new Map(); + const valueAtPlayheadMap = new Map(); for (const { trackId, elementId, propertyPath } of keyframes) { const key = `${elementId}:${propertyPath}`; @@ -559,9 +558,7 @@ export class TimelineManager { }); const target = resolveAnimationTarget({ element, path: propertyPath }); - const baseValue = - (target?.getBaseValue() as AnimationValueForPath | null) ?? - null; + const baseValue = target?.getBaseValue() ?? null; if (baseValue === null) { valueAtPlayheadMap.set(key, null); continue; -- cgit v1.3.1