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

Function handleAddGsapKeyframe

packages/sdk/src/engine/mutate.ts:1285–1305  ·  view source on GitHub ↗
(
  parsed: ParsedDocument,
  animationId: string,
  percentage: number,
  value: Record<string, unknown>,
)

Source from the content-addressed store, hash-verified

1283}
1284
1285function handleAddGsapKeyframe(
1286 parsed: ParsedDocument,
1287 animationId: string,
1288 percentage: number,
1289 value: Record<string, unknown>,
1290): MutationResult {
1291 const script = getGsapScript(parsed.document);
1292 if (!script) throw new Error("No GSAP script block found in the composition.");
1293 const props = value as Record<string, number | string>;
1294 const newScript = addKeyframeToScript(
1295 script,
1296 animationId,
1297 percentage,
1298 props,
1299 undefined,
1300 deriveKeyframeBackfillDefaults(props),
1301 );
1302 if (newScript === script) return EMPTY;
1303 setGsapScript(parsed.document, newScript);
1304 return gsapScriptChange(script, newScript);
1305}
1306
1307function handleRemoveGsapKeyframeByPercentage(
1308 parsed: ParsedDocument,

Callers 1

applyGsapKeyframeOpFunction · 0.85

Calls 5

getGsapScriptFunction · 0.85
setGsapScriptFunction · 0.85
gsapScriptChangeFunction · 0.85
addKeyframeToScriptFunction · 0.50

Tested by

no test coverage detected