Communitygithub.com

紙雕動畫製作

製作垂直 (1080x1920) 紙雕 / 剪紙工藝解說影片 — 每個元素都是一張彩色卡紙,帶有手工剪裁的粗糙邊緣、紙纖維紋理、白色剪切邊緣和柔和的陰影,以「每兩幀」的停格動畫風格呈現,搭配分腳釘角色人偶和泰語或英語的紙標籤條。

紙雕動畫製作 是什麼?

此技能可生成 1080x1920 垂直格式的紙雕工藝風格解說動畫,模擬手工剪裁的卡紙外觀與停格動畫效果。核心引擎 `papercut.py` 負責產生形狀、手剪邊緣、紙張紋理、陰影、標籤、攝影機與編碼;`puppet.py` 提供逼真的人體人偶(正面視角),具備 FK 骨架、約 45 個紙片部件、姿態與眨眼功能;`rain_story.py` 則展示了 31 秒的泰語水循環故事。每個「紙片」都是閉合多邊形與顏色的集合,且其粗糙邊緣透過重採樣與雜訊偏移來模擬手工剪裁的穩定不規則感。動畫採用每秒 12 幀的停格風格,每幀重複兩次以營造「每兩幀」的定格效果,並包含紙片抖動與燈光閃爍等細節,以強化手工質感。此技能支援 Claude Code、Coder、Cursor、Windsurf 與 Codex 等平台,可根據使用者要求(如「紙雕風格」、「剪紙工藝」或「泰語兒童科學解說影片」)自動生成完整的動畫腳本與輸出影片。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/hadafisama180-glitch/paper-cutout/tree/HEAD/.claude/skills/paper-cutout-animation

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Paper-cutout stop-motion animation

Reference implementation (copy, then change the world / timeline / text):

FileWhat it is
paper_cutout/papercut.pyengine: shapes, hand-cut edges, paper texture, shadows, labels, camera, encoder
paper_cutout/puppet.pyrealistic human puppet (front view): FK skeleton + ~45 paper pieces, poses, blinking
paper_cutout/rain_story.py31 s Thai water-cycle story: title -> evaporation -> condensation -> rain (kid opens umbrella) -> river run-off -> rainbow

Run with python3 rain_story.py out.mp4, or --preview DIR to dump 12 stills first. Full render ≈ 1.5 s per unique frame (≈ 9 min for 31 s at 12 poses/s).

The look, and where each part comes from

  1. Everything is a piece = list of closed polygons + colour + z. Painted in list order (first = bottom). Union shapes (cloud = circles + a rounded rect) are just several polygons in one piece, so they share one outline, one shadow, one colour.
  2. Hand-cut edge (cut): resample the outline every ~6 px and offset it along the normal by a few low-frequency sines + tiny noise, seeded by the piece name, so the wobble is stable across frames (it's the same sheet). Use rough=False for tiny punched dots (eyes, mouths).
  3. Shadow: mask shifted down-right by z*(0.55, 1.0), Gaussian blur 1.5+0.9z, multiply by 1-0.38*s. Bigger z = sheet lifted on foam tape. Background bands z 0-3, scenery 4-8, characters 4-7, clouds 12, HUD 12-14.
  4. White cut margin (border=px): polygon drawn again with a thick outline in cream under the colour — the "cut around a printed sticker" look. Use on hero objects (sun, cloud, umbrella, drops, river), not on everything.
  5. Paper texture: one 2x-canvas multiplicative map (mottling + grain + short fibre strokes) sampled at a per-piece offset so neighbours don't share grain. shade>0 darkens the inner edge (slightly curled paper).
  6. Masks are 2x supersampled and drawn only in each piece's bbox crop — that's what keeps it fast at full 1080x1920.
  7. Stop-motion: encode renders at ANIM_FPS=12 and holds each pose for 2 frames; boil re-places each piece by ±0.7 px / ±0.25° per pose; global light flicker ±1 %, warm vignette.

Building scenes

  • Shape helpers: circle, ellipse(…, a0, a1) (half-ellipse = umbrella/hair), rect, rrect, band (rainbow stripes / arcs), wave_strip (layered sea/sky, animate phase in opposite directions per layer), ribbon(path, w, taper) (river, steam curls, heat waves, stick), teardrop, star_burst (sun rays, grass tufts), xform(pts, tx, ty, rot, s, pivot).
  • People: use puppet.py, not blobs. P = puppet.pose(x, y, height), set fields, pieces, J = puppet.draw("kid", P, fi). What makes it read as a real person rather than a chibi:
    • proportions ≈ 8-year-old: head ≈ 1/5.5 of height, legs ≈ half;
    • two-segment limbs (capsule tapered thigh/shin, upper arm/forearm) with elbows and knees; angles 0 = down, 90 = screen right, 180 = up;
    • hands = palm + finger mitten + darker thumb; socks, shoes with a white sole;
    • clothes as separate sheets: shorts with two legs, T-shirt, sleeves over the upper arm with a darker cuff, collar ribbon, pocket;
    • egg-shaped face (narrow chin), ears with inner ear, back hair + jagged fringe + shine, darker "shadow paper" under the fringe and the chin;
    • eyes = white + iris + pupil + glint + lash line; eyebrows; nose; blush; mouths smile | open | o | flat | frown;
    • life: breath, sway, lean, weight shift on the legs, blink_at(t), look (pupils), face_up (features slide up when looking up), head_tilt, brows (-1 worried .. +1 happy).
    • Props in the hand: use J["rwr"] + puppet.d(J["rfdir"])*11 (palm centre) and insert the prop before kid.rhand so the fingers wrap over it.
    • Layer order matters for the face: face -> shadow paper -> eyes/brows/ nose/mouth -> fringe. A shadow piece added after the eyes hides them.
  • Growing things: grow scale (cloud), sweep angle (rainbow band a1), truncate a path (river ribbon over the first n samples).
  • Colour changes over time with lerp_col (sky and cloud greying in rain).
  • Camera (Camera.apply(piece, par)): pan/zoom per beat from a key list; par < 1 for far layers gives parallax; HUD labels skip the camera.
  • Text = label(): a cream paper strip with antialiased Loma Bold text, rotated a few degrees; headline drops in with back_out, flies off tilted at the end of the beat; caption rises from the bottom. Loma has Thai; keep captions to 2 short lines (≈ 20 Thai chars) at 40 px, headlines 50-78 px.

Gotchas

  • piece names seed the cut shape and the boil: give every piece a unique, stable name (drop{j}, not a random one) or edges will flicker.
  • Teardrop / thin ribbons with width < 4 px vanish after supersampling — fade them out by scaling width to ~0 and then skip (if sz > 0.05).
  • Keep particles born after their start time (rain uses a phase check) or the first frame of a beat shows them mid-air.
  • A flat polygon bottom edge that meets another layer shows a hard shelf; extend layers past each other (sea starts at x=150, under the mountain).
  • Check the contact sheet before a full render: ffmpeg -pattern_type glob -i 'dir/f_*.png' -vf "scale=270:-1,tile=6x2" sheet.png.
  • Audio: none in the reference; mux narration with encode(..., audio=wav) (see tools/tts_omnivoice.py for Thai voice-over).

相關技能