Skip to content

Manim v0.21.0

Latest

Choose a tag to compare

@behackl behackl released this 10 Aug 21:56
861cd48

See our rendered changelog.

What's Changed

Breaking Changes 🚨

  • Delegate color handling in Code to Pygments and document custom styles by @Helbronner in #4816

    Code no longer honors foreground color overrides passed through
    paragraph_config={"color": ...} or Code.default_paragraph_config["color"];
    syntax and line-number colors now come from the selected Pygments
    formatter_style. To customize them, pass a custom Pygments Style subclass
    through formatter_style and configure its token styles and
    line_number_color. Background colors can still be overridden with
    background_config={"fill_color": ...}; otherwise, the selected Pygments
    style provides the background. See the note in the documentation of Code
    for an explicit example.

  • Speed up Cairo renderer by 2.2x on animation-heavy scenes by @HamdiBarkous in #4695

    Cairo path construction now uses vectorized subpath splitting, and pixel-array
    handling avoids redundant copies while producing pixel-identical output. This
    changes Camera.convert_pixel_array(): the convert_from_floats argument has
    been removed, and the method now always converts floats to the camera's pixel
    format. Omit the argument if it was previously True; use
    np.array(pixel_array) instead if relying on the old default copying behavior.

Highlights 🌟

  • Introduce first-class support for rendering text and markup via Typst (optional dependency) by @behackl in #4681

    The new Typst and TypstMath mobjects compile Typst markup
    and mathematical expressions directly to SVG without requiring a TeX
    installation. They support label-based subgroup selection, {{ ... }}
    expression grouping, and integration with existing label APIs. Install the
    optional dependency with pip install "manim[typst]".

  • Hash NumPy arrays without JSON expansion by @dexhunter in #4883

    NumPy arrays in scene cache keys are now represented by deterministic hashes
    of their complete logical contents instead of sampled JSON data. This
    prevents stale cache hits when visible image data changes and reduces hashing
    CPU time by roughly 94–98% in representative benchmarks.

  • Add support for encoding partial movie files in parallel by @pjfo in #4899

    The new max_inflight_encoders configuration option allows partial movie
    encoding to overlap with rendering while bounding the number of encoder
    workers. Try it with
    manim render --max-inflight-encoders 4 --encoder-queue-size 8 scene.py Scene;
    --encoder-queue-size limits the pending frame buffers held by each encoder.
    The default of one in-flight encoder preserves serial behavior; higher values
    reduced an encoding-heavy benchmark by 56% and larger real-world renders by
    roughly 8–11%.

New Features ✨

Enhancements 🚀

Bug Fixes 🐛

  • Fix OpenGL crashes in arrange_in_grid() and get_location() by @Croustit in #4622
  • Prevent get_nth_subpath() from raising IndexError and ensure it returns a NumPy array by @MqCreaple in #4630
  • Preserve closed curves in put_start_and_end_on() by @GoThrones in #4658
  • Fix inconsistent stroke-width scaling for text in compound objects by @vihdutta in #4694
  • Accept a single Group or VGroup in CyclicReplace and Swap by @irvanalhaq9 in #4211
  • Prevent empty submobjects from distorting parent dimensions by @gvauvert in #4088
  • Honor language when constructing Code from code_file by @GniLudio in #4706
  • Fix ThreeDScene.set_to_default_angled_camera_orientation() raising AttributeError by @siddhu-pikachu in #4704
  • Fix reversed default resolution in manim init project --default by @aoxiangtianyu-go in #4839
  • Prevent memoizer collisions between object hashes and IDs by @pjfo in #4901
  • Prevent round_corners() failures for collinear vertices by @MeiSiristhebest in #4906
  • Fix checkhealth false positives for uv launcher shims by @srinu2003 in #4889
  • Fix OpenGL triangulation errors at ring boundaries by @Theelx in #4819
  • Fix Angle crashes for parallel or collinear lines by @MeiSiristhebest in #4907
  • Stabilize cache hashes for transient objects by @pjfo in #4896
  • Ignore SVG shape elements without points by @behackl in #4917
  • Normalize Code baseline alignment in Paragraph by @Croustit in #4692
  • Preserve z-index ordering in animation groups by @behackl in #4918
  • Let MathTex handle multiline strings by @henrikmidtiby in #4634
  • Ensure that glyphs at end of Code lines are no longer deleted when disable_ligatures is False by @nikolajmunk in #4926

Documentation 📚

Testing 🧪

  • Add unit tests for color helper functions by @THE-RAF in #4749
  • Add regression tests for four recent VMobject fixes by @THE-RAF in #4750
  • Add tests for edge lookup in GenericGraph.__getitem__() by @sridhar-3009 in #4753
  • Add a regression test for text stroke-width scaling in compound objects by @vihdutta in #4703

Infrastructure & Build 🔨

Code Quality & Refactoring 🧹

Type Hints 📝

Other Changes

New Contributors

Full Changelog: Compare view