Communitygithub.com

aminghaseminia/manim-animation

Manim Community で数理・科学・技術アニメーションを作成 — 数式、証明、グラフ、座標系、幾何、アルゴリズム、データ構造、正確な図形変換。教育用解説、研究・学会発表のビジュアル、全要素を厳密に配置する導出アニメーションに最適。uv を用いたインストール、シーン設計、LaTeX/MathTex、カメラと 3D シーン、レンダリング品質プリセット、他ツールとの合成をカバーします。

manim-animation とは?

このスキルは、Manim Community を使用して数学・科学・技術アニメーションを正確に作成するための包括的なガイドです。Manim は Python ベースのアニメーションエンジンで、数式、グラフ、幾何図形、アルゴリズムなどを数学的に定義されたオブジェクトとしてアニメーション化できるため、デザインツールで近似する場合に比べて桁違いの正確性を実現します。このスキルは、uv を使った隔離された再現可能なインストール手順、シーン設計のベストプラクティス(1シーン1アイデア、カメラの抑制、ラベルの恒久的オブジェクトへのアタッチ)、`-ql` から `-qk` までのレンダリング品質プリセット、透明背景出力、および LaTeX/MathTex の統合方法をカバーします。また、複雑な数学コンテンツのアニメーションにおける一般的な失敗(TeX 不足、ネイティブライブラリの不足、低品質プリセット、数式のクリッピング等)の診断と修正方法も提供します。このスキルは、教育用ビデオ、研究発表、会議資料、および数学的正確性が絶対条件となるコンテンツ作成者にとって特に価値があります。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/aminghaseminia/blender-animation-skill/tree/HEAD/skills/manim-animation

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Manim アニメーション — 数学・技術動画

Manim は説明用ビジュアルのための Python アニメーションエンジンです。その強みは正確性にあります。数式、グラフ、または構成物を、デザインツールでの近似ではなく、数学的に定義されたオブジェクトとしてアニメーション化できます。

パターンとコードについては references/MANIM-PLAYBOOK.md を参照してください。インストールされているバージョンに応じてフラグを確認してください: https://docs.manim.community/ja/stable/

1. Manim を選ぶタイミング

以下の場合に Manim を選びます:

  • 数式、記号、または証明が主題である場合。
  • 座標系、グラフ、ベクトル、幾何学的構成が正確でなければならない場合。
  • アルゴリズム、データ構造、またはプロセスをステップバイステップで視覚的に説明する必要がある場合。
  • ラベルを手動配置ではなく数学的オブジェクトに揃える必要がある場合。
  • スタイルが控えめで図式的であり、映画的ではない場合。

以下の場合は Manim を選ばないでください: 映画的な3D、ブランド色の強いプロモーション動画、モーショングラフィックのタイポグラフィ、インタラクティブな成果物。これらは Blender、Remotion、または Web グラフィックスに適しています。

2. インストール(隔離・再現可能)

uv --version                     # 最初に uv をインストール
uv init --python 3.12 manim-project
cd manim-project
uv add manim
uv run manim --version

Linux では多くの場合ネイティブライブラリが必要です:

sudo apt update
sudo apt install build-essential python3-dev pkg-config libcairo2-dev libpango1.0-dev ffmpeg
sudo apt install texlive texlive-latex-extra texlive-fonts-recommended   # MathTex/Tex 用

macOS: brew install cairo pango pkg-config ffmpeg および MathTex を使用する場合は MacTeX などの TeX ディストリビューション。 Windows: FFmpeg と MiKTeX/TeX Live をインストール。Cairo/Pango ホイールには Microsoft C++ Build Tools が必要な場合があります。

確認:

uv run manim --version
uv run python -c "import manim; print(manim.__version__)"

プロジェクト環境が利用可能な場合は、Manim をシステム Python にインストールしないでください。プロジェクト README にバージョンを記録してください。

3. レンダリングコマンド

# 低品質プレビュー(高速)
uv run manim -pql scenes/explain.py ExplainScene

# 中品質
uv run manim -qm scenes/explain.py ExplainScene

# 高品質 / 本番
uv run manim -qh scenes/explain.py ExplainScene

# 4K
uv run manim -qk scenes/explain.py ExplainScene

# 透明背景
uv run manim -qh -t scenes/explain.py ExplainScene

# 特定セクション
uv run manim -qh scenes/explain.py ExplainScene -n 12,20

品質プリセット: -ql 480p15, -qm 720p30, -qh 1080p60, -qk 2160p60。インストールされているバージョンで確認してください。出力先は media/videos/<ファイル>/<品質>/ です。

ffprobe -v error -show_entries stream=width,height,r_frame_rate,duration \
  -of json media/videos/explain/1080p60/ExplainScene.mp4

4. シーン設計ルール

  • 1シーン1アイデア。 Scene サブクラスに分割し、長い動画は1つの巨大なシーンではなく連結によって構成します。
  • パレットとフォントはモジュール(theme.py)で1度設定し、インポートして使い回します。16進数を繰り返し記述しないでください。
  • カメラを抑制します。 Manim の MovingCameraScene は強力ですが使いすぎやすいです。視聴者が他の方法では見られない構造を明らかにするためにのみズームします。
  • 時間を尊重します。 3分で読みやすい数式の導出は、40秒では急ぎ足に感じられます。直感ではなく読む速度から滞在時間を計算します。
  • ラベルは説明するオブジェクトに付けたままにします(Tex + next_to)。後でレイアウトを変更しても、ラベルの位置がずれるのを防げます。
  • 意味には Transform/ReplacementTransform を、存在には FadeIn/FadeOut を使います。 無関係な図形を変形させると視聴者を混乱させます。
  • すべての要素を個別にアニメーション化しないでください。 VGroup でグループ化し、意図的にタイミングをずらします。

