Skip to content

艺术动画skill:35种艺术风格、9种解说语法,用代码让画动起来。

feat: add reusable Rick and Morty SVG style as style 36

alchaincyf2571ee0a9a04
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7136112..3db5cd5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -33,3 +33,7 @@
- 2026-10-10 · 一套画风、去掉蓝紫、角色要么到位要么不出脸(改动包E)。依据:作者第一轮盲选 8 组只有 3 组选新版,输的两组都选了「整片一套配色、干净统一」的旧片,没选「每镜换一种画风」的拼贴;另有两组两支都不要,原话「颜色和人的风格形象都有些ai slop」,并追加「规避蓝、紫渐变的垃圾配色」「小人和机器人角色都太差了,要自己定义精细度和用力的要求」。改动:轨道档删掉「全片至少 3 种画面做法」(它逼出了拼贴),改成镜头表表前锁「画风/色板/角色」三行、所有片段写同一个 `theme`、最多 2 种片段语法;新增 `references/色板.md`(八套色板与蓝紫禁区)、`references/角色精细度.md`(三条路+帧库角色八条交付线+物不加脸);「五种做坏方式」加第六种「一眼 AI 味」。引擎:新增 `lib/palettes.js`,`spec.theme` 可写色板名或对象,8 个语法都按它上色、不画大面积渐变和霓虹;y1 默认天空从深紫渐变改为深墨平涂,y1/y4/t2 默认色里的紫、品红、紫蓝换掉;y4 只接受角色帧库,代码画的预设小人停用,样例改成占位帧库路径。检查:`storyboard_lint` 新增 ⑫画风锁(缺行红)、⑬色板(蓝紫色值红,写「允许蓝紫」降黄)、⑭角色(代码画小人/机器人/y4 无帧库红,给物长脸黄),删掉「做法少于 3 种」改为「片段语法超过 2 种」红;`film_gate` 新增第三条门禁「蓝紫底画面时长占比」(≥0.30 红、≥0.12 黄;88 支片标定,作者认可的最高 0.10,否掉的 0.46–1.00),`--allow-blue-purple "理由"` 降黄并写进交付说明事实段。t3 的 `"paper"` 主题现在指纸本色板(以前是 FT 粉)。
- 2026-10-10 · 回流私有版时补三处:`角色精细度.md` 加例外「全片主角、过了三方向硬门的拟物角色可以有脸」(来源:作者给宣传片定的有脸卡通画笔,无脸版被判「太正式了太无聊了」),停用的是顺手给金币、小球、离子画的表情包脸;SKILL.md「验收」一段的门禁描述补上蓝紫底、改成「六种做坏方式」;`tests/test_film_gate.py` 的示意图缺 `assets/showcase/hero.png` 时改用样例图表截图。
- 2026-10-12 · 镜头规则重写:从「每个口播节点快推」改成「镜头是标点」。依据:一支 102 秒的诺奖经济学短片推近约 48 次、全部往里推,作者原话「次数太多,而且节奏太快了,一点都不smooth」,并指出最近几支都这样。原规则来自一次四样同时改的对照,被写成全局 0.28s 快推,再经窄桥、引擎默认、片段 highlight、镜头表检查、门禁修法文本、qa 只认 0.35s 内推镜层层加固。改动:SKILL.md 新增「导演的要求:镜头怎么用/画风怎么选」;新增 `references/镜头语言.md`(动作表、每个数的生效条件、次数什么时候管、满幅素材的坑);`CAM.track` 新增 push/glide/pull,不写 kind 默认缓推 0.9s;t2/y1/y2 highlight 默认缓推,spec 顶层 `data.camera:"snap"` 才快推;`storyboard_lint` 新增 ⑮连续三镜往里推、⑯重音超过三分之一;`film_gate` 新增「推近次数」黄灯并改修法文本;`qa` 认 2 秒内平滑单调的推拉横移;修 t2 满幅横移时模糊底越界、出场屏被提前裁掉。验证:同一个 DeepSeek、同一段 28 秒口播和素材,隔离沙盒里跑改前与改后两版:推近 15→8 次、0.5 秒内快推 14→2 次;作者并排盲看选了改后版(「a相对好一点」)。
+
+## 2026-10-14 · Rick & Morty风格
+
+新增第36张风格配方(37_rick_morty)、可独立运行的SVG场景、参数化动作与逐帧渲染器;入口明确SVG与Canvas的接入边界。
diff --git a/README.en.md b/README.en.md
index 280334e..599d530 100644
--- a/README.en.md
+++ b/README.en.md
@@ -8,7 +8,7 @@
Let your coding agent turn art styles into paintings that move.
-35 art styles · 9 explainer animation grammars · 8 types of parameterized clips · Reference code for narrated films
+36 art styles · 9 explainer animation grammars · 8 types of parameterized clips · Reference code for narrated films
```sh
npx skills add alchaincyf/huashu-art-motion
@@ -95,7 +95,7 @@ Eight explainer animation grammars each have a runnable demo film; the images be
| You ask | It does |
|---|---|
| “Recreate this animation” or “Break down this clip” | Runs the breakdown script to measure transitions, a beat grid, and motion heatmaps for each segment, then recreates the underlying mechanisms in code |
-| “Make an animation in the style of Van Gogh, Monet, or Bauhaus” | Designs one frame first, then animates it; 35 style recipe cards provide starting points |
+| “Make an animation in the style of Van Gogh, Monet, or Bauhaus” | Designs one frame first, then animates it; 36 style recipe cards provide starting points |
| “Make an art animation from my narration” | Builds a shot list → chooses styles → adds a camera to a world canvas → outputs a visual track |
| “Make a film of someone walking through famous paintings” | Uses the long-scroll skeleton: one segment file per world, a hero moving rightward, style changes at boundaries, and a camera that only moves forward |
| “Make an animated segment for an explainer video” | Chooses a grammar for the narration and renders a JSON spec into a frame-accurate clip, in landscape or portrait, with optional transparency |
@@ -110,7 +110,7 @@ Before delivery, `qa.py` measures stability, efficiency, motion, smoothness, and
| Component | Quantity / location |
|---|---|
-| Art-style recipe cards: parameters, motif motion, signature transitions, and current limitations | 35 cards in `references/风格配方/` |
+| Art-style recipe cards: parameters, motif motion, signature transitions, and current limitations | 36 cards in `references/风格配方/` |
| Corresponding scene code | 35 scenes in `scripts/engine/scenes/` |
| Explainer animation grammar cards | 9 cards; 8 include demo films, parameterized clips, and example specs |
| Reference code for narrated films | Mixed styles, whiteboard, Vox, and presenter-led explainers; some assets must be supplied separately—see the directory READMEs |
@@ -122,7 +122,7 @@ Before delivery, `qa.py` measures stability, efficiency, motion, smoothness, and
```text
huashu-art-motion/
├── SKILL.md # Classify the task, then read the relevant documents
-├── references/ # Methods 01–12, 35 style recipes, 9 grammar cards, proven practices
+├── references/ # Methods 01–12, 36 style recipes, 9 grammar cards, proven practices
├── assets/ # Overview images used in the README
└── scripts/
├── engine/ # Portable animation project: engine, transitions, libraries, scenes, demos, clips
@@ -222,3 +222,7 @@ Start with `python scripts/capabilities.py status --explain`. New capabilities a
## Thanks for the feedback
Thanks to [@ismilewolf-eng](https://github.com/ismilewolf-eng) ([PR #1](https://github.com/alchaincyf/huashu-art-motion/pull/1)) and [@noahark](https://github.com/noahark) ([PR #2](https://github.com/alchaincyf/huashu-art-motion/pull/2)) for proposed fixes and validation of concurrent-loading failures on Windows; [@nctt777-hue](https://github.com/nctt777-hue) ([Issue #3](https://github.com/alchaincyf/huashu-art-motion/issues/3)) for detailed reproductions, controlled experiments, and retesting; and [@GFXfly](https://github.com/GFXfly) for additional macOS troubleshooting feedback. Their reports helped fix concurrent loading in the local servers used for rendering and QA.
+
+## Style 36: Rick & Morty
+
+A [recipe](references/风格配方/37_rick_morty.md) and [standalone SVG example](scripts/engine/reference_films/rick_morty/index.html) add offline playback, deterministic seeking, gaze/blink/sip/jump controls, and frame-by-frame video export. Internal ID: 37_rick_morty; 36_picasso_blue is already used. The historical 35-frame overview and Canvas gallery do not include this SVG example. Download the folder and open index.html locally; see the recipe for rendering commands.
diff --git a/README.md b/README.md
index 8b3e832..ebb0012 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@
让你的coding agent,把艺术风格写成会动的画。
-35种艺术风格 · 9种解说语法 · 8种参数化片段 · 口播整片参考代码
+36种艺术风格 · 9种解说语法 · 8种参数化片段 · 口播整片参考代码
```sh
npx skills add alchaincyf/huashu-art-motion
@@ -93,7 +93,7 @@ Claude Code 的像素吉祥物 Clawd 从保安电脑的终端里蹦出来,打
| 你说 | 它做 |
|---|---|
| 「复刻这个动画」「拆一下这段」 | 先跑拆解脚本量出转场、节拍网格、每段运动热图,再按机制用代码复刻 |
-| 「做个梵高/莫奈/包豪斯那种的动画」 | 先设计一帧,再让它动起来;35张风格配方卡当起点 |
+| 「做个梵高/莫奈/包豪斯那种的动画」 | 先设计一帧,再让它动起来;36张风格配方卡当起点 |
| 「用我的口播做一段艺术动画」 | 镜头表 → 定风格 → 世界画布加镜头 → 输出一条画面轨 |
| 「做一个人穿过一幅幅名画的片子」 | 长卷骨架:每个世界一个段文件,主角一路往右走,跨边界换画风,镜头只进不退 |
| 「做解说视频的动画段」 | 按口播选语法,喂一份 JSON,出一段时长精确到帧的片段(横竖屏、可透明底) |
@@ -108,7 +108,7 @@ Claude Code 的像素吉祥物 Clawd 从保安电脑的终端里蹦出来,打
| | 数量 |
|---|---|
-| 艺术风格配方卡(参数、母题动作、签名转场、当前短板) | 35张,`references/风格配方/` |
+| 艺术风格配方卡(参数、母题动作、签名转场、当前短板) | 36张,`references/风格配方/` |
| 对应的场景代码 | 35个,`scripts/engine/scenes/` |
| 解说动画语法卡 | 9份;其中8种附示范片、参数化片段与示例spec |
| 口播整片参考代码 | 混合风格、白板、Vox、讲解员;需自备部分素材,详见目录README |
@@ -120,7 +120,7 @@ Claude Code 的像素吉祥物 Clawd 从保安电脑的终端里蹦出来,打
```
huashu-art-motion/
├── SKILL.md # 先判断任务,再按表读对应文档
-├── references/ # 01–12方法文档、35张风格配方卡、9张语法卡、正面经验
+├── references/ # 01–12方法文档、36张风格配方卡、9张语法卡、正面经验
├── assets/ # 总览图(README 用)
└── scripts/
├── engine/ # 可整个复制走的动画工程:引擎、转场、库、场景、示范片、片段
@@ -202,7 +202,7 @@ MIT License © [花叔 Huashu](https://github.com/alchaincyf)
## English
-**huashu-art-motion** is an agent skill for making animation with code, where the paintings actually move. It ships 35 art-style recipes (cave painting, Egyptian murals, Van Gogh, Klimt, Bauhaus, Kirby comics, 8-bit, vaporwave, Shinkai and more), each with a working Canvas scene, a style "renderer" and a signature transition; 8 explainer-video grammars (Kurzgesagt, Vox, whiteboard, storytime, kinetic type, 3Blue1Brown, keynote UI, finance charts) with demo films and parameterized clips you drive with a JSON spec, frame-accurate and in landscape, portrait or alpha; a long-scroll skeleton where a character walks left to right through one painting after another (3 sample worlds included); plus a breakdown script that maps a reference animation into cuts, beat grid and motion heatmaps, and a QA script that measures stability, cost per frame, motion and smoothness.
+**huashu-art-motion** is an agent skill for making animation with code, where the paintings actually move. It ships 36 art-style recipes (cave painting, Egyptian murals, Van Gogh, Klimt, Bauhaus, Kirby comics, 8-bit, vaporwave, Shinkai and more), with 35 Canvas scenes plus a standalone SVG Rick & Morty-style example; 8 explainer-video grammars (Kurzgesagt, Vox, whiteboard, storytime, kinetic type, 3Blue1Brown, keynote UI, finance charts) with demo films and parameterized clips you drive with a JSON spec, frame-accurate and in landscape, portrait or alpha; a long-scroll skeleton where a character walks left to right through one painting after another (3 sample worlds included); plus a breakdown script that maps a reference animation into cuts, beat grid and motion heatmaps, and a QA script that measures stability, cost per frame, motion and smoothness.
It started as a code-only recreation of Tak's ([@cherry_mx_reds](https://x.com/cherry_mx_reds/status/2106095190285144331)) 15-second *Art History Speedrun*. The scene layouts and the girl-and-cat premise follow his original; every frame here is redrawn in code, and no frames, screenshots or audio from the original are included.
@@ -222,3 +222,7 @@ Install: `npx skills add alchaincyf/huashu-art-motion`. Requires uv, ffmpeg and
## 感谢反馈
感谢[@ismilewolf-eng](https://github.com/ismilewolf-eng)([PR#1](https://github.com/alchaincyf/huashu-art-motion/pull/1))、[@noahark](https://github.com/noahark)([PR#2](https://github.com/alchaincyf/huashu-art-motion/pull/2))提供Windows并发加载故障的修复建议与验证,[@nctt777-hue](https://github.com/nctt777-hue)([Issue#3](https://github.com/alchaincyf/huashu-art-motion/issues/3))提供详细的复现、对照实验与复测,以及[@GFXfly](https://github.com/GFXfly)补充macOS排查反馈。这些反馈帮助我们修复了渲染与QA本地服务的并发加载问题。
+
+## 第36种:Rick & Morty风格
+
+新增[风格配方](references/风格配方/37_rick_morty.md)与[可复制示例](scripts/engine/reference_films/rick_morty/index.html):离线预览、拖时间、可控目光/眨眼/端杯/猫跳动和逐帧视频导出。内部ID是37_rick_morty(36_picasso_blue已占用)。这是独立SVG管线;上方35格历史总览和Canvas gallery不包含本例。下载后打开示例HTML即可预览,导出命令见配方。
diff --git a/SKILL.md b/SKILL.md
index 707b418..ba67171 100644
--- a/SKILL.md
+++ b/SKILL.md
@@ -1,11 +1,11 @@
---
name: huashu-art-motion
-description: "艺术与视频动画:拆解复刻动画;代码画35种艺术风格并让画活;9种解说动画语法,8种可按口播参数渲片段;含口播整片参考代码及框景检查;人用AI生帧;可选已有录音、系统声音与语音复刻,按需配置。"
+description: "艺术与视频动画:拆解复刻动画;代码画36种艺术风格并让画活;9种解说动画语法,8种可按口播参数渲片段;含口播整片参考代码及框景检查;人用AI生帧;可选已有录音、系统声音与语音复刻,按需配置。"
metadata:
author: "花叔"
homepage: "https://github.com/alchaincyf"
repository: "https://github.com/alchaincyf/huashu-art-motion"
- version: "1.0.0"
+ version: "1.1.0"
---
# 艺术动画
@@ -66,6 +66,10 @@ metadata:
5. **有真实素材却用代码去画**。→ 截图、照片、录像、原文直接满幅放,代码只负责解释、标注和运镜。
6. **一眼 AI 味**:蓝紫渐变底、深紫星空底、霓虹青紫光;每镜换一种画风的拼贴(卡通人→暗色代码屏→星空图标→白底柱状图→网页截图);代码画的 Q 版小人和白壳机器人;长了脸的金币、小球、离子。→ 表前锁一种画风、一套色板(`references/色板.md`),所有片段写同一个 `theme`;角色要么 AI 生帧过交付线,要么只出手和背影(`references/角色精细度.md`)。storyboard_lint 查画风锁、色板色值和角色行;deliver.py 量蓝紫底,蓝紫帧占全片 30% 以上红灯,不出片。干净统一但略像幻灯片的片子,胜过花哨的拼贴。
+## Rick & Morty风格入口
+
+第36种风格见[37_rick_morty](references/风格配方/37_rick_morty.md):SVG配方、离线预览、可控表演与独立渲染器。明确要求参考式扁平卡通时可用语义SVG画角色,优先遵循本卡;真人和其他人物仍用原角色路线。此例不走Canvas gallery。
+
## 先判断任务
| 用户说的 | 做什么 | 读 |
@@ -103,7 +107,7 @@ metadata:
## 开阔地:当起点,不当配额
-`风格配方/` 里 35 张卡(总表 `风格配方/INDEX.md`,分「材料层」和「时代标本」两张表)是实做的参数和坑,不是唯一画法。35 张样片和 `assets/全风格总览.jpg` 用的是同一个房间构图,那是艺术史速通片的机制,不是这些风格的构图;做新题材要为题材重新构图。表里标了每种的当前质量和短板,下一次做到它时先超越短板。你有更好的渲染器就去写,做出来和原作或参考并排给人看。新风格做完,把配方卡补进来。
+`风格配方/` 里 36 张卡(总表 `风格配方/INDEX.md`,分「材料层」和「时代标本」两张表)是实做的参数和坑,不是唯一画法。35 张样片和 `assets/全风格总览.jpg` 用的是同一个房间构图,那是艺术史速通片的机制,不是这些风格的构图;做新题材要为题材重新构图。表里标了每种的当前质量和短板,下一次做到它时先超越短板。你有更好的渲染器就去写,做出来和原作或参考并排给人看。新风格做完,把配方卡补进来。
## 工程
diff --git "a/references/\351\243\216\346\240\274\351\205\215\346\226\271/37_rick_morty.md" "b/references/\351\243\216\346\240\274\351\205\215\346\226\271/37_rick_morty.md"
new file mode 100644
index 0000000..cc2c804
--- /dev/null
+++ "b/references/\351\243\216\346\240\274\351\205\215\346\226\271/37_rick_morty.md"
@@ -0,0 +1,45 @@
+# 37_rick_morty · Rick & Morty扁平描边卡通
+
+来源:2026-10-14的SVG单帧复刻与动画实验。第36种入库风格;内部ID用37_rick_morty,避免覆盖已有36_picasso_blue。是独立画风,穿越其他画派只是可选叙事。
+
+## 起手必查
+
+- 本例是SVG管线,不能直接加入Canvas引擎的eras.js或用普通render.py录Canvas;否则SVG角色会漏掉。使用本例的render.py截图整页,或先导出视频再作为引擎clip接入。旧35种gallery和总览图保持原样,本例单独预览。
+- 示例只包含代码绘制的房间、少女和猫,不依赖原片截图、Rick/Morty人物资产或声音。迁移新题材时保留画法,重新安排场景。
+- 本画风允许按明确参考用语义SVG绘制角色,这是现有「角色用AI生帧」路线的窄例外;不推广到真人肖像或任意Q版角色。
+
+## 可运行起点
+
+将`scripts/engine/reference_films/rick_morty/`整个目录复制到项目。直接打开index.html可离线预览、播放和拖时间。Node、API和在线字体均不需要。
+
+```sh
+uv run --with playwright playwright install chromium
+uv run --with playwright python render.py --stills 0,1,2 --out 验证
+uv run --with playwright python render.py --from 0 --to 8 --fps 24 --out 风格36.mp4
+```
+
+视频导出另需ffmpeg。入口默认8秒无声,--to可指定更长的时间。逐帧接口`window.seek(t,state)`:t是非负秒;省略state自动端杯和转眼;传入state完全控制表演。state包含`look:[x,y]`、`catLook:[x,y]`(各轴-1..1)、`sip`、`catJump`、`gBlink`、`cBlink`(均0..1)。seek不累计状态,支持乱序渲染;自动眨眼和摆尾取决于t。
+
+文件分工:svg-kit.js提供圆角描边图元、曲线、种子纹理;room.js绘制分层角色及场景,颜色集中在C对象;index.html负责预览与seek;render.py负责整页逐帧截图和编码。
+
+## 画法与运动
+
+1920×1088原始坐标,viewBox为`0 4 1920 1080`。描边#222323、默认2.35px,圆端圆接;细节线1.6–2.6px。暖灰墙#cdbf96、木地#9b7752、肤色#efc4a0、天空#a7d6ea;硬边平涂,少量同色系暗面,低对比斑驳留在背景。人物和道具共用描边,不用写实光照补质感。
+
+脸靠轮廓比例、眼睑和嘴的少量曲线;大眼白、小点瞳孔,不画高光玻璃眼。头发尖角用mixedPath,脸颊与四肢用smoothPath。身体、头、手臂杯子、眼皮、瞳孔分组;先定静帧,再用原有锚点移动。尾巴用中心线+宽度生成闭合轮廓,禁止每帧换随机形状。
+
+默认表演:端杯慢抬、头部小角度转动、目光偏移、确定性眨眼、猫摆尾。catJump是正弦腾空进度,身体和尾巴共用位移;没有落地压缩和行走循环。端杯时肩部锚点保持原位,袖口跟随杯子。
+
+## 从参考帧迁移到其他场景
+
+先测构图与遮挡,再取区域中位色;深色描边阈值切连通色块可辅助测坐标,不能把自动描摹路径当角色骨架。将手、眼、脸、衣摆、家具按语义分组,静帧就是骨骼第0帧。走路需脚尖驱动两骨IK、按实际距离推进相位;本例没有走路rig,不能据此声称已经支持任意角色行走。
+
+正面角色横移容易剪刀腿:两脚基准拉开、缩小步幅、用目光转向;不镜像带不对称服饰的角色。地面物件以脚/底座y排序,墙面纹理用同形状裁剪。SVG与Canvas同页时用IIFE隔离模块;SVG滤镜的userSpaceOnUse区域用真实画布坐标,不能写0,0,1,1。
+
+## 验证与后续回流
+
+随附render.py使用Chromium的`--disable-partial-raster`,避免SVG局部栅格化带来的抗锯齿差异。2026-10-14独立复验:此配置下冷启动及[1,7,1,1,0,1]乱序取帧的t=1截图为0像素差;普通浏览器只保证DOM状态确定,不能宣称截图逐像素相同。
+
+每次修改至少在上述渲染配置下核同一时刻冷启动/乱序seek像素一致、两个时刻画面有变化、0与最大表情无裁切、浏览器无错误;再肉眼检查头身接缝和眼皮。示例质量暂列★★:可运行,造型和复杂动作仍有提升空间;不能把原车库复刻的轮廓分数移作本房间的相似度评分。
+
+使用前读本卡的短板;新发现按日期、场景、证据和验证状态写回本卡。旧结论失效先修改原句,单次经验不升级为全风格规则;复现稳定的故障优先改代码并测确定性。
diff --git "a/references/\351\243\216\346\240\274\351\205\215\346\226\271/INDEX.md" "b/references/\351\243\216\346\240\274\351\205\215\346\226\271/INDEX.md"
index dc704cd..31a1f67 100644
--- "a/references/\351\243\216\346\240\274\351\205\215\346\226\271/INDEX.md"
+++ "b/references/\351\243\216\346\240\274\351\205\215\346\226\271/INDEX.md"
@@ -1,4 +1,4 @@
-# 风格总索引(35 种,2026-10-05 更新)
+# 风格总索引(36 种,2026-10-14 更新)
> **先读这一句:35 张样片是同一个构图**(窗在左上、猫在左下、少女在右侧端杯;`assets/全风格总览.jpg` 也是)。那是艺术史速通那支片子的机制——风格在变、场景不变——不是这些风格的构图。做新题材要为题材重新构图:卡里的渲染器、笔法、色彩逻辑、母题动法可以拿走,房间里的坐标、角色、家具不要搬过去。
@@ -50,9 +50,10 @@
| 33_rubberhose | 1930 橡皮管卡通 | 派切眼、面条臂、白手套、12fps 步进、胶片划痕闪烁 | 一切按节拍弹跳 | (幕后点灯前的老片) | ★★★ | 运动大半是胶片噪声 |
| 34_shadowpuppet | 中国皮影 | 半透明牛皮镂空、铆钉关节、10fps 步进、幕后油灯 | 杆子操控僵直关节、手腕甩 | 幕后点灯 | ★★★ | 重叠处相乘发黑;121ms 偏慢 |
| 36_picasso_blue | 毕加索蓝色时期 | 单色蓝调、宽笔触、普鲁士蓝粗轮廓、人体拉长 | 缓慢呼吸 | 颜色抽成蓝再宽笔刷过 | ★★ | 造型不够忧郁 |
+| 37_rick_morty | [Rick & Morty](37_rick_morty.md) | SVG圆角深灰细描边、平涂、背景斑驳 | 端杯、眨眼、目光、摆尾 | 按叙事另定 | ★★ | 独立SVG预览/渲染,不在旧35种Canvas gallery内;无行走rig |
## 质量分布与下一步
-- ★★★ 20 种、★★ 14 种、★ 1 种。
+- ★★★ 20 种、★★ 15 种、★ 1 种。
- **最普遍的短板是角色**:背景过了风格渲染器就像那个风格,角色只用矢量骨架平涂就像贴上去的(正面经验第 8 条)。下一轮提质先从「角色也过同一个渲染器/按该风格重塑造型」做起:伦勃朗、毕加索蓝、水墨、吉卜力、达利、漫威。
- 转场合集:`_转场_迁移测试.md`(A–D 新增 19 个)+各卡内说明。
diff --git a/release-manifest.json b/release-manifest.json
index 227c160..73f5982 100644
--- a/release-manifest.json
+++ b/release-manifest.json
@@ -3,12 +3,12 @@
"files": {
".github/workflows/tests.yml": "91b5797ea6f59b6e31e53de2a846194e33ab1dbe24b2efb8c0ed4367324f8fbe",
".gitignore": "28b7c75378a153807b8127362ba5e627b91870edf5170b7b3847fb19acf3d8a9",
- "CHANGELOG.md": "7447e6aa2c9b86766b8c7915bff38aa5c03411f96ad091a4b8ab271c08a86b18",
+ "CHANGELOG.md": "cc64bfb44299002b3fcb50e669bc777bb48de7dae86233aad323c4afb52d9228",
"CONTRIBUTING.md": "742a1a6071f6be25e82f0524a520fd6d09961be3f87d7a85940cd816ce7309a1",
"LICENSE": "6d6a2a9caf2e6d2b76974050427053b2892d8aa4c33fd168ce63a537fcee9d96",
- "README.en.md": "b3542ff3c54024eacf13e3aa3e697b651aa8bed7ae2623e608d5dbe6e7da825c",
- "README.md": "ccbcd1a35ab439447e1343040deb67e449ff0cdc3eb6d513b1b56c6044245865",
- "SKILL.md": "f0d488b6c8cbb17e0b6d843d432f9258e060ae596f602b3eee69e98185776445",
+ "README.en.md": "c2ddbb92ed6a38d222b188527d954e0a6759d329dc2cc51b37ba3e48931d57de",
+ "README.md": "32367d8b6a442441e1de7e74216028670793e655c9ab62aac1b0c0d8df8c8136",
+ "SKILL.md": "9fc1855f9081998b99797e4017523cd8c70d743f3da860812ae5828debb74911",
"assets/showcase/clawd-clips.md": "e986e40a1a8bfccdcf745a3afad0c5c40889f4263eaa6afaedd089dea23cd7fb",
"assets/showcase/clawd-dawn.gif": "5d512f5c2949c9576a03c970d646175a9f2755877010b359cc9282445944f252",
"assets/showcase/clawd-trex.gif": "6e3355bc8a9d8378bf2e23ca6a9b6601293c5638ea3d5db3fb164fc4826377f0",
@@ -99,7 +99,8 @@
"references/风格配方/34_shadowpuppet.md": "6cd4f9a090bff6d325695e8e4656ad041871f2ff0418b4eab1a46d51bd7d7609",
"references/风格配方/35_shinkai.md": "b327bf36ef2edc246576cbfb8f1f1857c52600691adbd651efbb1eeb75e7a554",
"references/风格配方/36_picasso_blue.md": "7578a99b0dc416414eb2cfd5c6aa9055ded387531bfde65fd5c1f17f22e4404a",
- "references/风格配方/INDEX.md": "077be3f350cf6022db3ba89fe7933323617381b315e8f6b86c07da28927f80fd",
+ "references/风格配方/37_rick_morty.md": "39e13d7a1cbe9e1637e3827fa17581e5b85df8843f4b05ee709967ab58efad16",
+ "references/风格配方/INDEX.md": "8367c835283fa3dfed2c0fc9a39ef0bbd6076e71a1ea4e853373dd02e715e427",
"references/风格配方/_转场_迁移测试.md": "16e901fb8c6bb2b9ff6596bec30209471227b74440dc9d5f3ba7931c99238677",
"references/风格配方/_音轨_艺术史速通.md": "f9c360503ec366bf0833687fd00eb2a276f1c8dc5e02ab93651e676195d10d60",
"schemas/media.schema.json": "4b7d93ebb7edf5fa6219891f28325f68fc51f090eee756bc4cc3a3c746d48bda",
@@ -306,6 +307,10 @@
"scripts/engine/lib/typo.js": "30db0cc68145dca22532e487da01aeb3ec97155e8b2c3a0747a009ce6638be8f",
"scripts/engine/lib/ui.js": "2608da0a38bfd429a9fe41c1a93a5d080d54c5fcccea80e7fea764e6ca3a97bf",
"scripts/engine/lib/util.js": "a2092233bbca337a29b00ce261d81a5c7b6baa020c9e301916ebe4a997450b9d",
+ "scripts/engine/reference_films/rick_morty/index.html": "215c23f93303a180b3f2405454b8652b61032f8874a8ce5bfe0388e1d6b920a9",
+ "scripts/engine/reference_films/rick_morty/render.py": "72d8726e94cbab93dda053b48e824b5ba3b89cad5b1d936bf3bf8b26c8819334",
+ "scripts/engine/reference_films/rick_morty/room.js": "c314335e551b920f54b5b4e429cae7c1e7f8e8609164d4e2d28d944947d5cc24",
+ "scripts/engine/reference_films/rick_morty/svg-kit.js": "921c63cce5dfd045e93f22cc3e2629ae5b3cd13bfca89658889b2da861c9d5d6",
"scripts/engine/reference_films/spacex/README.md": "dd19ad3495bc4e6733290af13732a57adafb039ae6a799f3054bd17b520dc353",
"scripts/engine/reference_films/spacex/eras_lin.js": "6605819d67486729d65a36c7cde3c7bd1b631bdf4384473180ac61e01a38c2cf",
"scripts/engine/reference_films/spacex/eras_spacex.js": "0061954a4399c0b13896d7f482777ea2cc813ef7415c5a68c3ee56ae4a903c98",
diff --git a/scripts/engine/reference_films/rick_morty/index.html b/scripts/engine/reference_films/rick_morty/index.html
new file mode 100644
index 0000000..73036ec
--- /dev/null
+++ b/scripts/engine/reference_films/rick_morty/index.html
@@ -0,0 +1,11 @@
+<!doctype html>
+<html lang="zh-CN"><meta charset="utf-8"><title>Rick & Morty · 风格36</title>
+<style>html,body{margin:0;background:#222323}#stage{width:100vw;aspect-ratio:16/9}svg{display:block;width:100%;height:100%}nav{position:fixed;bottom:10px;left:10px;background:#eee6cf;padding:8px;font:14px sans-serif}input{width:240px}</style>
+<div id="stage"><svg id="scene" xmlns="http://www.w3.org/2000/svg" viewBox="0 4 1920 1080"></svg></div>
+<nav><button id="play">播放</button> <input id="time" type="range" min="0" max="8" step="0.01" value="0"><span id="label">0.00s</span></nav>
+<script src="svg-kit.js"></script><script src="room.js"></script><script>
+RM.SCENE.init();RM.mottlePattern('mtDark',256,36,40,.12,[45,38,24]);ROOM36.build();ROOM36.el.style.display='';
+window.seek=(t,state)=>{if(!Number.isFinite(t)||t<0)throw Error('t must be non-negative');const sip=Math.max(0,Math.sin(t*Math.PI/4))**4;ROOM36.update(t,state||{sip,look:[Math.sin(t*.7)*.5,0]});document.querySelector('#time').value=t;document.querySelector('#label').textContent=t.toFixed(2)+'s';};
+let playing=false,last=0,now=0;document.querySelector('#play').onclick=()=>{playing=!playing;last=performance.now();document.querySelector('#play').textContent=playing?'暂停':'播放';};document.querySelector('#time').oninput=e=>{now=+e.target.value;seek(now);};
+function tick(t){if(playing){now=(now+(t-last)/1000)%8;seek(now);}last=t;requestAnimationFrame(tick);}seek(0);window.__ready=true;if(location.search.includes('render=1'))document.querySelector('nav').hidden=true;requestAnimationFrame(tick);
+</script></html>
\ No newline at end of file
diff --git a/scripts/engine/reference_films/rick_morty/render.py b/scripts/engine/reference_films/rick_morty/render.py
new file mode 100644
index 0000000..7a391d2
--- /dev/null
+++ b/scripts/engine/reference_films/rick_morty/render.py
@@ -0,0 +1,66 @@
+#!/usr/bin/env python3
+"""逐帧渲染 index.html:起本地服务 → 无头 Chromium → 每帧 window.seek(t) → 截 #stage → ffmpeg。
+
+uv run --with playwright python render.py --stills 2,10,20 --out 渲染/静帧
+uv run --with playwright python render.py --out 渲染/成片_无声.mp4 [--from 0 --to 30] [--fps 24]
+页面有 pageerror / console.error → 非零退出。
+"""
+import argparse, functools, http.server, socketserver, subprocess, sys, threading, time
+from pathlib import Path
+from playwright.sync_api import sync_playwright
+
+ap = argparse.ArgumentParser()
+ap.add_argument('--out', required=True)
+ap.add_argument('--stills')
+ap.add_argument('--from', dest='t0', type=float, default=0)
+ap.add_argument('--to', dest='t1', type=float)
+ap.add_argument('--fps', type=int, default=24)
+ap.add_argument('--crf', type=int, default=15)
+a = ap.parse_args()
+if a.fps <= 0 or a.t0 < 0 or (a.t1 is not None and a.t1 <= a.t0):
+ ap.error("fps > 0, from >= 0, to > from required")
+root = Path(__file__).resolve().parent
+
+class Q(http.server.SimpleHTTPRequestHandler):
+ def log_message(self, *x): pass
+class Srv(socketserver.ThreadingTCPServer):
+ daemon_threads = True; request_queue_size = 128
+srv = Srv(('127.0.0.1', 0), functools.partial(Q, directory=str(root)))
+threading.Thread(target=srv.serve_forever, daemon=True).start()
+port = srv.server_address[1]
+
+errors = []
+with sync_playwright() as p:
+ b = p.chromium.launch(args=["--disable-partial-raster"])
+ pg = b.new_page(viewport={'width': 1920, 'height': 1080}, device_scale_factor=1)
+ pg.on('console', lambda m: (print('[page]', m.text), errors.append(m.text)) if m.type == 'error' else None)
+ pg.on('pageerror', lambda e: (print('[pageerror]', e), errors.append(str(e))))
+ pg.goto(f'http://127.0.0.1:{port}/index.html?render=1')
+ pg.wait_for_function('window.__ready === true', timeout=120000)
+ bad = pg.evaluate('window.__filmFailed || window.__bootFailed || null')
+ if bad: raise SystemExit('加载失败:\n' + bad)
+ total = 8
+ stage = pg.locator('#stage')
+ def shot(t, path=None, fmt='png'):
+ pg.evaluate('t => window.seek(t)', t)
+ return pg.screenshot(path=path, clip={'x': 0, 'y': 0, 'width': 1920, 'height': 1080}, type=fmt, **({'quality': 95} if fmt == 'jpeg' else {}))
+ if a.stills:
+ out = Path(a.out); out.mkdir(parents=True, exist_ok=True)
+ for s in a.stills.split(','):
+ shot(float(s), str(out / f't{float(s):06.2f}.png'))
+ print('stills ->', out)
+ else:
+ t1 = a.t1 if a.t1 is not None else total
+ Path(a.out).parent.mkdir(parents=True, exist_ok=True)
+ ff = subprocess.Popen(['ffmpeg', '-y', '-v', 'error', '-f', 'image2pipe', '-framerate', str(a.fps), '-c:v', 'png', '-i', '-',
+ '-c:v', 'libx264', '-preset', 'slow', '-crf', str(a.crf), '-pix_fmt', 'yuv420p', '-movflags', '+faststart', a.out], stdin=subprocess.PIPE)
+ n0, n1 = round(a.t0 * a.fps), round(t1 * a.fps); st = time.time()
+ for i in range(n0, n1):
+ ff.stdin.write(shot(i / a.fps))
+ if (i - n0) % 48 == 0: print(f'{i}/{n1} {time.time() - st:.0f}s', flush=True)
+ ff.stdin.close()
+ if ff.wait() != 0: raise SystemExit("ffmpeg failed")
+ print('done ->', a.out, f'total={total}')
+ b.close()
+srv.shutdown()
+if errors: raise SystemExit(f'页面报错 {len(errors)} 条')
diff --git a/scripts/engine/reference_films/rick_morty/room.js b/scripts/engine/reference_films/rick_morty/room.js
new file mode 100644
index 0000000..7d9c98d
--- /dev/null
+++ b/scripts/engine/reference_films/rick_morty/room.js
@@ -0,0 +1,192 @@
+// 第 36 种画风:Rick and Morty。
+// 把 art-motion 35 种画风共用的那间屋(左窗、中桌、右边坐着端杯的少女、桌前的猫)按车库复刻量出来的画法重画一遍:
+// 描边 #222323、2.35px、圆头圆角;平涂+斑驳纹理(mtDark);人和猫是大圆眼白+小黑点瞳孔、眼皮可眨。
+// 坐标系 = 车库 SVG(1920×1088,舞台上移 4px 显示成 1920×1080)。
+window.ROOM36 = (() => {
+ const { S, INK, smoothPath: sp, mixedPath: mp, f1 } = RM;
+ const C = {
+ wall: '#cdbf96', wallDk: '#b9aa80', trim: '#eee6cf', floor: '#9b7752', floorDk: '#87643f', plank: '#7a5a3a',
+ sky: '#a7d6ea', skyLt: '#c6e5ef', hill: '#86b553', hillDk: '#6d9a40', tree: '#5f8f3a', trunk: '#7b5a3a', fence: '#f1efe4',
+ table: '#a0683f', tableDk: '#83532f', rug: '#b85c4a', rugLt: '#d07a63', chair: '#5d6f8a', chairDk: '#4a5a72',
+ skin: '#efc4a0', hair: '#f0cf63', hairDk: '#d8b24a', dress: '#d65a4f', dressDk: '#b9473e', shoe: '#4d4c50', mug: '#f2f0e8',
+ cat: '#e99a4f', catDk: '#c4733a', catLt: '#f6e7d2', nose: '#e58f98', pot: '#c4683f', leaf: '#5a9a45', leafDk: '#467d35',
+ };
+ let root, girl, cat, refs = {};
+
+ // ---------- 静态:墙、窗、地板、地毯、桌、椅、盆栽 ----------
+ function backdrop() {
+ let s = '';
+ s += S.rect(0, 0, 1920, 800, C.wall, { stroke: 'none' }) + S.rect(0, 0, 1920, 800, 'url(#mtDark)', { stroke: 'none', op: .55 });
+ // 墙裙线、踢脚线
+ s += S.rect(0, 560, 1920, 14, C.trim, { w: 2.2 });
+ s += S.rect(0, 574, 1920, 226, C.wallDk, { stroke: 'none' }) + S.rect(0, 574, 1920, 226, 'url(#mtDark)', { stroke: 'none', op: .5 });
+ for (let x = -20; x < 1920; x += 96) s += S.line(x, 576, x, 786, { w: 1.6, stroke: '#9f915f', op: .8 });
+ s += S.rect(0, 786, 1920, 22, C.trim, { w: 2.35 });
+ // 地板
+ s += S.rect(0, 808, 1920, 290, C.floor, { stroke: 'none' }) + S.rect(0, 808, 1920, 290, 'url(#mtDark)', { stroke: 'none', op: .6 });
+ for (const y of [852, 912, 990, 1080]) s += S.line(0, y, 1920, y, { w: 2, stroke: C.plank });
+ const r = RM.mulberry32(36);
+ for (const [y0, y1] of [[808, 852], [852, 912], [912, 990], [990, 1080]]) { let x = -r() * 300; while (x < 1920) { x += 260 + r() * 260; s += S.line(f1(x), y0, f1(x), y1, { w: 2, stroke: C.plank }); } }
+ // 窗(左):外框、窗外的郊区(天、坡、篱笆、树)
+ s += S.rect(352, 112, 456, 470, C.trim, { rx: 6 });
+ s += `<clipPath id="r36win"><rect x="376" y="136" width="408" height="408"/></clipPath>`;
+ let out = S.rect(376, 136, 408, 408, C.sky, { stroke: 'none' });
+ out += S.ell(470, 210, 60, 18, C.skyLt, { stroke: 'none', op: .9 }) + S.ell(660, 180, 48, 14, C.skyLt, { stroke: 'none', op: .9 });
+ out += S.path(sp([[360, 430], [470, 392], [600, 410], [720, 380], [800, 400], [800, 560], [360, 560]], true, .5), C.hill);
+ out += S.path(sp([[360, 480], [520, 452], [680, 470], [800, 455], [800, 560], [360, 560]], true, .5), C.hillDk);
+ out += S.path('M664 470 L664 400', 'none', { w: 9, stroke: C.trunk }) + S.path('M664 470 L664 400', 'none', { w: 2.35 });
+ out += S.path(sp([[620, 380], [628, 342], [660, 322], [698, 336], [712, 372], [696, 402], [660, 410], [628, 402]]), C.tree);
+ for (let x = 384; x < 790; x += 34) out += S.path(`M${x} 540 L${x} 494 L${x + 11} 484 L${x + 22} 494 L${x + 22} 540 Z`, C.fence, { w: 2 });
+ out += S.rect(376, 506, 408, 9, C.fence, { w: 2 });
+ s += `<g clip-path="url(#r36win)">${out}</g>`;
+ s += S.rect(376, 136, 408, 408, 'none') + S.rect(572, 136, 16, 408, C.trim, { w: 2 }) + S.rect(376, 332, 408, 16, C.trim, { w: 2 });
+ s += S.rect(334, 574, 492, 22, C.trim, { rx: 4 });
+ // 墙上的画框:一扇小小的绿传送门(自己画派的签名)
+ s += S.rect(1010, 190, 170, 132, '#8a6440', { rx: 3 }) + S.rect(1024, 204, 142, 104, '#2c3a2e', { w: 2 });
+ s += S.ell(1095, 256, 40, 34, '#97ce4c', { w: 2.2 }) + S.ell(1095, 256, 26, 21, '#c8ec7a', { stroke: 'none' }) +
+ S.path('M1095 256 m-20 0 q8 -16 22 -8 q12 8 2 20 q-10 8 -16 -2', 'none', { w: 2.2, stroke: '#4f8a2a' });
+ // 地毯
+ s += S.ell(1040, 948, 470, 58, C.rug) + S.ell(1040, 948, 420, 44, 'none', { w: 2, stroke: C.rugLt });
+ // 桌(中)
+ s += S.poly('905,668 921,668 930,915 897,915', C.tableDk) + S.poly('1112,668 1128,668 1138,915 1105,915', C.tableDk);
+ s += S.poly('840,640 1210,640 1218,668 832,668', C.table) + S.rect(832, 668, 386, 14, C.tableDk);
+ s += S.path('M884 640 Q900 646 916 640 M1000 640 Q1020 647 1040 640', 'none', { w: 1.8, stroke: '#7a4a2a' });
+ // 桌上的盘子和饼干
+ s += S.ell(990, 636, 46, 9, '#efece2', { w: 2.2 }) + S.ell(978, 630, 12, 5, '#d4a259', { w: 2 }) + S.ell(1000, 629, 12, 5, '#d4a259', { w: 2 });
+ // 椅子(少女后面)
+ s += S.rect(1536, 470, 34, 300, C.chair, { rx: 8 }) + S.rect(1392, 470, 34, 300, C.chair, { rx: 8 });
+ s += S.rect(1392, 470, 178, 60, C.chairDk, { rx: 8 });
+ // 盆栽(右角)
+ s += S.path(sp([[1736, 700], [1712, 600], [1700, 520], [1726, 470], [1752, 540], [1760, 640]], true, .5), C.leaf);
+ s += S.path(sp([[1760, 700], [1790, 590], [1830, 520], [1846, 556], [1812, 640], [1780, 702]], true, .5), C.leafDk);
+ s += S.path(sp([[1748, 700], [1760, 600], [1774, 500], [1792, 520], [1780, 620], [1766, 702]], true, .5), C.leaf);
+ s += S.poly('1712,700 1830,700 1816,790 1726,790', C.pot) + S.rect(1704, 690, 134, 20, '#d47a4f', { rx: 3 });
+ return s;
+ }
+
+ // ---------- 少女:正面坐在椅子上,双手捧杯(脸、眼睛的造法照 Morty) ----------
+ function girlSVG() {
+ let s = '';
+ // 后发:长发垂在肩后(先画,压在裙子后面)
+ s += S.path(sp([[1424, 420], [1414, 500], [1418, 572], [1446, 588], [1514, 588], [1542, 572], [1546, 500], [1536, 420], [1480, 384]], true, .55), C.hairDk);
+ // 椅面、腿、鞋
+ s += S.rect(1384, 728, 194, 26, C.chairDk, { rx: 6 });
+ s += S.path('M1423 752 L1421 890 L1451 890 L1453 752', C.skin) + S.path('M1505 752 L1508 890 L1538 890 L1535 752', C.skin);
+ s += S.path(sp([[1418, 884], [1402, 896], [1404, 908], [1450, 908], [1456, 892], [1452, 882]], true, .4), C.shoe);
+ s += S.path(sp([[1506, 882], [1504, 894], [1510, 908], [1556, 908], [1558, 896], [1540, 884]], true, .4), C.shoe);
+ // 裙子与身体
+ s += S.path(sp([[1428, 560], [1408, 640], [1392, 730], [1400, 772], [1480, 782], [1562, 772], [1570, 730], [1554, 640], [1534, 560], [1480, 548]], true, .5), C.dress);
+ s += S.path('M1452 600 Q1446 680 1440 770 M1508 600 Q1514 680 1520 770', 'none', { w: 2, stroke: C.dressDk });
+ s += S.path('M1460 552 Q1480 574 1500 552', 'none', { w: 2.35 });
+ // 脖子
+ s += S.path('M1468 528 L1468 556 Q1480 562 1492 556 L1492 528', C.skin);
+ return s;
+ }
+ // 头(单独一组:眨眼、看人、喝水时微仰)
+ function girlHeadSVG() {
+ let s = '';
+ // 脸(Morty 的脸型略收窄)
+ s += S.path(sp([[1480, 392], [1452, 398], [1434, 414], [1426, 440], [1428, 470], [1440, 496], [1460, 514], [1480, 520], [1500, 514], [1520, 496], [1532, 470], [1534, 440], [1526, 414], [1508, 398]]), C.skin);
+ // 刘海+两侧头发
+ s += S.path(mp([[1424, 452], [1420, 414], [1436, 386], [1462, 372], [1492, 370], [1520, 380], [1538, 402], [1542, 440], [1536, 462], [1526, 430], [1508, 412], [1494, 428], [1480, 414], [1462, 430], [1450, 414], [1434, 434]], new Set([9, 10, 12, 14]), .5), C.hair);
+ // 眼睛(大眼白+小黑点,眼皮可合)
+ for (const [k, x] of [['L', 1462], ['R', 1500]]) {
+ s += `<clipPath id="g36eye${k}"><ellipse cx="${x}" cy="452" rx="14" ry="16"/></clipPath>`;
+ s += S.ell(x, 452, 14, 16, '#ebebe8', { w: 2.6 });
+ s += S.circ(x, 452, 2.4, INK, { stroke: 'none', cls: 'g36pup' });
+ s += `<g clip-path="url(#g36eye${k})"><rect class="g36lid" x="${x - 17}" y="433" width="34" height="0" fill="${C.skin}" stroke="${INK}" stroke-width="2.4"/></g>`;
+ s += S.ell(x, 452, 14, 16, 'none', { w: 2.6 });
+ s += S.path(`M${x - 13} 432 Q${x} 426 ${x + 12} 431`, 'none', { w: 2.2 });
+ }
+ s += S.path('M1478 470 Q1474 478 1482 480', 'none', { w: 2.2 });
+ s += `<g class="g36mouth">${S.path('M1472 494 Q1481 500 1490 494', 'none', { w: 2.4 })}</g>`;
+ s += S.ell(1446, 482, 7, 4, '#eaa58c', { stroke: 'none', op: .6 }) + S.ell(1516, 482, 7, 4, '#eaa58c', { stroke: 'none', op: .6 });
+ return s;
+ }
+ // 手臂+杯子(一组:抿一口时整体抬起)
+ function girlArmsSVG() {
+ let s = '';
+ s += S.path(sp([[1424, 576], [1404, 630], [1418, 664], [1460, 660], [1466, 646], [1432, 640], [1440, 590]], true, .4), C.dress, { cls: 'r36sleeve' });
+ s += S.path(sp([[1536, 576], [1556, 630], [1542, 664], [1500, 660], [1494, 646], [1528, 640], [1520, 590]], true, .4), C.dress, { cls: 'r36sleeve' });
+ s += S.rect(1462, 612, 36, 46, C.mug, { rx: 5 }) + S.path('M1498 622 Q1514 624 1512 638 Q1510 650 1498 648', 'none', { w: 2.35 });
+ s += S.path('M1462 624 L1498 624', 'none', { w: 1.8, stroke: '#b9b5a8' });
+ s += S.ell(1458, 652, 11, 9, C.skin, { w: 2.2 }) + S.ell(1502, 652, 11, 9, C.skin, { w: 2.2 });
+ return s;
+ }
+
+ // ---------- 猫:正面坐在地上,大眼、尾巴摆 ----------
+ function catBodySVG() {
+ let s = '';
+ s += S.path(sp([[420, 760], [392, 800], [384, 846], [398, 880], [452, 888], [506, 880], [520, 846], [512, 800], [486, 760]], true, .55), C.cat);
+ s += S.path(sp([[434, 800], [424, 840], [432, 876], [474, 876], [482, 840], [472, 800]], true, .5), C.catLt, { stroke: 'none' });
+ s += S.path('M396 820 Q410 818 418 826 M392 846 Q406 844 414 852 M512 820 Q498 818 490 826 M516 846 Q502 844 494 852', 'none', { w: 2.2, stroke: C.catDk });
+ // 前爪
+ s += S.ell(432, 884, 18, 9, C.catLt, { w: 2.2 }) + S.ell(476, 884, 18, 9, C.catLt, { w: 2.2 });
+ return s;
+ }
+ function catHeadSVG() {
+ let s = '';
+ s += S.poly('398,712 404,652 446,690', C.cat) + S.poly('508,712 502,652 460,690', C.cat);
+ s += S.poly('407,700 410,668 432,690', C.nose, { stroke: 'none' }) + S.poly('499,700 496,668 474,690', C.nose, { stroke: 'none' });
+ s += S.path(sp([[453, 672], [418, 680], [396, 704], [392, 736], [408, 764], [453, 776], [498, 764], [514, 736], [510, 704], [488, 680]], true, .55), C.cat);
+ s += S.path('M440 676 L444 694 M453 672 L453 692 M466 676 L462 694', 'none', { w: 2.2, stroke: C.catDk });
+ for (const [k, x] of [['L', 433], ['R', 473]]) {
+ s += `<clipPath id="c36eye${k}"><ellipse cx="${x}" cy="720" rx="13" ry="15"/></clipPath>`;
+ s += S.ell(x, 720, 13, 15, '#eef0d6', { w: 2.5 });
+ s += S.circ(x, 720, 2.5, INK, { stroke: 'none', cls: 'c36pup' });
+ s += `<g clip-path="url(#c36eye${k})"><rect class="c36lid" x="${x - 16}" y="703" width="32" height="0" fill="${C.cat}" stroke="${INK}" stroke-width="2.4"/></g>`;
+ s += S.ell(x, 720, 13, 15, 'none', { w: 2.5 });
+ }
+ s += S.path('M447 742 L459 742 L453 749 Z', C.nose, { w: 2 }) + S.path('M453 749 Q448 757 441 754 M453 749 Q458 757 465 754', 'none', { w: 2.2 });
+ s += S.path('M420 746 L388 740 M420 752 L390 756 M486 746 L518 740 M486 752 L516 756', 'none', { w: 1.8 });
+ return s;
+ }
+ function tailPath(sw) {
+ const k = sw;
+ const pts = [[506, 870], [548, 872], [578, 852 + 6 * k], [588 + 8 * k, 820], [578 + 14 * k, 792 - 4 * k], [562 + 16 * k, 784 - 6 * k]];
+ // 中心线 + 宽度 → 一条圆头尾巴
+ const L = [], R = [];
+ for (let i = 0; i < pts.length; i++) {
+ const a = pts[Math.max(0, i - 1)], b = pts[Math.min(pts.length - 1, i + 1)];
+ const dx = b[0] - a[0], dy = b[1] - a[1], l = Math.hypot(dx, dy) || 1, w = 11 - i * 1.1;
+ L.push([pts[i][0] - dy / l * w, pts[i][1] + dx / l * w]); R.push([pts[i][0] + dy / l * w, pts[i][1] - dx / l * w]);
+ }
+ return sp(L.concat(R.reverse()), true, .5);
+ }
+
+ function build() {
+ root = RM.SCENE.add('L3', `<g id="room36" style="display:none"></g>`);
+ root.innerHTML = backdrop() +
+ `<g id="r36cat"><g id="r36tail">${S.path(tailPath(0), C.cat)}</g><g>${catBodySVG()}</g><g id="r36catHead">${catHeadSVG()}</g></g>` +
+ `<g id="r36girl">${girlSVG()}<g id="r36gHead">${girlHeadSVG()}</g><g id="r36gArms">${girlArmsSVG()}</g></g>`;
+ refs = {
+ tail: root.querySelector('#r36tail path'), catHead: root.querySelector('#r36catHead'),
+ gHead: root.querySelector('#r36gHead'), gArms: root.querySelector('#r36gArms'),
+ gPup: [...root.querySelectorAll('.g36pup')], gLid: [...root.querySelectorAll('.g36lid')],
+ cPup: [...root.querySelectorAll('.c36pup')], cLid: [...root.querySelectorAll('.c36lid')],
+ };
+ }
+ const blinkAt = (t, seed) => { const per = 2.9 + seed * .7, ph = (t + seed * 1.3) % per; return ph < .16 ? (ph < .08 ? ph / .08 : (0.16 - ph) / .08) : 0; };
+ // st: { look:[x,y] 少女/猫瞳孔偏移(-1..1), catLook, sip 0..1, catJump 0..1 }
+ function update(t, st = {}) {
+ if (!root) return;
+ refs.tail.setAttribute('d', tailPath(Math.sin(t * 2.4)));
+ const gl = st.look || [0, 0], cl = st.catLook || gl;
+ refs.gPup.forEach(p => p.setAttribute('transform', `translate(${f1(gl[0] * 8)} ${f1(gl[1] * 9)})`));
+ refs.cPup.forEach(p => p.setAttribute('transform', `translate(${f1(cl[0] * 7)} ${f1(cl[1] * 8)})`));
+ const gb = st.gBlink ?? blinkAt(t, 1), cb = st.cBlink ?? blinkAt(t, 2);
+ refs.gLid.forEach(l => l.setAttribute('height', f1(38 * gb)));
+ refs.cLid.forEach(l => l.setAttribute('height', f1(34 * cb)));
+ const sip = st.sip || 0;
+ refs.gArms.setAttribute('transform', `translate(0 ${f1(-sip * 112)})`);
+ // 袖口随杯子,上臂锚点补偿组位移,肩部留在原位。
+ const lift = sip * 112, sleeves = refs.gArms.querySelectorAll('.r36sleeve');
+ sleeves[0].setAttribute('d', sp([[1424,576+lift],[1404,630+lift*.35],[1418,664],[1460,660],[1466,646],[1432,640],[1440,590+lift]],true,.4));
+ sleeves[1].setAttribute('d', sp([[1536,576+lift],[1556,630+lift*.35],[1542,664],[1500,660],[1494,646],[1528,640],[1520,590+lift]],true,.4));
+ refs.gHead.setAttribute('transform', `rotate(${f1(-sip * 4 + Math.sin(t * 1.3) * 1.2)} 1480 520)`);
+ const jy = st.catJump ? -Math.sin(Math.PI * Math.min(1, st.catJump)) * 46 : 0;
+ refs.catHead.setAttribute('transform', `translate(${f1(Math.sin(t * 1.1) * 2)} 0) rotate(${f1(Math.sin(t * .9) * 3)} 453 770)`);
+ root.querySelector('#r36cat').setAttribute('transform', `translate(0 ${f1(jy)})`);
+ }
+ return { build, update, get el() { return root; } };
+})();
diff --git a/scripts/engine/reference_films/rick_morty/svg-kit.js b/scripts/engine/reference_films/rick_morty/svg-kit.js
new file mode 100644
index 0000000..3994f6f
--- /dev/null
+++ b/scripts/engine/reference_films/rick_morty/svg-kit.js
@@ -0,0 +1,124 @@
+window.RM = (() => {
+'use strict';
+// 全局:画风常量、SVG 小工具、场景注册、确定性随机、纹理
+const INK = '#222323', LW = 2.35;
+const STILL = location.hash.includes('still');
+const NS = 'http://www.w3.org/2000/svg';
+
+function mulberry32(a) { return function () { a |= 0; a = a + 0x6D2B79F5 | 0; let t = Math.imul(a ^ a >>> 15, 1 | a); t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t; return ((t ^ t >>> 14) >>> 0) / 4294967296; }; }
+
+// 字符串式 SVG 图元。o: {stroke, w, op, id, cls, extra}
+function A(o) {
+ let s = '';
+ if (o.id) s += ` id="${o.id}"`;
+ if (o.cls) s += ` class="${o.cls}"`;
+ if (o.op != null) s += ` opacity="${o.op}"`;
+ if (o.tf) s += ` transform="${o.tf}"`;
+ if (o.extra) s += ' ' + o.extra;
+ return s;
+}
+function SK(o) {
+ const st = o.stroke === undefined ? INK : o.stroke;
+ if (st === 'none' || st === null) return ' stroke="none"';
+ return ` stroke="${st}" stroke-width="${o.w ?? LW}" stroke-linejoin="round" stroke-linecap="round"`;
+}
+const S = {
+ poly: (pts, fill, o = {}) => `<polygon points="${pts}" fill="${fill}"${SK(o)}${A(o)}/>`,
+ pl: (pts, o = {}) => `<polyline points="${pts}" fill="none"${SK(o)}${A(o)}/>`,
+ path: (d, fill, o = {}) => `<path d="${d}" fill="${fill}"${SK(o)}${A(o)}/>`,
+ rect: (x, y, w, h, fill, o = {}) => `<rect x="${x}" y="${y}" width="${w}" height="${h}"${o.rx ? ` rx="${o.rx}"` : ''} fill="${fill}"${SK(o)}${A(o)}/>`,
+ circ: (cx, cy, r, fill, o = {}) => `<circle cx="${cx}" cy="${cy}" r="${r}" fill="${fill}"${SK(o)}${A(o)}/>`,
+ ell: (cx, cy, rx, ry, fill, o = {}) => `<ellipse cx="${cx}" cy="${cy}" rx="${rx}" ry="${ry}" fill="${fill}"${SK(o)}${A(o)}/>`,
+ line: (x1, y1, x2, y2, o = {}) => `<line x1="${x1}" y1="${y1}" x2="${x2}" y2="${y2}"${SK(o)}${A(o)}/>`,
+ g: (inner, o = {}) => `<g${A(o)}>${inner}</g>`,
+ // 无描边填色(色块、阴影)
+ fpoly: (pts, fill, o = {}) => S.poly(pts, fill, { ...o, stroke: 'none' }),
+ fpath: (d, fill, o = {}) => S.path(d, fill, { ...o, stroke: 'none' }),
+};
+
+// 场景:分层。L0 建筑;L1 后墙物件;L2 按脚深度排序(家具与角色);L3 光效与前景
+const SCENE = {
+ svg: null, defs: null, layers: {}, objs: [], updaters: [], t0: 0,
+ init() {
+ this.svg = document.getElementById('scene');
+ this.svg.innerHTML = '<defs id="defs"></defs><g id="L0"></g><g id="L1"></g><g id="L2"></g><g id="L3"></g>';
+ this.defs = this.svg.querySelector('#defs');
+ for (const k of ['L0', 'L1', 'L2', 'L3']) this.layers[k] = this.svg.querySelector('#' + k);
+ },
+ def(s) { this.defs.insertAdjacentHTML('beforeend', s); },
+ add(layer, s) { this.layers[layer].insertAdjacentHTML('beforeend', s); return this.layers[layer].lastElementChild; },
+ // 深度物体:z = 脚/底座在地面上的 y
+ addZ(id, z, s) {
+ const g = document.createElementNS(NS, 'g'); g.id = id; g.dataset.z = z; g.innerHTML = s;
+ this.layers.L2.appendChild(g); this.objs.push(g); return g;
+ },
+ sortZ() {
+ const arr = [...this.layers.L2.children].sort((a, b) => (+a.dataset.z) - (+b.dataset.z));
+ let ok = true; for (let i = 0; i < arr.length; i++) if (this.layers.L2.children[i] !== arr[i]) { ok = false; break; }
+ if (!ok) arr.forEach(e => this.layers.L2.appendChild(e));
+ },
+ onUpdate(fn) { this.updaters.push(fn); },
+};
+
+// 斑驳纹理:值噪声 → 半透明 PNG,做 <pattern>。dark/light 两种。
+function mottleURL(size, seed, cell, alpha, rgb) {
+ const c = document.createElement('canvas'); c.width = c.height = size;
+ const x = c.getContext('2d'); const img = x.createImageData(size, size);
+ const r = mulberry32(seed);
+ const octs = [cell, cell / 2, cell / 4].filter(v => v >= 1);
+ const grids = octs.map(cs => { const n = Math.ceil(size / cs); return { cs, n, v: Array.from({ length: n * n }, r) }; });
+ const sm = t => t * t * (3 - 2 * t);
+ for (let j = 0; j < size; j++) for (let i = 0; i < size; i++) {
+ let v = 0, wsum = 0, wt = 1;
+ for (const g of grids) {
+ const gx = i / g.cs, gy = j / g.cs, x0 = Math.floor(gx), y0 = Math.floor(gy);
+ const fx = sm(gx - x0), fy = sm(gy - y0);
+ const at = (a, b) => g.v[((b % g.n + g.n) % g.n) * g.n + ((a % g.n + g.n) % g.n)];
+ const a = at(x0, y0) * (1 - fx) + at(x0 + 1, y0) * fx, b = at(x0, y0 + 1) * (1 - fx) + at(x0 + 1, y0 + 1) * fx;
+ v += (a * (1 - fy) + b * fy) * wt; wsum += wt; wt *= 0.55;
+ }
+ v /= wsum;
+ const k = (j * size + i) * 4;
+ img.data[k] = rgb[0]; img.data[k + 1] = rgb[1]; img.data[k + 2] = rgb[2];
+ img.data[k + 3] = Math.max(0, Math.min(255, (v - 0.45) * 2.2 * alpha * 255));
+ }
+ x.putImageData(img, 0, 0); return c.toDataURL();
+}
+function mottlePattern(id, size, seed, cell, alpha, rgb) {
+ SCENE.def(`<pattern id="${id}" patternUnits="userSpaceOnUse" width="${size}" height="${size}"><image href="${mottleURL(size, seed, cell, alpha, rgb)}" width="${size}" height="${size}"/></pattern>`);
+}
+
+const f1 = v => (Math.round(v * 10) / 10);
+const P = pts => pts.map(p => f1(p[0]) + ' ' + f1(p[1]));
+
+// Catmull-Rom → 三次贝塞尔。pts: [[x,y],...]
+function smoothPath(pts, closed = true, k = 0.5) {
+ const n = pts.length; if (n < 2) return '';
+ const g = i => closed ? pts[(i + n) % n] : pts[Math.max(0, Math.min(n - 1, i))];
+ let d = `M${f1(pts[0][0])} ${f1(pts[0][1])}`;
+ const segs = closed ? n : n - 1;
+ for (let i = 0; i < segs; i++) {
+ const p0 = g(i - 1), p1 = g(i), p2 = g(i + 1), p3 = g(i + 2);
+ const c1 = [p1[0] + (p2[0] - p0[0]) * k / 3, p1[1] + (p2[1] - p0[1]) * k / 3];
+ const c2 = [p2[0] - (p3[0] - p1[0]) * k / 3, p2[1] - (p3[1] - p1[1]) * k / 3];
+ d += ` C${f1(c1[0])} ${f1(c1[1])} ${f1(c2[0])} ${f1(c2[1])} ${f1(p2[0])} ${f1(p2[1])}`;
+ }
+ return d + (closed ? ' Z' : '');
+}
+// 分段:sharp 里给出的下标处保持尖角(头发尖刺用)
+function mixedPath(pts, sharp = new Set(), k = 0.5) {
+ const n = pts.length; const g = i => pts[(i + n) % n];
+ let d = `M${f1(pts[0][0])} ${f1(pts[0][1])}`;
+ for (let i = 0; i < n; i++) {
+ const p0 = g(i - 1), p1 = g(i), p2 = g(i + 1), p3 = g(i + 2);
+ const k1 = sharp.has(i) ? 0 : k, k2 = sharp.has((i + 1) % n) ? 0 : k;
+ const c1 = [p1[0] + (p2[0] - p0[0]) * k1 / 3, p1[1] + (p2[1] - p0[1]) * k1 / 3];
+ const c2 = [p2[0] - (p3[0] - p1[0]) * k2 / 3, p2[1] - (p3[1] - p1[1]) * k2 / 3];
+ d += ` C${f1(c1[0])} ${f1(c1[1])} ${f1(c2[0])} ${f1(c2[1])} ${f1(p2[0])} ${f1(p2[1])}`;
+ }
+ return d + ' Z';
+}
+
+
+return { S, INK, SCENE, mulberry32, mottlePattern, smoothPath, mixedPath, f1 };
+})();