remotion-spline
13
总安装量
4
周安装量
#24600
全站排名
安装命令
npx skills add https://github.com/oren-hollander/remotion-spline --skill remotion-spline
Agent 安装分布
claude-code
3
codex
2
gemini-cli
2
amp
1
opencode
1
Skill 文档
Remotion Spline Skill
Use the remotion-spline package’s standalone spline functions to create smooth path animations in Remotion compositions.
Available Functions
import {
evaluateLinearSpline,
linearSplineToSVGPath,
evaluateCatmullRom,
catmullRomToSVGPath,
type Point2D,
} from "remotion-spline";
Point2D
interface Point2D {
readonly x: number;
readonly y: number;
}
Linear Spline
evaluateLinearSpline(points: Point2D[], t: number): [number, number]â Evaluate position at parametert(clamped to [0,1]) along a piecewise-linear path throughpoints.linearSplineToSVGPath(points: Point2D[]): stringâ Convert points to an SVGM ... L ...path string.
Catmull-Rom Spline
evaluateCatmullRom(points: Point2D[], t: number): [number, number]â Evaluate position at parametert(clamped to [0,1]) along a centripetal Catmull-Rom spline throughpoints. Produces a smooth curve that passes through all control points.catmullRomToSVGPath(points: Point2D[]): stringâ Convert points to an SVG cubic Bezier path (M ... C ...) that matches the Catmull-Rom curve.
All functions require at least 2 points.
Pattern: Animated Position Along a Spline
import { useCurrentFrame, useVideoConfig } from "remotion";
import { evaluateCatmullRom, catmullRomToSVGPath, type Point2D } from "remotion-spline";
const points: Point2D[] = [
{ x: 100, y: 500 },
{ x: 300, y: 200 },
{ x: 600, y: 400 },
];
export const MyAnimation: React.FC = () => {
const frame = useCurrentFrame();
const { durationInFrames } = useVideoConfig();
const t = frame / (durationInFrames - 1);
const [x, y] = evaluateCatmullRom(points, t);
const pathD = catmullRomToSVGPath(points);
return (
<svg viewBox="0 0 800 800">
{/* Static path */}
<path d={pathD} stroke="blue" strokeWidth="2" fill="none" />
{/* Animated dot */}
<circle cx={x} cy={y} r="10" fill="red" />
</svg>
);
};
Tips
t=0returns the first point,t=1returns the last point.- Values outside [0,1] are clamped automatically.
- Catmull-Rom splines produce smooth curves through all control points â no need to manually compute Bezier handles.
- Use
linearSplineToSVGPath/catmullRomToSVGPathfor static path rendering (racing lines, trails, guides). - Use
evaluateLinearSpline/evaluateCatmullRomwith a time-varyingtfor animated position.