Skip to main content

Introduction

ManimVTK allows you to export your animations to VTK (Visualization Toolkit) file formats, enabling visualization in ParaView, PyVista, and other scientific tools.
VTK export works with any renderer - you can use Cairo, OpenGL, or VTK renderer and still export to VTK formats.

Export Methods

Static Export (Final Frame)

Export the final state of your scene:
Output formats:
  • Single mobject → .vtp (VTK PolyData)
  • Multiple mobjects → .vtm (VTK MultiBlock Dataset)

Time Series Export (All Frames)

Export every frame as a VTK file:
Output:
  • .pvd - ParaView Data collection file
  • .vtp files - One per frame
  • viewer.html - Basic HTML viewer template

Time Series Guide

Detailed guide on time series export

File Formats

VTK PolyData (.vtp)

Used for single objects with points, lines, and polygons. When created:
  • Scene contains a single mobject
  • Explicitly exporting one mobject
Structure:
Example output:

VTK MultiBlock (.vtm)

Used for scenes with multiple objects. When created:
  • Scene contains multiple mobjects
  • Complex hierarchical structures
Structure:
Example output:

Basic Examples

Export a Simple Shape

Output: media/vtk/CircleExport/CircleExport_final.vtp

Export Multiple Objects

Output:

Export 3D Surfaces

Export Location

By default, VTK files are saved to:
The location follows ManimVTK’s standard media directory structure:

Programmatic Export

You can also export VTK files programmatically:

Data Preservation

Colors

Mobject colors are preserved in VTK export:
In VTK, colors are stored as PointData arrays named “Colors” with RGBA values.

Geometry

Different mobject types are converted appropriately:
MobjectVTK Representation
Filled shapesPolygons (triangulated)
Stroked shapesPolyLines
SurfacesPolygonal mesh
Text/TexFilled paths (polygons)

Transformations

All transformations (position, rotation, scale) are applied before export:

Advanced Features

Scalar Fields

Attach scalar data to exported geometry:
See Scalar Fields for details.

Vector Fields

Attach vector data for flow visualization:
See Vector Fields for details.

Viewing Exported Files

ParaView

  1. Open ParaView
  2. File → Open
  3. Select .vtp, .vtm, or .pvd file
  4. Click “Apply” in the Properties panel

ParaView Guide

Detailed ParaView visualization guide

PyVista (Python)

vtk.js (Web)

Best Practices

VTK XML formats are human-readable but can be large. Considerations:
  • Use compression in ParaView: File → Save Data → check “Compressed”
  • Lower resolution for testing: resolution=(20, 20) instead of (50, 50)
  • Use binary format for production (requires VTK binary writer)
Keep exports organized:
Use static export when:
  • You only need the final result
  • Creating static visualizations
  • File size is a concern
Use time series when:
  • Analyzing animation in ParaView
  • Need frame-by-frame data
  • Creating interactive temporal visualizations
Export adds minimal overhead:
  • Cairo/OpenGL rendering time: ~90%
  • VTK export time: ~10%
Time series export is slower due to per-frame I/O.

Troubleshooting

Possible causes:
  • Forgot --vtk-export flag
  • Scene has no mobjects
  • Permission issues in output directory
Check:
Possible causes:
  • VTK file corrupted
  • ParaView version too old
Solution:
  • Re-export the file
  • Update ParaView to 5.9+
  • Check file with text editor (XML should be valid)
Cause: Color data not exported correctlyCheck:
  • Are colors set before rendering?
  • Does the mobject have a stroke or fill?

Next Steps

Time Series Export

Learn about frame-by-frame export

ParaView Guide

Visualize exports in ParaView

Scalar Fields

Add scientific data fields

Examples

See scientific visualization examples