6369 Commits

Author SHA1 Message Date
Shavez
c5e23d9365 Fix shared reference issue in traced_points initialization (#2426) 2026-03-26 09:56:44 -05:00
Shavez
e14177036c This change introduces program-type aware shader code replacement (#2424)
in VShaderWrapper, allowing independent GLSL modifications for:

- stroke programs
- fill programs
- depth programs

Previously, `set_color_by_code()` relied on a single global
replacement mechanism. As a result:

- Multiple calls to `set_color_by_code()` would override each other.
- Applying different GLSL logic to stroke and fill was not possible.
- The last shader replacement always won.

This update solves that limitation by:

1. Storing shader code replacements per program type.
2. Applying replacements only to shaders matching the given program_type.
3. Preserving previously applied replacements for other program types.
4. Maintaining backward compatibility when program_type is None.

Now users can safely do:

    set_color_by_code(..., program_type="stroke")
    set_color_by_code(..., program_type="fill")

without one affecting the other.

This makes stroke and fill shader logic fully independent,
opening the door for:

- Different gradients for stroke and fill
- Custom sheen effects per layer
- Advanced shader experimentation
- Cleaner shader architecture

Backward compatibility:
If no program_type is provided, behavior falls back to the
original global replacement logic.

This improves flexibility without breaking existing scenes.
2026-03-26 09:37:11 -05:00
Aaron Gostein
0d3b06d44d Dedenting copied code for checkpoint_paste (#2432)
For some reason, it seems like this may only cause an issue for certain users (potentially Windows users in particular).
2026-03-26 09:33:15 -05:00
Grant Sanderson
2e31f79a23 Multiple clip planes (#2437)
* Use preferred_creation_axis in TexturedSurface

* Add ComplexPlane.get_unit_size

* Enable up to 4 clip planes

* Add Mobject.clip_to_box

* Use tex "i" for complex numbers
2026-03-14 09:15:57 -05:00
Grant Sanderson
2636e8dfef Allow path_along_arc to take in multiple arc_angle values 2026-03-11 14:33:42 -05:00
Grant Sanderson
2c7209b13e Add set_image_coords_by_uv_func to TextureSurface 2026-03-09 11:43:15 -05:00
Grant Sanderson
e7787d7910 Replace TEXT_MOB_SCALE_FACTOR with a dynamically calculated value (#2423)
- Set font_size_for_unit_height: 144 in config
- Calculate the relevant scaling factors for Text and Text using a rendered "0" as a reference, ensuring that a font size of 144 (or whatever is set) would give it a height of 1 in manim coordinates.
2026-02-12 20:31:35 -06:00
Andrey Zhuchkov
268f1eb42d Add a lightweight alternative to MacTeX in the README (#2375) 2026-02-10 12:51:26 -06:00
Andrey Zhuchkov
5f84e20c2a Minor Fixes for Example Scenes (#2374)
* Fixed Dot color parameter in example scenes

* Automatically create downloads directory if necessary
2026-02-10 12:50:50 -06:00
Abdallah Soliman
e47871f32c Minor edits (#2380)
* Added a shortcut for remove_all_except() in scene_embed

* Added **kwargs argument to get_axis_label() and get_axis_labels() such that properties of the label like font size and t2c can be configured.

* Comments for set_color_by_rgba_func and set_color_by_rgb_func were ambiguous; clarified the comments.

* Changed the comment to remove the old description. The old description was valid up until pull request #2316.
2026-02-10 12:50:26 -06:00
Shavez
bb495112d1 feat(InteractiveScene): add z-axis object grabbing support (#2379) 2026-02-10 12:49:20 -06:00
Shavez
8f5feafb54 Fix StrokeArrow: preserve tip geometry for large angles (#2392) 2026-02-10 12:48:14 -06:00
Awais Khan
5d397a7d00 Fix: remove pkg_resources usage (deprecated), use importlib.metadata (#2389) 2026-02-10 12:47:48 -06:00
Shavez
bf4ae585aa fix(Latex): add latex_cache directory to resolve LaTeX compilation errors. Fixes #2390 (#2391) 2026-02-10 12:46:25 -06:00
Shavez
52827fffd4 Geometry improvements (#2394)
* refactor(Line): move reset_points_around_ends from Arrow to Line

* fix(Line): make set_path_arc work for both Arrow and StrokeArrow

* refactor(Line): move set_perpendicular_to_camera from Arrow to Line

* typing: add missing Tuple import in Line.get_start_and_end
2026-02-10 12:43:30 -06:00
Shavez
14f5f8eaa3 Fix x_range slicing in get_area_under_graph to prevent TypeError (#2395) 2026-02-10 12:41:20 -06:00
Shavez
40529b98d9 fix(interactive_scene): handle OverflowError in on_key_press for large key symbols (#2396) 2026-02-10 12:40:54 -06:00
Shavez
018b7ce947 fix(SceneState): clear updaters on restore_scene (#2397)
* fix(SceneState): clear updaters on restore_scene

Previously, restoring a scene checkpoint did not reset updaters.
This caused discrepancies when switching between checkpoints if
a mobject had updaters attached.

Now, restore_scene clears all updaters before restoring the mobject,
ensuring scene state consistency across checkpoints.

* Refactor restore_scene to use list comprehension

---------

Co-authored-by: Grant Sanderson <grant@3blue1brown.com>
2026-02-10 12:40:02 -06:00
Leon
52c80f9093 Fix: Update installation guide to use Python 3.9 (Python 3.8 incompatible with ipython>=8.18.0) (#2406)
The installation instructions suggested python=3.8, but manimgl depends on ipython>=8.18.0, which requires Python ≥3.9.
This PR updates the environment creation command to use Python 3.9 to avoid installation errors.
2026-02-10 12:32:05 -06:00
mjmjmtl
553231b1e1 Improve SVG path parsing by re-using ref_path (#2407) 2026-02-10 12:31:43 -06:00
mjmjmtl
048e1f34b1 Fix Mobject.get_area_vector() using subpath area sum (#2408) 2026-02-10 12:27:13 -06:00
Pádraic Slattery
b72343a7fb chore: Update outdated GitHub Actions versions (#2418) 2026-02-10 12:25:45 -06:00
Pablo Coloma
7a462d8cc5 Fix degenerate bezier handles (#2420) 2026-02-10 12:25:22 -06:00
Grant Sanderson
77feda7a3d Updates made for the Hairy Ball Theorem video (#2422)
* Bug fix for TransformMatchingStrings with incompatible lengths

* Change faded line in NumberPlane initialization to be more explicit, and lower opacity

* Add option hide_zero_components_on_complex to DecimalNumber

* Validate syntax before reloading

* Add remembered stroke_config to TracedPath

* Add CLAUDE.md to gitignore

* Move pre-calculated traced points to TracingTail

* Fix interplay between time_span and alpha in Animation

* Clearer init for points in TracingTail

* Fix CoordinateSystem.get_area_under_graph

* Allow ComplexPlane.n2p to take in array of complex numbers

* Add put_start_on and put_end_on

* Add Slider

* Add \minus option for Tex to give shorter negative sign

* Put interp_by_hsl option in various color interpretation functions

* Swap priority of matched_keys vs key_map is TransformMatchingStrings

* Have z-index apply recursively

* Set self.svg_string property for SVGMobject

* Fix num_decimal_places config in Tex.make_number_changeable

* Add Surface. color_by_uv_function

* Add VMobject. set_color_by_proportion

* Add \mathcal to tex_to_symbol_count

* Allow option for BulletedList to be numbered

* ShowPartial should not be restricted to VMobject

* Add basic functionality for imported 3d geometries with texture

* Add interp_by_hsl option to Mobject.set_submobject_colors_by_gradient

* Update Clock class

* Add \circ to tex_to_symbol_count
2026-02-10 12:22:21 -06:00
Grant Sanderson
e5298385ed Video work (#2402)
* Bug fix for TransformMatchingStrings with incompatible lengths

* Change faded line in NumberPlane initialization to be more explicit, and lower opacity

* Add option hide_zero_components_on_complex to DecimalNumber

* Validate syntax before reloading

* Add remembered stroke_config to TracedPath

* Add CLAUDE.md to gitignore

* Move pre-calculated traced points to TracingTail

* Fix interplay between time_span and alpha in Animation

* Clearer init for points in TracingTail

* Fix CoordinateSystem.get_area_under_graph

* Allow ComplexPlane.n2p to take in array of complex numbers

* Add put_start_on and put_end_on

* Add Slider

* Add \minus option for Tex to give shorter negative sign

* Put interp_by_hsl option in various color interpretation functions

* Swap priority of matched_keys vs key_map is TransformMatchingStrings

* Have z-index apply recursively

* Set self.svg_string property for SVGMobject

* Fix num_decimal_places config in Tex.make_number_changeable

* Add Surface. color_by_uv_function

* Add VMobject. set_color_by_proportion

* Add \mathcal to tex_to_symbol_count
2025-10-14 07:15:39 -07:00
Grant Sanderson
41613db7ec Remove stray prints 2025-06-14 10:47:52 -05:00
Grant Sanderson
c48c4b6a9f Merge branch 'master' of github.com:3b1b/manim 2025-06-10 10:59:56 -05:00
Grant Sanderson
cc5fbe17b9 Fix bug with mirroring file prefixes 2025-06-10 10:59:47 -05:00
Eivar Morales
98faf7ed55 added information for M1 Users (#2044)
* added information for M1 Users

* Update README.md

Co-authored-by: Paweł Cisło <pyxelr@gmail.com>

---------

Co-authored-by: Paweł Cisło <pyxelr@gmail.com>
2025-06-10 08:42:40 -07:00
Grant Sanderson
d330e1db7f Added documentation from @AkashKarnatak to geometry.py
Based on https://github.com/3b1b/manim/pull/1024
2025-06-10 10:41:09 -05:00
ScarWann
e81dfab0e6 Fixed minor typos in example_scenes.py (#2351) 2025-06-10 08:16:31 -07:00
Abdallah Soliman
fd2a6a69e5 Created a method `remove_all_except()` in scene.py and interactive_scene.py, and made default colors easily configurable. (#2346)
* created a method remove_all_except() in scene.py and interactive_scene.py

* Made it such that default mobject colors can be set through the yaml config file.

* * Default color initialisation wasn't working.
Changed conditional expression to `or` instead.

* Added default values to yaml file.

* added set_background_color() function to Scene class

* Changed default font back to Consolas
2025-06-10 08:15:55 -07:00
Irvanal Haq
6fb1845f4a Enhance Autocompletion for mobject.animate. to Display Mobject Methods (#2342)
* Improve autocompletion for mobject.animate to show Mobject methods

- Added type hint `-> _AnimationBuilder | Self` to `Mobject.animate`, enabling autocompletion for `Mobject` methods after `mobject.animate`.

- Prioritized `typing_extensions.Self` over `typing.Self` in imports, so autocompletion of `Mobject` methods also works in Python < 3.11.

* Support `mobject.animate.` autocompletion in IPython

* Add docstring to `__dir__` and add return type hint

* improve docsting `__dir__` _AnimationBuilder
2025-06-10 08:13:29 -07:00
feng lui
7787730743 Fix No matching distribution found for audioop-lts (python < 3.13) (#2283) (#2341) 2025-06-10 08:12:31 -07:00
Irvanal Haq
a5a73cb2da Fix typos in GLSL comments and add constants PURE_RED, PURE_GREEN, PURE_BLUE (#2340)
* Fix typos in GLSL comments

* Fix typos in GLSL comments

* add constants PURE_RED, PURE_GREEN, PURE_BLUE
2025-06-10 08:12:11 -07:00
Refael Ackermann
bd8d2fbc99 Update URL to pango in README.md (#2334)
https://pango.gnome.org gets `ERR_NAME_NOT_RESOLVED`
2025-06-10 08:11:36 -07:00
Irvanal Haq
53bc83d94a Refactor: move type validation to top of Animation.__init__ and extract into method (#2332) 2025-06-10 08:11:16 -07:00
Varniex
8b9ae95703 Resolving minor bug in StreamLines (#2330)
* resolving minor bug in StreamLines

* minute changes
2025-06-10 08:05:07 -07:00
Irvanal Haq
c667136060 Fix error when using VFadeIn (and its subclasses) (#2328)
* Fix error when using VFadeIn and its subclasses

* add np.floating in type checking of Mobject.set_rgba_array_by_color and VMobject.set_stroke and removing the change in VFadeIn
2025-06-10 08:04:13 -07:00
Calvin Witt
66e8b04507 update readme instructions to add manimgl to path first (#2327)
* update readme instructions to add manimgl to path first

* change
2025-06-10 08:02:58 -07:00
Grant Sanderson
c7ef8404b7 Video work (#2356)
* Only use -no-pdf for xelatex rendering

* Instead of tracking du and dv points on surface, track points off the surface in the normal direction

This means that surface shading will not necessarily work well for arbitrary transformations of the surface. But the existing solution was flimsy anyway, and caused annoying issues with singularity points.

* Have density of anchor points on arcs depend on arc length

* Allow for specifying true normals and orientation of Sphere

* Change miter threshold on stroke shader

* Add get_start_and_end to DashedLine

* Add min_total_width option to DecimalNumber

* Have BackgroundRectangle.set_style absorb (and ignore) added configuration

Note, this feels suboptimal

* Add LineBrace

* Update font_size adjustment in Tex

* Add scale_factor parameter to BulletedList.fade_all_but

* Minor import tweaks

* Add play_sound

* Small if -> elif update

* Always use Group for FadeTransform

* Use time_spanned_alpha in ChangingDecimal

* Change priority of number_config vs. self.decimal_number_config in NumberLine init

* Fix clock animation

* Allow sample_coords to be passed into VectorField
2025-06-10 08:02:32 -07:00
Grant Sanderson
f4737828f6 Video work (#2326)
* Only use -no-pdf for xelatex rendering

* Instead of tracking du and dv points on surface, track points off the surface in the normal direction

This means that surface shading will not necessarily work well for arbitrary transformations of the surface. But the existing solution was flimsy anyway, and caused annoying issues with singularity points.

* Have density of anchor points on arcs depend on arc length

* Allow for specifying true normals and orientation of Sphere

* Change miter threshold on stroke shader

* Add get_start_and_end to DashedLine

* Add min_total_width option to DecimalNumber

* Have BackgroundRectangle.set_style absorb (and ignore) added configuration

Note, this feels suboptimal

* Add LineBrace

* Update font_size adjustment in Tex

* Add scale_factor parameter to BulletedList.fade_all_but

* Minor import tweaks

* Add play_sound
2025-03-20 12:00:35 -07:00
jkjkil4
be7d93cf40 Fix path arc handling for SVGMobject when a matrix transform is present in the SVG (#2322) 2025-03-20 11:59:06 -07:00
Varniex
dbfe7ac75d Performance improved in set_color_by_rgba_func (#2316)
* removing 1 in neg axis if unit_tex is specified

* performance improved in `set_color_by_rgba_func`

* resolving imag axis number mob in ComplexPlane
2025-03-20 11:56:29 -07:00
AStarySky
7a61a13691 Fix issues in number_line.py (#2310)
Fix the issue that changes in decimal_number_config["font_size"] get rewritten by number_config
2025-03-20 11:54:59 -07:00
Йордан Миладинов
3e307926fd Add missing dependencies to setup.cfg and requirements.txt (#2304) 2025-03-20 11:52:48 -07:00
Shinapri De Lucania
2ddec95ce5 Fix --fps type conversion to int (#2299) 2025-03-20 11:52:17 -07:00
Grant Sanderson
db421e3981 Video work (#2318)
* Only use -no-pdf for xelatex rendering

* Instead of tracking du and dv points on surface, track points off the surface in the normal direction

This means that surface shading will not necessarily work well for arbitrary transformations of the surface. But the existing solution was flimsy anyway, and caused annoying issues with singularity points.

* Have density of anchor points on arcs depend on arc length

* Allow for specifying true normals and orientation of Sphere

* Change miter threshold on stroke shader

* Add get_start_and_end to DashedLine

* Add min_total_width option to DecimalNumber

* Have BackgroundRectangle.set_style absorb (and ignore) added configuration

Note, this feels suboptimal

* Add LineBrace

* Update font_size adjustment in Tex
2025-02-26 07:52:59 -08:00
Grant Sanderson
7a7bf83f11 Only use -no-pdf for xelatex rendering (#2298) 2025-01-08 08:22:03 -08:00
Varniex
24eefef5bf Automatically identify the class name based on the specified line number. (#2280)
* identify the scene name based on the line number

* resolving a minor bug in string_mobject

* removing bug of string validation

* Update manimlib/default_config.yml

Co-authored-by: Splines <37160523+Splines@users.noreply.github.com>

* Update manimlib/extract_scene.py

Co-authored-by: Splines <37160523+Splines@users.noreply.github.com>

* update search scene names

---------

Co-authored-by: Splines <37160523+Splines@users.noreply.github.com>
2024-12-28 07:18:32 -08:00