Skip to content

Ermaotie/manim-personal-style

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Manim Personal Style

License: Apache 2.0 Language

🌍 Language: English | δΈ­ζ–‡


A comprehensive guide and toolkit for creating 3Blue1Brown-style mathematical explainer animations using Manim Community (ManimCE).

This project combines narrative-first planning with ManimCE implementation best practices, providing a structured workflow from concept to production-ready animation.


🎯 Overview

Manim Personal Style is designed to help you create engaging mathematical visualizations by:

  • Planning first: Draft detailed scene compositions before writing code
  • Best practices: Follow proven patterns and rules from the Manim community and 3Blue1Brown's style
  • Reusable patterns: Templates, examples, and rule documents for common scenarios
  • Modular workflow: Three-phase approach (understand β†’ plan β†’ implement)

Perfect for educators, content creators, and anyone making math explainer videos.

⚑ Quick Installation

Add this skills toolkit to your project with a single command:

npx skills add Ermaotie/manim-personal-style

This will import all templates, examples, rules, and references into your workspace, giving you instant access to:

  • πŸ“‹ Scene planning templates
  • πŸ“š Complete rule documentation
  • πŸ’‘ Working code examples
  • 🎨 Visual technique guides

Requirements:

  • Node.js 14+ (for npx)
  • Manim Community installed (for animation rendering)

πŸ“‹ Workflow

Phase 0: Understand the Request

