{"record":{"id":"91b8ad8477cb218c","repo":"remotion-dev/remotion","slug":"cannot-interpolate-a-multi-angle-rotate-value-with","errorCode":null,"errorMessage":"Cannot interpolate a multi-angle rotate value with an axis rotation","messagePattern":"Cannot interpolate a multi-angle rotate value with an axis rotation","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/core/src/interpolate.ts","lineNumber":823,"sourceCode":"\t);\n\tconst posterizedInput =\n\t\toptions?.posterize === undefined\n\t\t\t? input\n\t\t\t: Math.floor(input / options.posterize) * options.posterize;\n\tconst segmentIndex =\n\t\tinputRange.length === 1 ? 0 : findRange(posterizedInput, inputRange);\n\tconst parsedOutputRange = hasAxisRotation\n\t\t? initiallyParsedOutputRange.map((parsed, index) => {\n\t\t\t\tif (parsed.kind !== 'rotate') {\n\t\t\t\t\treturn parsed;\n\t\t\t\t}\n\n\t\t\t\tif (parsed.axisRotation) {\n\t\t\t\t\treturn parsed;\n\t\t\t\t}\n\n\t\t\t\tif (parsed.dimensions !== 1) {\n\t\t\t\t\tthrow new TypeError(\n\t\t\t\t\t\t'Cannot interpolate a multi-angle rotate value with an axis rotation',\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// A zero-degree rotation is the identity regardless of its axis. Reusing\n\t\t\t\t// the active neighbor's axis prevents the axis from drifting while the\n\t\t\t\t// angle interpolates away from zero.\n\t\t\t\tconst adjacentAxisRotation =\n\t\t\t\t\tparsed.values[0] === 0\n\t\t\t\t\t\t? index === 0\n\t\t\t\t\t\t\t? initiallyParsedOutputRange.find(\n\t\t\t\t\t\t\t\t\t(candidate) => candidate.axisRotation,\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t: index === initiallyParsedOutputRange.length - 1\n\t\t\t\t\t\t\t\t? [...initiallyParsedOutputRange]\n\t\t\t\t\t\t\t\t\t\t.reverse()\n\t\t\t\t\t\t\t\t\t\t.find((candidate) => candidate.axisRotation)\n\t\t\t\t\t\t\t\t: index === segmentIndex","sourceCodeStart":805,"sourceCodeEnd":841,"githubUrl":"https://github.com/remotion-dev/remotion/blob/46a3a6bf13ca367376ff18bbb06dae2e87e0d068/packages/core/src/interpolate.ts#L805-L841","documentation":"Thrown by interpolateString when the outputRange mixes an axis-rotation form (e.g. \"x 45deg\", \"1 0 0 45deg\") with a plain multi-angle rotate value that has more than one angle (e.g. \"45deg 30deg\"). Axis rotations carry a fixed 4-dimensional vector (x,y,z,angle); promoting a 2-or-3-angle rotate to that form would be ambiguous, so Remotion refuses it.","triggerScenarios":"interpolate(input, inputRange, outputRange) where one element parses as an axis rotation and another as a multi-angle rotate, e.g. [\"45deg 30deg\", \"1 0 0 60deg\"] or [\"x 0deg\", \"10deg 20deg\"].","commonSituations":"Animating between a 2D planar rotation and a 3D axis rotation; mixing rotateX/Y/Z syntax with multi-angle rotate syntax in the same call.","solutions":["Make every output an axis rotation: \"0 0 1 45deg\" instead of \"45deg 30deg\", paired with \"1 0 0 60deg\".","Or make every output a plain 1-angle rotate: \"45deg\" and \"60deg\" (then it auto-promotes to z-axis rotation).","Avoid 2-3 angle rotate forms entirely; they are uncommon and combine poorly with axis rotations."],"exampleFix":"// before\ninterpolate(t, [0, 1], [\"45deg 30deg\", \"1 0 0 60deg\"]);\n// after\ninterpolate(t, [0, 1], [\"0 0 1 45deg\", \"1 0 0 60deg\"]);","handlingStrategy":"validation","validationCode":"function isAxisRotationForm(value: string): boolean {\n  const parts = value.trim().split(/\\s+/);\n  if (parts.length === 2 && /^(x|y|z)$/i.test(parts[0])) return true;\n  if (parts.length === 4) {\n    const axis = parts.slice(0, 3).map(Number);\n    return axis.every(Number.isFinite);\n  }\n  return false;\n}\n\nfunction rotateDimensions(value: string): number {\n  return value.trim().split(/\\s+/).length;\n}\n\nconst hasAxis = outputRange.some((o) => typeof o === 'string' && isAxisRotationForm(o));\nif (hasAxis) {\n  outputRange.filter((o) => typeof o === 'string').forEach((o) => {\n    if (!isAxisRotationForm(o) && rotateDimensions(o) > 1) {\n      throw new Error(`Multi-angle rotate \"${o}\" cannot mix with axis rotations`);\n    }\n  });\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When mixing 2D and 3D rotations, express every output as an axis rotation (\"0 0 1 angle\").","Avoid 2- or 3-angle rotate forms; they don't combine with axis rotations."],"tags":["interpolate","rotate","axis-rotation","validation"],"backgroundTag":null,"analyzedSha":"46a3a6bf13ca367376ff18bbb06dae2e87e0d068","analyzedAt":"2026-08-12T17:18:50.444Z","contentChangedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}