Обновлено: 2026-06-10
Theatre.js — библиотека для создания сложных таймлайнов анимации. Позволяет задавать keyframes, кривые и последовательности, как в видеоредакторах.
Используйте @theatre/r3f для связи Theatre.js с React Three Fiber:
import { editable as e } from "@theatre/r3f";
<e.mesh theatreKey="box">
<boxGeometry args={[1, 1, 1]} />
<meshStandardMaterial color="hotpink" />
</e.mesh>
import { getProject } from "@theatre/core";
const project = getProject("My Project");
const sheet = project.sheet("Scene");
const obj = sheet.object("Box", { x: 0, y: 0, z: 0 });
// Анимация
obj.props.x.set(2, 1000); // x = 2 за 1 секунду
npm install @theatre/core
Для R3F: @theatre/r3f (если доступен) или ручная привязка через useFrame.