Running Manim Scripts

Pymations runs Manim Community scripts. Paste a script that starts with from manim import * into a Python file, press Run, and it plays in the preview. Nothing needs installing.

Pymations is its own implementation of the same script language, written for Circuitry and the browser. It is not made by, or connected with, the Manim Community project.

What runs as it is

  • Both forms: class MyScene(Scene): def construct(self): ..., any number of scenes per file (they all play, in order), and MovingCameraScene.
  • The names: shapes, Text, MathTex, Tex, Axes, NumberPlane, VGroup, the animations, rate functions, colour constants, direction constants (UP, UR...) and buffers (SMALL_BUFF...), np, and config.
  • The numbers: default sizes, colours, gaps and timings were measured against Manim Community 0.22 and match it: a circle is red with radius 1, Write is linear and takes 1 or 2 seconds, smooth is Manim's own curve, arrows have the same tips and gaps, axes are 12 by 6, and next_to, arrange and to_edge place things in the same spots.
  • Sound: add_sound plays the sound at that point of the timeline, and it is mixed into a recorded video.
  • Updaters (add_updater, always_redraw, ValueTracker), self.camera.frame.animate, next_section, save_state/Restore, generate_target/MoveToTarget.

What is different

AreaIn Pymations
MathsLaid out by KaTeX instead of LaTeX. Almost all maths looks the same, within a few percent in size. Custom LaTeX preambles (TexTemplate) and rare LaTeX packages are not available
Text fontBuilt-in fonts: a sans-serif, "serif" and "mono". Another family name picks the nearest of those, so text can be a little wider or narrower than with your computer's fonts. A font file next to the .py (font="Brand.ttf") is used as it is
3DThreeDScene scripts run, but play flat, in 2D; camera turns are skipped with a note
RenderingNo command line, quality flags or manim.cfg: press Run to watch, and Record Video to make the file. config.background_color and config.frame_height in the script work
Reading positionsPositions are worked out in the preview, so turning one into plain numbers needs await (how). Using them in placement, Line(a.get_center(), ...) and sums works without
interactive_embedSkipped

Something Pymations doesn't have yet stops the run with a plain message naming it, for example "Square has no apply_complex_function() in the preview yet", and the line it is on. The rest of the file is fine; replace or remove that line.

The import

from manim import * and from pymations import * give the same names. Use pymations in new files; keep manim in a pasted script so it still runs with Manim itself.

Tips for pasted scripts

  • A script made for Manim often ends with self.wait(); that is fine. A scene.render() at the bottom is fine too.
  • Scripts written by AI sometimes use names from older Manim versions (ShowCreation, get_graph); those work.
  • If a long equation fails, the message under the preview quotes KaTeX's reason. Usually a command from a LaTeX package is the cause; write it another way.