Before planning, gather key requirements:

  • Audience and scope (who is this for? what's the core concept?)
  • Length and delivery format (mp4/gif, resolution/quality)
  • Style and visual metaphors (animations, colors, recurring motifs)
  • Narration and math depth (what's the target knowledge level?)
  • Assets and constraints (timeline, render limits, brand colors)

Phase 1: Draft scenes.md (Required Before Code)

Create a comprehensive scene plan using the provided template:

  • Break the video into clear scenes with purpose, visuals, and narration
  • Define a color palette and visual language
  • Outline transitions and recurring motifs
  • Include technical notes for implementation

Output: scenes.md in your working directory (use templates/scenes-template.md as a guide)

Phase 1.5: Draft scene_with_position.md (Required Before Code)

Validate the spatial layout and frame composition:

  • Enumerate all objects, their sizes and positions for each scene
  • Perform boundary checks (ensure objects fit within frame)
  • Check for overlaps and resolve conflicts
  • Document z-order if relevant for 3D scenes

Output: scene_with_position.md in your working directory (use templates/scene-with-position-template.md)

Phase 2: Review and Lock the Plan

  • Request user approval or edits to the plan
  • Validate total duration, style, and delivery format fit requirements
  • Confirm implementation approach before coding

Phase 3: Implement with ManimCE Best Practices

  • Translate scenes into ManimCE code using from manim import *
  • Prefer one Python file per scene or logical grouping
  • Use provided templates (templates/basic_scene.py, templates/camera_scene.py, etc.)
  • Follow rules from rules/ directory
  • Keep code modular with reusable mobjects and clear timing

πŸ“ Project Structure

manim-personal-style/
β”œβ”€β”€ SKILL.md                      # Full workflow guide and system prompt
β”œβ”€β”€ README.md                     # This file
β”œβ”€β”€ examples/                     # Working ManimCE code examples
β”‚   β”œβ”€β”€ basic_animations.py       # Shape creation, transforms, groups
β”‚   β”œβ”€β”€ graph_plotting.py         # Axes, functions, parametric curves
β”‚   β”œβ”€β”€ math_visualization.py     # Derivatives, integrals, series
β”‚   β”œβ”€β”€ 3d_visualization.py       # 3D shapes, cameras, projections
β”‚   β”œβ”€β”€ updater_patterns.py       # Dynamic objects with updaters
β”‚   β”œβ”€β”€ lorenz_attractor.py       # Complex animation example
β”‚   └── attention/                # Specialized animation examples
β”‚       β”œβ”€β”€ scenes.py
β”‚       └── helpers.py
β”œβ”€β”€ rules/                        # ManimCE best practices reference
β”‚   β”œβ”€β”€ scenes.md                 # Scene structure and lifecycle
β”‚   β”œβ”€β”€ mobjects.md               # Mobjects (shapes, text, groups)
β”‚   β”œβ”€β”€ animations.md             # Core animation types
β”‚   β”œβ”€β”€ positioning.md            # Layout and alignment
β”‚   β”œβ”€β”€ grouping.md               # Grouping and organizing objects
β”‚   β”œβ”€β”€ text.md                   # Text objects and styling
β”‚   β”œβ”€β”€ latex.md                  # LaTeX rendering and math
β”‚   β”œβ”€β”€ text-animations.md        # Text-specific animations
β”‚   β”œβ”€β”€ shapes.md                 # Common shapes
β”‚   β”œβ”€β”€ lines.md                  # Line types and drawing
β”‚   β”œβ”€β”€ axes.md                   # Axes and coordinate systems
β”‚   β”œβ”€β”€ graphing.md               # Plotting graphs and functions
β”‚   β”œβ”€β”€ 3d.md                     # 3D scenes and transformations
β”‚   β”œβ”€β”€ camera.md                 # Camera movement and control
β”‚   β”œβ”€β”€ timing.md                 # Duration and pacing
β”‚   β”œβ”€β”€ updaters.md               # Dynamic updates with updaters
β”‚   β”œβ”€β”€ styling.md                # Colors and visual appearance
β”‚   β”œβ”€β”€ colors.md                 # Color palettes and schemes
β”‚   β”œβ”€β”€ animation-groups.md       # Parallel and sequential animations
β”‚   β”œβ”€β”€ creation-animations.md    # Object creation effects
β”‚   β”œβ”€β”€ transform-animations.md   # Transformation effects
β”‚   β”œβ”€β”€ config.md                 # Configuration and settings
β”‚   └── cli.md                    # Command-line rendering
β”œβ”€β”€ references/                   # Narrative and composition guides
β”‚   β”œβ”€β”€ narrative-patterns.md     # Story structures (Mystery β†’ Investigation β†’ Resolution, etc.)
β”‚   β”œβ”€β”€ visual-techniques.md      # Visualization techniques
β”‚   └── scene-examples.md         # Example scenes.md fragments
└── templates/                    # Starting templates for new projects
    β”œβ”€β”€ scenes-template.md        # Template for scenes.md
    β”œβ”€β”€ scene-with-position-template.md  # Template for layout planning
    β”œβ”€β”€ basic_scene.py            # Standard Scene template
    β”œβ”€β”€ camera_scene.py           # MovingCameraScene template
    └── threed_scene.py           # ThreeDScene template

πŸš€ Quick Start

1. Understand Your Requirements

Ask yourself (or clarify with the user):

  • What is the core mathematical concept?
  • Who is the target audience?
  • How long should the video be?
  • What colors and style fit the topic?

2. Plan with scenes.md

Copy templates/scenes-template.md and fill in:

# Scene Plan: [Title]

## Overview
[2-3 sentence description]

## Visual Language
- Colors: [primary, secondary, highlight]
- Motifs: [visual patterns]
- Style: [minimal, detailed, etc.]

## Scenes
1. **Opening** (duration: 5s)
   - Purpose: Hook the viewer
   - Visuals: [describe objects/animations]
   - Narration: [what the narrator says]

2. **Build Up** (duration: 15s)
   - Purpose: Introduce key concepts
   - [continue...]

[Include all scenes, transitions, palette, math content, and implementation notes]

3. Plan Layout with scene_with_position.md

Copy templates/scene-with-position-template.md and specify positions for each object in each scene.

4. Implement Scenes

Start with templates/basic_scene.py and reference examples/ for patterns:

from manim import *

class MyScene(Scene):
    def construct(self):
        # Create objects
        circle = Circle(radius=1, color=BLUE)
        text = Text("Hello, Manim!", font_size=48)
        
        # Animate
        self.play(Create(circle))
        self.play(Write(text))
        self.wait(2)

Run with:

manim -pql my_file.py MyScene        # Quick preview
manim -pqh my_file.py MyScene        # High quality
manim -i my_file.py MyScene          # Interactive (jupyter-like)

πŸ“š Key Resources

Learning Paths

For beginners:

  1. Read references/narrative-patterns.md for story structure
  2. Study examples/basic_animations.py for fundamental techniques
  3. Review rules/scenes.md and rules/mobjects.md
  4. Create your first scenes.md using the template

For intermediate creators:

  1. Explore examples/graph_plotting.py and examples/3d_visualization.py
  2. Dive into rules/positioning.md, rules/timing.md, rules/updaters.md
  3. Study references/visual-techniques.md for composition
  4. Experiment with templates/camera_scene.py and templates/threed_scene.py

For advanced animators:

  1. Master rules/camera.md and rules/3d.md for complex scenes
  2. Study examples/updater_patterns.py and examples/lorenz_attractor.py
  3. Reference examples/attention/ for specialized patterns
  4. Optimize rendering with rules/cli.md and rules/config.md

Common Tasks

Task Reference
Create basic shapes examples/basic_animations.py, rules/shapes.md
Plot graphs and axes examples/graph_plotting.py, rules/axes.md, rules/graphing.md
Write LaTeX math rules/latex.md, rules/text.md
Animate text rules/text-animations.md
Move the camera rules/camera.md, templates/camera_scene.py
Build 3D scenes rules/3d.md, examples/3d_visualization.py, templates/threed_scene.py
Use dynamic objects rules/updaters.md, examples/updater_patterns.py
Choose colors rules/colors.md, rules/styling.md
Time your animations rules/timing.md, rules/animation-groups.md

🎨 Example Workflows

Example 1: Explaining a Mathematical Derivative

  1. Phase 0: Gather that target is high school students, video should be 2 minutes, use animated graph
  2. Phase 1: Create scenes.md with: Opening hook β†’ Tangent line concept β†’ Derivative definition β†’ Examples
  3. Phase 1.5: Plan positions for axes, function curve, tangent line, labels
  4. Phase 2: Get approval on scene outline
  5. Phase 3: Implement using templates/basic_scene.py + examples/graph_plotting.py patterns

Example 2: 3D Complex Numbers

  1. Phase 0: Audience is math enthusiasts, 3-minute deep dive, colorful and detailed
  2. Phase 1: Create scenes.md with: Intro β†’ Complex plane in 2D β†’ Extension to 3D β†’ Multiplication in 3D
  3. Phase 1.5: Plan 3D coordinates and camera positions
  4. Phase 2: Approve the narrative flow
  5. Phase 3: Implement using templates/threed_scene.py + examples/3d_visualization.py

πŸ”§ Configuration

All Manim Community configuration goes in manim.cfg (in your project root):

[CLI]
quality = high_quality_1080p
preview = True
show_in_file_browser = False

[resolution_default]
pixel_height = 1080
pixel_width = 1920
frame_rate = 60

See rules/config.md for all available options.


πŸ“– Manim Community Resources


πŸ’‘ Best Practices Summary

βœ… Do:

  • Plan with scenes.md before coding
  • Validate layouts with scene_with_position.md
  • Use one file per scene or logical grouping
  • Keep animations under 6 seconds per scene (unless building complexity)
  • Reuse and transform mobjects rather than replacing them
  • Use constants for colors, fonts, and timing
  • Test rendering at low quality first (-ql), then increase
  • When objects overlap or exceed frame boundaries, use scene_with_position.md to reference scene # and object_id for precise positioning adjustments in code
    • Example: In scene_with_position.md, document scene 2, object_id: axis_x, position: (0, -3.5, 0)
    • In code, adjust: axis_x.move_to([0, -3.5, 0]) or reference the mapping dictionary

❌ Don't:

  • Write code without a scene plan
  • Skip layout validation
  • Use hardcoded magic numbers
  • Create massive files with 10+ scenes
  • Animate too many objects simultaneously without grouping
  • Forget to include narration notes in the plan
  • Render everything at the highest quality until final version
  • Leave overlapping or out-of-bounds objects without documented fixes in scene_with_position.md

πŸ“ Contributing

This toolkit is designed to evolve. When you create new examples or discover useful patterns:

  1. Add examples to examples/
  2. Document the rule in rules/
  3. Update this README with references

πŸ“„ License

Manim Personal Style is licensed under the Apache License 2.0.

  • πŸ“œ Full license text: LICENSE
  • βœ… You can freely use, modify, and distribute this project
  • βœ… You can use it commercially
  • ⚠️ You must include a copy of the license and state significant changes made
  • πŸ”— For more details on Apache 2.0: https://www.apache.org/licenses/LICENSE-2.0

Note: Manim Community itself is licensed under the MIT License. See https://github.com/ManimCommunity/manim for details.


πŸ™‹ FAQ

Q: Do I need to use the three-phase workflow every time? A: For complex videos, yes. For simple scenes, a minimal scenes.md is fineβ€”but still start with planning.

Q: Can I use this with ManimGL instead of ManimCE? A: This toolkit focuses on ManimCE. ManimGL has different APIs and conventions; you'd need to adapt.

Q: How long does it take to render a video? A: Depends on complexity and quality. A 1-minute video at high quality can take 10-30 minutes. Use -ql (low quality) during development and -qh (high quality) for final output.

Q: Can I export to GIF? A: Yes! Use manim -pql -s -f gif my_file.py MyScene to render a static frame, or create individual frames and use ImageMagick.

Q: Where can I get help with Manim? A: Check the official docs, ask on the Manim Discord, or review the examples/ and rules/ in this toolkit.


Happy animating! 🎬

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages