Estilo Cartoon (Remotion), personagens reaproveitáveis e hashtags do TikTok

Estilo Cartoon (novo, sem Godot)
- Pacote cartoon/ (Remotion 4.0.535): cada trecho é um spec JSON desenhado
  em React/SVG e renderizado em MP4; render em lote (empacota uma vez) e
  imagem parada (--still).
- Cenas montadas por peças, sem cenário pronto: paletas (noite, sépia, dia,
  entardecer, cinza), lugar com chão, interno/externo, névoa e 24 peças
  posicionadas por profundidade, foco de luz e vinheta; etiquetas,
  onomatopeias, ondas de som, X vermelho, painel do topo e legenda palavra
  por palavra.
- Montagem documental: "Cartoon" como estilo do vídeo e tipo de visual do
  trecho; plano por regras pelo texto (lugar, objetos, expressão, pose),
  tempos das palavras pela transcrição do áudio, "Gerar de novo" por trecho,
  paleta da série e elenco da história.

Personagens
- Aba Personagens: criar pela descrição, ajustar peça por peça com prévia
  ao vivo, refinar com o agente (tarefa nova "Personagem"); fichas em
  assets/characters/ e elenco em stories/<id>/cast.json. O mesmo personagem
  sai igual em qualquer cena, mudando expressão, pose e objeto na mão.

TikTok
- Hashtags passam a ser digitadas e confirmadas na lista de sugestões do
  TikTok Studio (coladas, viravam texto). Diagnóstico de alcance em
  doc/publicacao/TIKTOK_DIAGNOSTICO.md.

Docs: estudo das referências, doc/cartoon/ (personagens e cenas) e skill
cenaforge 1.46.0.

Testes: painel 77/77, cartoon 5/5, Publicador 87/87.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 21:36:48 -03:00
co-authored by Claude Opus 5.5
parent e7ccc91736
commit 0050cf60a7
55 changed files with 5808 additions and 50 deletions
+87
View File
@@ -0,0 +1,87 @@
// Um trecho do estilo Cartoon: cena de fundo + personagens + objetos + textos + HUD + legenda, com a câmera
// fazendo um empurrão lento (nunca fica parado, como na referência).
import React from "react";
import { AbsoluteFill, useCurrentFrame, useVideoConfig } from "remotion";
import { CrowdFigure, PersonFigure } from "./actors";
import { Icon } from "./icons";
import { Captions, CrossOut, Hud, Rings, TagLabel, TextLayer, pop, shake } from "./overlays";
import { SceneBackground } from "./scenes";
import { CharacterFigure } from "./CharacterFigure";
import { LightLayer } from "./places";
import type { ShotSpec } from "./spec";
import { loadFonts } from "./theme";
loadFonts();
export function Shot(spec: ShotSpec) {
const frame = useCurrentFrame();
const { fps, durationInFrames, width, height } = useVideoConfig();
const progress = durationInFrames > 1 ? frame / (durationInFrames - 1) : 0;
const push = spec.camera?.push ?? (spec.scene.kind === "card" ? 1 : 1.07);
const zoom = 1 + (push - 1) * progress;
return (
<AbsoluteFill style={{ background: "#07080f", containerType: "size", overflow: "hidden" }}>
<AbsoluteFill style={{ transform: `scale(${zoom})`, transformOrigin: "50% 45%" }}>
<SceneBackground spec={spec} frame={frame} progress={progress} />
{(spec.actors ?? []).map((a, i) => {
const k = pop(frame, fps, a.enterS ?? 0);
if (a.kind === "crowd") {
return (
<div key={i} style={{ position: "absolute", left: "-2%", width: "104%", top: `${(a.y - 0.16) * 100}%`, height: "16%",
opacity: k, transform: `translateY(${(1 - k) * 8}%)` }}>
<CrowdFigure c={a} frame={frame} />
</div>
);
}
if (a.character) {
// Personagem da biblioteca: mesmo visual em toda cena; muda expressão, pose e objeto na mão.
const ch = height * 0.36 * (a.scale ?? 1);
const cw = (ch * 200) / 440;
const label = a.label ?? a.character.name;
return (
<div key={i} style={{ position: "absolute", left: a.x * width - cw / 2, top: a.y * height - ch, width: cw, height: ch,
opacity: Math.min(1, k * 1.5), transform: `translateY(${(1 - k) * 10}%) scaleX(${a.flip ? -1 : 1})` }}>
<CharacterFigure look={a.character.look} expression={a.expression} pose={a.pose} item={a.item} t={frame / fps} />
{label && (
<div style={{ position: "absolute", left: "50%", top: "-15%", transform: `translateX(-50%) scaleX(${a.flip ? -1 : 1})`, textAlign: "center" }}>
<TagLabel text={label} />
{a.character.caption && <div style={{ marginTop: "0.6cqw" }}><TagLabel text={a.character.caption} tone="ok" size={2.4} /></div>}
</div>
)}
</div>
);
}
const h = height * 0.27 * (a.scale ?? 1);
return (
<div key={i} style={{ position: "absolute", left: a.x * width - (h * 200) / 420 / 2, top: a.y * height - h, width: (h * 200) / 420,
height: h, opacity: Math.min(1, k * 1.5), transform: `translateY(${(1 - k) * 12}%)` }}>
<PersonFigure p={a} frame={frame} fps={fps} />
{a.label && <div style={{ position: "absolute", left: "50%", top: "-14%", transform: "translateX(-50%)" }}><TagLabel text={a.label} /></div>}
</div>
);
})}
{(spec.props ?? []).map((p, i) => {
const k = pop(frame, fps, p.enterS ?? 0);
if (k <= 0.001) return null;
const size = height * (p.size ?? 0.16);
const s = p.shake ? shake(frame, 2.5) : { x: 0, y: 0 };
const cross = p.crossed ? pop(frame, fps, (p.enterS ?? 0) + 0.5, 90) : 0;
return (
<div key={i} style={{ position: "absolute", left: p.x * width - size / 2 + s.x, top: p.y * height - size / 2 + s.y, width: size, height: size,
transform: `scale(${0.5 + 0.5 * k})`, opacity: Math.min(1, k * 1.5) }}>
{p.rings && <div style={{ position: "absolute", inset: "-60%" }}><Rings frame={frame} fps={fps} /></div>}
<Icon id={p.icon} />
{p.crossed && <div style={{ position: "absolute", inset: "-8%" }}><CrossOut k={cross} /></div>}
{p.label && <div style={{ position: "absolute", left: "50%", top: "-22%", transform: "translateX(-50%)" }}><TagLabel text={p.label} tone={p.tone} /></div>}
</div>
);
})}
<LightLayer light={spec.light} palette={spec.palette} />
{(spec.texts ?? []).map((t, i) => <TextLayer key={i} t={t} frame={frame} fps={fps} />)}
</AbsoluteFill>
{spec.hud && <Hud hud={spec.hud} frame={frame} fps={fps} />}
{spec.words?.length ? <Captions words={spec.words} frame={frame} fps={fps} /> : null}
</AbsoluteFill>
);
}