A community-maintained Python framework for creating mathematical animations.
Prepare new release: `v0.22.0` (#5050)
Benjamin Hackla6d5cc02b430
diff --git a/.github/release.yml b/.github/release.ymlindex 7d80e3077..e8c6d9989 100644--- a/.github/release.yml+++ b/.github/release.yml@@ -35,6 +35,10 @@ changelog:labels:- pr:bugfix+ - title: "Performance ⚡"+ labels:+ - performance+- title: "Deprecations & Removals ⚠️"labels:- pr:deprecation@@ -61,6 +65,10 @@ changelog:labels:- typehints+ - title: "Dependencies 📦"+ labels:+ - dependencies+# Catch-all (must be last)- title: "Other Changes"labels:diff --git a/CITATION.cff b/CITATION.cffindex 3b025d049..96ae1622c 100644--- a/CITATION.cff+++ b/CITATION.cff@@ -4,10 +4,10 @@ authors:-name: "The Manim Community Developers"cff-version: "1.2.0"-date-released: 2026-08-10+date-released: 2026-10-08license: MITmessage: "We acknowledge the importance of good software to support research, and we note that research becomes more valuable when it is communicated effectively. To demonstrate the value of Manim, we ask that you cite Manim in your work."title: Manim – Mathematical Animation Frameworkurl: "https://www.manim.community/"-version: "v0.21.0"+version: "v0.22.0"...diff --git a/docs/source/changelog.rst b/docs/source/changelog.rstindex 9d0938a26..fb4b0c651 100644--- a/docs/source/changelog.rst+++ b/docs/source/changelog.rst@@ -7,6 +7,7 @@ This page contains a list of changes made between releases... toctree:::maxdepth: 1+ changelog/0.22.0-changelogchangelog/0.21.0-changelogchangelog/0.20.1-changelogchangelog/0.20.0-changelogdiff --git a/docs/source/changelog/0.22.0-changelog.md b/docs/source/changelog/0.22.0-changelog.mdnew file mode 100644index 000000000..472828033--- /dev/null+++ b/docs/source/changelog/0.22.0-changelog.md@@ -0,0 +1,239 @@+---+short-title: v0.22.0+description: Changelog for v0.22.0+---++# v0.22.0++Date+: October 08, 2026+++## Highlights 🌟++### Unified output selection and configurable video encoding++Choosing what Manim produces has been reworked around a single `format`+setting. `--format` (or `format` in the `[CLI]` section of a config file)+selects exactly one primary artifact: `auto` (the default; MP4, or MOV for+transparent output), `mp4`, `mov`, `webm`, `gif`, `png` (last frame only),+`png-sequence` (every frame), or `none` (evaluate the scene without writing+media). It replaces the overlapping `--write_to_movie`, `-g`/`--save_pngs`,+`-i`/`--save_as_gif`, and `--force_window` options. Viewing the result is now+separate from choosing what to write: `-p`/`--preview` opens the finished file+with either renderer, while `-l`/`--live-preview` shows a live window (OpenGL).+As a consequence, the OpenGL renderer now writes files by default, just like+Cairo. The `--custom_folders` preset has been removed in favor of setting+each output location separately. ({pr}`4966`, {pr}`4969`)++Video encoding is now configurable, too: the new `[video_encoder]` config+section and the `--video-codec`, `--pixel-format`, and repeatable+`--encoder-option KEY=VALUE` options control how partial movie files are+encoded, for example+`manim render --video-codec libx264 --encoder-option crf=18 --encoder-option preset=slow scene.py`.+The new `manim cache clear` command replaces the `--flush_cache` flag. ({pr}`4976`)++Scenes rendered with default settings need no changes, but scripts and config+files relying on the removed options have to be updated. See the migration+notes in the Breaking Changes section below.++Comprehensive documentation for the updated configuration system+can be found in the+{doc}`configuration guide </guides/configuration>` and the+{doc}`output settings tutorial </tutorials/output_and_config>`.++### A `Manager` for coordinating the render flow++This release takes a first step towards a full overhaul of Manim's+render lifecycle by introducing a {class}`.Manager` object that coordinates+the processing of a {class}`.Scene`. Regular scenes (i.e., those without+custom cameras, renderers, or file writers) do+not need any changes.++Until now, the responsibilities of the render lifecycle were spread+across `Scene`, the renderer, the camera, and the file writer.+As the name suggests, the `Manager` is now the central manager of this process.+This release lays the foundation for the new architecture. The render+loop has not been fully restructured yet.+Upcoming releases will build on this to move rendering execution+and file writing into the `Manager`.+This will allow us to remove the remaining cross-dependencies between+scenes, renderers, and file writing.++The {doc}`rendering deep dive </guides/deep_dive>` has been updated to+describe the new flow. ({pr}`4916`)++### Improved rendering of {class}`.Text` etc. with small font size++This release also features a new version of our plain text rendering+engine (`Pango`) wrapper `ManimPango` that fixes a long-standing issue with the kerning+(spacing between letters) for text with very small font sizes. Now+mobjects like `Text("hello world, this is a test", font_size=1)` look crisp+and are typeset as intended. ({pr}`5041`)++## What's Changed+### Breaking Changes 🚨+* Introduce a `Manager` to coordinate the render flow by {user}`behackl` in {pr}`4916`++ Scenes, including overrides of `setup`, `construct`, and `tear_down`, need no+ changes. `Scene.render`, `Scene.play`, `Scene.next_section`,+ `Scene.add_subcaption`, and `Scene.add_sound` now delegate to the scene's+ {class}`.Manager` (`scene.manager`), which owns the render lifecycle formerly+ implemented in `Scene.render`. Code that reimplemented or patched these+ internals should call the public `Scene` methods instead of driving the+ renderer or file writer directly. The "Rendered … Played N animations" log+ record now originates from the `manager` module instead of `scene`.++* Rework output configuration options and how they are consumed by {user}`behackl` in {pr}`4966`++ Output is now selected with the single `format` option; the old switches have+ been removed:++ - `--write_to_movie` / `write_to_movie = True`: use the default+ `format = auto` or an explicit `mp4`, `mov`, `webm`, or `gif`;+ `write_to_movie = False` becomes `format = none`.+ - `-g` / `--save_pngs`: `--format png-sequence` (frames are written to+ `media/images/<module>/<Scene>/`).+ - `-i` / `--save_as_gif`: `--format gif`.+ - `save_last_frame` in config files: `format = png`. The `-s` flag and+ `config.save_last_frame` still work.+ - `--force_window`: `-l` / `--live-preview`; add a concrete format to also+ record the live render.+ - `-f`: `--show_in_file_browser`. `config.movie_file_extension`: `config.format`.++ Behavior changes: `--format png` saves only the last frame; an explicit video+ format fails for scenes without `play` or `wait` calls (`auto` saves a PNG+ instead); with OpenGL, `-p` opens the finished file instead of a live window+ and files are written by default; transparent output requires `auto`, `mov`,+ or `webm`. Output settings are captured when a `Scene` is constructed, so+ create scenes inside the intended `tempconfig` block. Rendering no longer+ overwrites `config.output_file`; read+ `scene.renderer.file_writer.final_file_path` instead. The format helpers+ `is_mp4_format`, `is_gif_format`, `is_png_format`, `is_webm_format`,+ `is_mov_format`, and `write_to_movie` were removed from+ `manim.utils.file_ops`; inspect `scene.session_spec` or+ `scene.manager.output_spec` instead. For custom renderers and file writers,+ see {pr}`4976`.++* Refactor media output path resolution and remove the `--custom_folders` CLI flag and config option by {user}`behackl` in {pr}`4969`++ `--custom_folders`, `config.custom_folders`, and the `[custom_folders]` config+ section have been removed; set the regular directory options under `[CLI]`+ instead. The former preset corresponds to:++ ```ini+ [CLI]+ media_dir = videos+ video_dir = {media_dir}+ sections_dir = {media_dir}+ images_dir = {media_dir}+ text_dir = {media_dir}/temp_files+ tex_dir = {media_dir}/temp_files+ log_dir = {media_dir}/temp_files+ partial_movie_dir = {media_dir}/partial_movie_files/{scene_name}+ ```++ `-o` / `--output_file` is now rejected when rendering more than one scene+ (with `-a` or several scene names); drop it or render scenes separately. The+ resolved format determines the file suffix, so `-o movie.mov --format mp4`+ produces `movie.mov.mp4`. Section videos now include the section name (e.g.+ `MyScene_0000_create-square.mp4`); read filenames from the `video` field of+ the section JSON instead of constructing them.++* Move video segment encoding to a dedicated module and detach `SceneFileWriter` from renderer state by {user}`behackl` in {pr}`4976`++ Replace `--flush_cache` and `flush_cache = True` with+ `manim cache clear scene.py SceneName`. The `[ffmpeg]` config section is now+ `[media]` (`loglevel` stays the same), and `config.ffmpeg_loglevel` is now+ `config.media_loglevel`. Cache keys now include the encoder settings, so+ existing cached segments are re-rendered once. `SceneFileWriter.clean_cache()`+ and `flush_cache_directory()` were replaced by `prune_segment_cache()` and+ `clear_segment_cache()` in `manim.utils.caching`.++ Custom renderers and file writers: `init_scene` now has the signature+ `init_scene(scene, session_spec, file_writer_settings)`, and the writer is+ constructed from these settings alone (it no longer receives the renderer or+ reads the global `config`). Renderers must declare `capabilities`. Frames are+ passed as owned `uint8` RGBA arrays of shape `(height, width, 4)` with+ top-left origin: `write_frame(pixels, repeat=n)` and `save_image(pixels)`;+ `begin_animation()` and `open_partial_movie_stream()` additionally require+ `animation_index=`. `get_hash_from_play_call()` requires the `backend`,+ `encoder_fingerprint`, and `renderer_state` keyword arguments, and+ `get_full_sound_file_path()` requires `assets_dir`.++### Enhancements 🚀+* Improve the error message of `throw_error_if_no_points` and raise `ValueError` instead of `Exception` by {user}`smmariquit` in {pr}`4927`+* Add a `key` parameter to `list_update` and `list_difference_update` to support unhashable elements by {user}`nikolajmunk` in {pr}`4975`++### Bug Fixes 🐛+* Fix OpenGL-specific code paths that were skipped because renderer comparisons against the string `"opengl"` never matched by {user}`pjfo` in {pr}`4929`+* Fix mobject duplication during animations by treating ancestors of moving mobjects as moving by {user}`nikolajmunk` in {pr}`4936`+* Allow `Graph` and `DiGraph` to be initialized without vertices by {user}`christopher-hampson` in {pr}`4946`+* Fix singular/plural form of "submobject(s)" in `VGroup.__str__` by {user}`nikolajmunk` in {pr}`4950`+* Fix right-bounds check in `OpenGLMobject.is_off_screen` by {user}`GniLudio` in {pr}`4953`+* Fix `OpenGLMobject.stretch_to_fit_depth` stretching along the wrong dimension by {user}`GniLudio` in {pr}`4955`+* Fix `OpenGLMobject.get_boundary_point` by {user}`GniLudio` in {pr}`4956`+* Restore renderer class bases when updating the config from another `ManimConfig` by {user}`emerardd` in {pr}`4958`+* Skip hidden files and tolerate vanishing files when cleaning the partial movie file cache by {user}`changsheng0804-blip` in {pr}`4954`+* Fix `LaggedStartMap` unpacking submobjects when using the default `arg_creator` by {user}`SAY-5` in {pr}`4965`+* Replace deprecated `np.sum` calls on generators, fixing a `TypeError` with the OpenGL renderer by {user}`christopher-hampson` in {pr}`4962`+* Preserve the layout of `MathTypst` capture groups by {user}`behackl` in {pr}`4960`+* Fix `normalize` raising an error instead of returning the fallback vector for zero-norm vectors by {user}`nikolajmunk` in {pr}`5001`+* Fix `is_closed` misclassifying closed curves in negative coordinate space by {user}`Osamaali313` in {pr}`5010`+* Fix `angle_axis_from_quaternion` returning the inverse rotation for angles greater than π by {user}`dylanpulver` in {pr}`4980`+* Fix `LineJointType.AUTO` and `CapStyleType.AUTO` inheriting the previous mobject's style in the Cairo renderer by {user}`RizgarOzan` in {pr}`5016`+* Fix `BarChart` ignoring `include_numbers` in `y_axis_config` by {user}`RizgarOzan` in {pr}`5015`+* Fix graph label placement and coordinate conversion on logarithmic axes by {user}`GreedyC` in {pr}`5039`+* Fix SVG shapes with `stroke="none"` getting a white outline by {user}`RizgarOzan` in {pr}`5036`+* Fix `color` argument of `Text` and `MarkupText` not being applied to the mobject itself by {user}`webzuweb` in {pr}`5017`+* Fix the `redirections` parameter of the `deprecated_params` decorator by {user}`GniLudio` in {pr}`5028`+* Fix rendering WebM videos with sound when PyAV has no libvorbis encoder by {user}`Darkslayer3324j` in {pr}`5025`+* Fix `ThreeDScene.set_camera_orientation` with the OpenGL renderer by {user}`Smail` in {pr}`5040`+* Fix `Mobject.insert` and `OpenGLMobject.replace_submobject` permitting duplicate submobjects by {user}`nikolajmunk` in {pr}`4957`++### Performance ⚡+* Speed up `list_update` and `list_difference_update` by using a set for membership checks by {user}`nikolajmunk` in {pr}`4939`+* Speed up redundancy removal in `get_family` and fix families containing loops by {user}`GniLudio` in {pr}`4947`+* Improve speed and robustness of `Mobject` and `OpenGLMobject` add/remove operations by {user}`nikolajmunk` and {user}`GniLudio` in {pr}`4957`+* Bound the encoder frame queue when rendering without parallel encoding to limit memory usage by {user}`pizzaburgare` in {pr}`5049`++### Documentation 📚+* Fix flaky `ConvexHull` example in the rendered documentation by {user}`behackl` in {pr}`4967`+* Mention ruff as formatter and linter in the documentation by {user}`nikolajmunk` in {pr}`4978`+* Add guidance on installing the C++ Build Tools on Windows by {user}`SR0725` in {pr}`4982`+* Add missing module reference for Typst mobjects by {user}`behackl` in {pr}`5007`+* Add instructions for the optional Typst installation by {user}`aryansk` in {pr}`4986`+* Update the testing guide by {user}`cqxswbc2` in {pr}`4991`+* Improve the documentation of `TangentialArc` by {user}`henrikmidtiby` in {pr}`5046`++### Testing 🧪+* Add tests verifying that updaters affect their mobjects by {user}`nikolajmunk` in {pr}`5000`++### Type Hints 📝+* Use `ParamSpec` in deprecation decorators to preserve signatures of decorated callables by {user}`GniLudio` in {pr}`4988`+* Add type hints to `vector_field.py` by {user}`henrikmidtiby` in {pr}`5030`++### Dependencies 📦+* Update ManimPango dependency to version 0.7.0 by {user}`naveen521kk` in {pr}`5041`+* Update Tornado, Jupyter, and virtualenv dependencies by {user}`behackl` in {pr}`5047`++### Other Changes+* Prepare new release: `v0.22.0` by {user}`behackl` in {pr}`5050`++## New Contributors+* {user}`emerardd` made their first contribution in {pr}`4958`+* {user}`smmariquit` made their first contribution in {pr}`4927`+* {user}`SAY-5` made their first contribution in {pr}`4965`+* {user}`SR0725` made their first contribution in {pr}`4982`+* {user}`aryansk` made their first contribution in {pr}`4986`+* {user}`Osamaali313` made their first contribution in {pr}`5010`+* {user}`dylanpulver` made their first contribution in {pr}`4980`+* {user}`cqxswbc2` made their first contribution in {pr}`4991`+* {user}`RizgarOzan` made their first contribution in {pr}`5016`+* {user}`GreedyC` made their first contribution in {pr}`5039`+* {user}`webzuweb` made their first contribution in {pr}`5017`+* {user}`Darkslayer3324j` made their first contribution in {pr}`5025`+* {user}`Smail` made their first contribution in {pr}`5040`+* {user}`pizzaburgare` made their first contribution in {pr}`5049`++**Full Changelog**: [Compare view](https://github.com/ManimCommunity/manim/compare/v0.21.0...v0.22.0)diff --git a/pyproject.toml b/pyproject.tomlindex d7002faf4..c76ff9018 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -1,6 +1,6 @@[project]name = "manim"-version = "0.21.0"+version = "0.22.0"description = "Animation engine for explanatory math videos."authors = [{name = "The Manim Community Developers", email = "[email protected]"},diff --git a/scripts/release.py b/scripts/release.pyindex b611a99aa..f5060a0dd 100644--- a/scripts/release.py+++ b/scripts/release.py@@ -471,9 +471,19 @@ def convert_to_github(body: str) -> str:)body = re.sub(r"\{user\}`([a-zA-Z0-9_-]+)`", r"@\1", body)body = re.sub(r"\{class\}`\.?(.*?)`", r"`\1`", body)+ body = re.sub(r"\{doc\}`([^`]*?)`", _convert_doc_role, body)return body+def _convert_doc_role(match: re.Match[str]) -> str:+ """Convert a MyST ``{doc}`` role to a link into the stable documentation."""+ content = match.group(1)+ titled = re.fullmatch(r"(.*?)\s*<(.+)>", content)+ title, target = (titled.group(1), titled.group(2)) if titled else (None, content)+ path = target.strip().lstrip("/")+ return f"[{title or path}](https://docs.manim.community/en/stable/{path}.html)"++def format_github_release_notes(version: str, content: str) -> str:"""Create a GitHub release body from a documentation changelog."""content = re.sub(r"\A---\r?\n.*?\r?\n---\r?\n", "", content, flags=re.DOTALL)diff --git a/tests/test_release_script.py b/tests/test_release_script.pyindex 8b5e544a9..b3c93d160 100644--- a/tests/test_release_script.py+++ b/tests/test_release_script.py@@ -138,6 +138,8 @@ Date* Improve {class}`.Example` by {user}`alice` in {pr}`123`* Fix {issue}`456`+See the {doc}`configuration guide </guides/configuration>` and {doc}`/guides/deep_dive`.+**Full Changelog**: [Compare view](https://example.com/compare)"""@@ -153,4 +155,12 @@ Dateassert "`Example` by @alice" in resultassert "https://github.com/manimcommunity/manim/pull/123" in resultassert "https://github.com/manimcommunity/manim/issues/456" in result+ assert (+ "[configuration guide]"+ "(https://docs.manim.community/en/stable/guides/configuration.html)"+ ) in result+ assert (+ "[guides/deep_dive]"+ "(https://docs.manim.community/en/stable/guides/deep_dive.html)"+ ) in resultassert result.endswith("\n")diff --git a/uv.lock b/uv.lockindex a1e7d4222..c1f3848d8 100644--- a/uv.lock+++ b/uv.lock@@ -1410,7 +1410,7 @@ wheels = [[[package]]name = "manim"-version = "0.21.0"+version = "0.22.0"source = { editable = "." }dependencies = [{ name = "audioop-lts", marker = "python_full_version >= '3.13'" },