diff options
| author | Maze Winther <mazewinther@gmail.com> | 2026-04-26 04:04:30 +0200 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2026-04-26 04:04:30 +0200 |
| commit | 0b7597b31fa956c7f3d4838923b545ba5e341422 (patch) | |
| tree | 6b360add6e4e22a422736bc9ddccdf13097bd044 /apps/web/src/graphics/index.ts | |
| parent | 6a22a3ecbdff2d0e6a4c24c8db40bb86bc01b692 (diff) | |
| download | opencut-0b7597b31fa956c7f3d4838923b545ba5e341422.tar.gz | |
refactor: split animation helpers by domain
Diffstat (limited to 'apps/web/src/graphics/index.ts')
| -rw-r--r-- | apps/web/src/graphics/index.ts | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/apps/web/src/graphics/index.ts b/apps/web/src/graphics/index.ts index c69a4ab0..3f277d40 100644 --- a/apps/web/src/graphics/index.ts +++ b/apps/web/src/graphics/index.ts @@ -1,3 +1,5 @@ +import { resolveGraphicParamsAtTime } from "@/animation";
+import type { ElementAnimations } from "@/animation/types";
import { buildDefaultParamValues } from "@/params/registry";
import type { ParamValues } from "@/params";
import { graphicsRegistry } from "./registry";
@@ -68,6 +70,28 @@ export function resolveGraphicParams( };
}
+export function resolveGraphicElementParamsAtTime({
+ element,
+ localTime,
+}: {
+ element: {
+ definitionId: string;
+ params: ParamValues;
+ animations?: ElementAnimations;
+ };
+ localTime: number;
+}): ParamValues {
+ const definition = getGraphicDefinition({
+ definitionId: element.definitionId,
+ });
+ return resolveGraphicParamsAtTime({
+ params: resolveGraphicParams(definition, element.params),
+ definitions: definition.params,
+ animations: element.animations,
+ localTime,
+ });
+}
+
export function buildGraphicPreviewUrl({
definitionId,
params,
|
