Cartoon: rig, movimento e lip sync dos personagens

- cartoon/src/rig.ts, motion.ts e lipsync.ts: esqueleto do personagem,
  curvas de movimento e sincronia labial no estilo Cartoon (Remotion)
- CharacterFigure/CharacterCard/Shot/overlays e spec atualizados
- Painel: estúdio de personagens e montagem cartoon ajustados
- Documentação em doc/cartoon/animacao.md e personagens.md; skill atualizada

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 23:39:12 -03:00
co-authored by Claude Opus 5.5
parent 0050cf60a7
commit 3f600c55b1
25 changed files with 1418 additions and 215 deletions
+17 -6
View File
@@ -3,7 +3,7 @@
import React from "react";
import { AbsoluteFill, useCurrentFrame, useVideoConfig } from "remotion";
import { CharacterFigure } from "./CharacterFigure";
import { TagLabel } from "./overlays";
import { Grain, TagLabel } from "./overlays";
import { loadFonts } from "./theme";
import type { CharacterLook, Expression, Pose } from "./character";
import type { IconId } from "./spec";
@@ -13,25 +13,36 @@ loadFonts();
export type CardProps = {
width: number; height: number;
background?: string;
/** "face": enquadra só a cabeça (conferir expressões de perto). */
framing?: "full" | "face";
figures: { look: CharacterLook; expression?: Expression; pose?: Pose; item?: IconId; label?: string }[];
};
export function CharacterCard({ figures, background = "#2a2e45" }: CardProps) {
export function CharacterCard({ figures, background = "#2a2e45", framing = "full" }: CardProps) {
const frame = useCurrentFrame();
const { fps } = useVideoConfig();
const n = Math.max(1, figures.length);
return (
<AbsoluteFill style={{ background, containerType: "size" }}>
<div style={{ position: "absolute", inset: "8% 2% 4%", display: "grid", gridTemplateColumns: `repeat(${n}, 1fr)`, alignItems: "end" }}>
<div style={{ position: "absolute", inset: "8% 2% 4%", display: "grid", gridTemplateColumns: `repeat(${n}, minmax(0, 1fr))`, alignItems: "end" }}>
{figures.map((f, i) => (
<div key={i} style={{ position: "relative", height: "100%", display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "flex-end" }}>
{f.label && <div style={{ marginBottom: "4%" }}><TagLabel text={f.label} size={n > 3 ? 2.2 : 3.4} /></div>}
<div style={{ width: "90%", aspectRatio: "200 / 440", maxHeight: "86%" }}>
<CharacterFigure look={f.look} expression={f.expression} pose={f.pose} item={f.item} t={frame / fps} />
</div>
{framing === "face" ? (
<div style={{ width: "92%", aspectRatio: "1 / 1", overflow: "hidden", position: "relative" }}>
<div style={{ position: "absolute", left: "-60%", top: "-64%", width: "220%", aspectRatio: "200 / 440" }}>
<CharacterFigure look={f.look} expression={f.expression} pose={f.pose} item={f.item} t={frame / fps} />
</div>
</div>
) : (
<div style={{ width: "90%", aspectRatio: "200 / 440", maxHeight: "86%" }}>
<CharacterFigure look={f.look} expression={f.expression} pose={f.pose} item={f.item} t={frame / fps} />
</div>
)}
</div>
))}
</div>
<Grain />
</AbsoluteFill>
);
}