MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / summarizeMotion

Function summarizeMotion

packages/cli/src/commands/keyframes.ts:490–505  ·  view source on GitHub ↗
(tweens: SurfacedTween[], sel: string)

Source from the content-addressed store, hash-verified

488// or orbit returning to its start — still reveals its travel instead of reading
489// static (0→0).
490function summarizeMotion(tweens: SurfacedTween[], sel: string): string {
491 const ranges = new Map<string, { min: number; max: number }>();
492 const kfs = tweens
493 .filter((t) => t.target === sel && t.method !== "set")
494 .flatMap((t) => t.keyframes);
495 for (const kf of kfs) {
496 for (const [k, v] of Object.entries(kf.properties)) {
497 const n = num(v);
498 if (n !== null) bumpRange(ranges, k, n);
499 }
500 }
501 const varying = [...ranges.entries()]
502 .filter(([, r]) => r.max - r.min > 0.5)
503 .map(([k, r]) => `${k} ${Math.round(r.min)}..${Math.round(r.max)}`);
504 return varying.length ? varying.join(", ") : "(static)";
505}
506
507function bumpRange(ranges: Map<string, { min: number; max: number }>, k: string, n: number): void {
508 const r = ranges.get(k);

Callers 1

attachComposedAncestorsFunction · 0.85

Calls 3

bumpRangeFunction · 0.85
entriesMethod · 0.80
numFunction · 0.70

Tested by

no test coverage detected