{"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":774,"sourceCode":"}): string => {\n\tconst initiallyParsedOutputRange = outputRange.map(\n\t\tparseStringInterpolationValue,\n\t);\n\tconst hasAxisRotation = initiallyParsedOutputRange.some(\n\t\t(parsed) => parsed.axisRotation,\n\t);\n\tconst parsedOutputRange = hasAxisRotation\n\t\t? initiallyParsedOutputRange.map((parsed) => {\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\treturn {\n\t\t\t\t\tkind: 'rotate' as const,\n\t\t\t\t\tvalues: [0, 0, 1, parsed.values[0]] as [\n\t\t\t\t\t\tnumber,\n\t\t\t\t\t\tnumber,\n\t\t\t\t\t\tnumber,\n\t\t\t\t\t\tnumber,\n\t\t\t\t\t],\n\t\t\t\t\tunits: [null, null, null, parsed.units[0]] as [\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\tstring | null,\n\t\t\t\t\t],","sourceCodeStart":756,"sourceCodeEnd":792,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/interpolate.ts#L756-L792","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":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}