5. 構成例

from manim import *

class ExplainScene(Scene):
    def construct(self):
        title = Text("Why the derivative is a limit", font="Inter").scale(0.7)
        self.play(Write(title), run_time=1.2)
        self.wait(0.6)
        self.play(title.animate.to_edge(UP).scale(0.8), run_time=0.9)

        formula = MathTex(r"f'(x) = \lim_{h \to 0} \frac{f(x+h)-f(x)}{h}")
        formula.scale(1.2)
        self.play(Write(formula), run_time=1.6)
        self.wait(1.2)

        self.play(formula.animate.set_color_by_tex(r"h \to 0", YELLOW), run_time=0.8)
        self.wait(1.5)

6. 書き出しと引き渡し

  • -qh は高ビットレートで1080p60を生成します。中間ファイルではなく配信用に再エンコードします。
  • 透明背景: -t はアルファチャンネル付き .mov(または --format=png で PNG シーケンス)を書き出します。合成前にチェッカーボード上でアルファを確認してください。
  • Manim と Remotion/Blender を組み合わせる場合: FPS と解像度を合わせ、その後 FFmpeg または Remotion でアセンブルします。Manim のデフォルトは -qh で 60 FPS です。config.frame_rate を変更するか、意図的に変換してください。
  • ブランド付きイントロ/アウトロやキャプションの場合、Manim シーンをクリーンにレンダリングし、Remotion で合成してください。ブランドレイアウトのために Manim のタイポグラフィシステムと戦わないでください。

7. 検証

  • 高品質レンダリングの前に低品質レンダリングを確認してください。数式の間違いは480pでも見えます。
  • フレーム端で数式がクリッピングされていないか、ラベルが重なっていないか確認します。
  • LaTeX が警告なしでコンパイルされたか確認します(コンソールでの赤いテキスト警告に注意)。
  • ffprobe で最終的な長さとフレームレートを確認します。
  • 各記号を意図した数式と照らし合わせて声に出して読みます。符号の間違いはスタイルの問題ではなく、正確性のバグです。

8. よくある問題

症状原因修正
latex: command not foundTeX ディストリビューションなしTeX Live/MiKTeX をインストール、または MathTex の代わりに Text を使用
Cairo/Pango ビルドエラーネイティブライブラリ不足上記の dev パッケージをインストール
数式が赤いエラーテキストで表示LaTeX 構文またはパッケージ不足コンソールを確認。TexTemplate パッケージを追加
すべてがぼやけて見える低品質プリセット最終出力は -qh/-qk でレンダリング
ギリシャ語/アラビア語のテキストが壊れるフォントにグリフまたはシェーピングがないシェーピング対応フォントを使用、静止画でテスト、またはテキストをラスタライズ
レンダリングが非常に遅い60 FPS + 4K + 複雑なパス-ql でプレビュー、パスを単純化、シーンを分割
透明背景が失われる間違ったフォーマット-t とアルファ対応コンテナを使用、確認

9. 公式リファレンス

Individual skills in this repo

This repo contains 5 individual skills — each has its own dedicated page.

aminghaseminia/blender-animation

Build 3D animations in Blender headlessly with Python (bpy) — scene setup, materials, lighting, camera rigs, keyframe and procedural animation, Geometry Nodes, particles and simulations, EEVEE/Cycles rendering, and MP4/PNG-sequence output. Triggers include "animate in Blender", "blender python", "bpy script", "3D logo animation", "cinematic render", "particle animation", "product turntable", "render an .blend", "blender headless", or any 3D scene, camera move, or motion graphics job that needs real geometry, light, and depth.

aminghaseminia/motion-design

Art direction and motion-design craft for animation projects — creative briefs, storyboards, style frames, colour and type systems, composition, timing and easing, transition vocabulary, sound direction, accessibility, and right-to-left (Persian/Arabic) typography. Use before building scenes, when a video looks amateur or generic, when choosing palette and fonts, when a request says "make it feel premium/cinematic/modern", or when text, rhythm, or hierarchy is not landing. Tool-agnostic; pairs with blender-animation, remotion-motion-graphics, and manim-animation.

aminghaseminia/motion-studio

End-to-end animation and motion-graphics production from a natural-language brief. Routes work to Blender (3D), Remotion (2D/typography/data), Manim (math/science), motion-design craft, and FFmpeg (encode/composite/validate), then builds, previews, inspects, revises, and delivers an editable project plus final MP4. Use for any request to "make an animation", "create a video", "animate this logo", "render a motion graphic", "vibe-code an animation", or produce a promo, explainer, title sequence, or social clip.

aminghaseminia/remotion-motion-graphics

Create 2D motion graphics as code with Remotion and React — kinetic typography, logo reveals, explainers, animated charts, UI demos, social clips, subtitles, and data-driven or batch-rendered video. Use when the deliverable is primarily layout, text, and 2D graphics rather than real 3D; when a video must be generated from data or a template; or when a Blender 3D pass needs titles, captions, and transitions composited on top. Covers project setup, deterministic frame-based animation, easing, typography, audio, rendering, and licensing.

aminghaseminia/video-composition

Assemble, mix, normalize, and validate finished video from Blender, Remotion, Manim, screen capture, and audio sources using FFmpeg and FFprobe — concatenation, overlays, alpha compositing, subtitle burn-in, loudness, fades, speed ramps, GIF/thumbnail export, and platform-specific encodes. Use when combining scenes, fixing mismatched resolutions or frame rates, adding music/voice-over, burning captions, converting formats, or verifying that a rendered file is actually correct.

関連スキル