Skip to main content

Installation

Prerequisites

Linux Users: ManimVTK depends on ManimPango, which requires system dependencies on Linux. Install them first before proceeding.
sudo apt install libpango1.0-dev pkg-config python3-dev
sudo dnf install pango-devel pkg-config python3-devel
sudo pacman -S pango pkgconf

Install ManimVTK

Verify Installation: Run manimvtk --version to confirm installation

Your First Animation

Let’s create a simple animation to verify everything is working.

Step 1: Create a Scene File

Create a new file called example.py:
from manimvtk import *

class CircleExample(Scene):
    def construct(self):
        # Create a circle
        circle = Circle(radius=1, color=BLUE)
        
        # Add it to the scene
        self.play(Create(circle))
        self.wait()

Step 2: Render the Animation

Render your scene with the default Cairo renderer:
manimvtk -pql example.py CircleExample
Command breakdown:
  • -p: Preview the video after rendering
  • -q: Quality (l=low, m=medium, h=high)
  • -l: Low quality for faster rendering
The rendered video will be saved in media/videos/example/480p15/CircleExample.mp4

Step 3: Add VTK Export

Now let’s export the scene to VTK format:
manimvtk -pql example.py CircleExample --vtk-export
This creates:
  • media/videos/example/480p15/CircleExample.mp4 - Video file
  • media/vtk/CircleExample/CircleExample_final.vtp - VTK file
Success! You’ve created your first ManimVTK animation with VTK export

Using the VTK Renderer

Switch to the VTK renderer for high-quality 3D rendering:
from manimvtk import *

class SphereExample(ThreeDScene):
    def construct(self):
        # Create a 3D sphere
        sphere = Sphere(radius=1.5, resolution=(20, 20))
        sphere.set_color(BLUE)
        
        # Rotate the camera
        self.set_camera_orientation(phi=75 * DEGREES, theta=30 * DEGREES)
        
        # Animate
        self.play(Create(sphere))
        self.play(Rotate(sphere, angle=PI, axis=UP))
        self.wait()
Render with the VTK renderer:
manimvtk -pql example.py SphereExample --renderer vtk --vtk-export

Time Series Export for ParaView

Export frame-by-frame VTK files for animation scrubbing in ParaView:
from manimvtk import *

class AnimatedCircle(Scene):
    def construct(self):
        circle = Circle(radius=1, color=BLUE)
        self.add(circle)
        
        # Animate the circle growing
        self.play(circle.animate.scale(2))
        self.wait()
Render with time series export:
manimvtk -pql example.py AnimatedCircle --vtk-time-series
Output structure:
media/vtk/AnimatedCircle/
├── AnimatedCircle.pvd              # ParaView collection file
├── AnimatedCircle_00000.vtp        # Frame 0
├── AnimatedCircle_00001.vtp        # Frame 1
├── ...
└── AnimatedCircle_viewer.html      # HTML viewer template
Open the .pvd file in ParaView to scrub through the animation using the time slider

Common CLI Options

OptionDescription
-pPreview video after rendering
-q{l,m,h}Quality: low, medium, or high
-sSave last frame as PNG
-aRender all scenes in file
--renderer {cairo,opengl,vtk}Choose renderer
--vtk-exportExport final scene to VTK
--vtk-time-seriesExport all frames as VTK time series

See all CLI options

Complete reference of command-line options

Next Steps

Getting Help

Report issues on our GitHub repository
Check the Manim Community resources and Discord