1763 Commits

Author SHA1 Message Date
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
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
8b9ae95703 Resolving minor bug in StreamLines (#2330)
* resolving minor bug in StreamLines

* minute changes
2025-06-10 08:05:07 -07:00
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
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
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
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
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
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
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
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
96d44bd560 Video work (#2284)
* Comment tweak

* Directly print traceback

Since the shell.showtraceback is giving some issues

* Make InteracrtiveSceneEmbed into a class

This way it can keep track of it's internal shell; use of get_ipython has a finicky relationship with reloading.

* Move remaining checkpoint_paste logic into scene_embed.py

This involved making a few context managers for Scene: temp_record, temp_skip, temp_progress_bar, which seem useful in and of themselves.

* Change null key to be the empty string

* Ensure temporary svg paths for Text are deleted

* Remove unused dict_ops.py functions

* Remove break_into_partial_movies from file_writer configuration

* Rewrite guarantee_existence using Path

* Clean up SceneFileWriter

It had a number of vestigial functions no longer used, and some setup that could be made more organized.

* Remove --save_pngs CLI arg (which did nothing)

* Add --subdivide CLI arg

* Remove add_extension_if_not_present

* Remove get_sorted_integer_files

* Have find_file return Path

* Minor clean up

* Clean up num_tex_symbols

* Fix find_file

* Minor cleanup for extract_scene.py

* Add preview_frame_while_skipping option to scene config

* Use shell.showtraceback function

* Move keybindings to config, instead of in-place constants

* Replace DEGREES -> DEG

* Add arg to clear the cache

* Separate out full_tex_to_svg from tex_to_svg

And only cache to disk the results of full_tex_to_svg.  Otherwise, making edits to the tex_templates would not show up without clearing the cache.

* Bug fix in handling BlankScene

* Make checkpoint_states an instance variable of CheckpointManager

As per https://github.com/3b1b/manim/issues/2272

* Move resizing out of Window.focus, and into Window.init_for_scene

* Make default output directory "." instead of ""

To address https://github.com/3b1b/manim/issues/2261

* Remove input_file_path arg from SceneFileWriter

* Use Dict syntax in place of dict for config more consistently across config.py

* Simplify get_output_directory

* Swap order of preamble and additional preamble

* Minor stylistic tweak

* Have UnitInterval pass on kwargs to NumberLine

* Add simple get_dist function

* Have TracedPath always update to the stroke configuration passed in

* Have Mobject.match_points apply to all parts of data in pointlike_data_key

* Always call Mobject.update upon adding an updater

* Add Surface.uv_to_point

* Make sure Surface.set_opacity takes in a recurse option

* Update num_tex_symbols to account for \{ and \}
2024-12-26 09:35:34 -08:00
744e695340 Misc. clean up (#2269)
* Comment tweak

* Directly print traceback

Since the shell.showtraceback is giving some issues

* Make InteracrtiveSceneEmbed into a class

This way it can keep track of it's internal shell; use of get_ipython has a finicky relationship with reloading.

* Move remaining checkpoint_paste logic into scene_embed.py

This involved making a few context managers for Scene: temp_record, temp_skip, temp_progress_bar, which seem useful in and of themselves.

* Change null key to be the empty string

* Ensure temporary svg paths for Text are deleted

* Remove unused dict_ops.py functions

* Remove break_into_partial_movies from file_writer configuration

* Rewrite guarantee_existence using Path

* Clean up SceneFileWriter

It had a number of vestigial functions no longer used, and some setup that could be made more organized.

* Remove --save_pngs CLI arg (which did nothing)

* Add --subdivide CLI arg

* Remove add_extension_if_not_present

* Remove get_sorted_integer_files

* Have find_file return Path

* Minor clean up

* Clean up num_tex_symbols

* Fix find_file

* Minor cleanup for extract_scene.py

* Add preview_frame_while_skipping option to scene config

* Use shell.showtraceback function

* Move keybindings to config, instead of in-place constants

* Replace DEGREES -> DEG
2024-12-12 08:39:54 -08:00
0b350e248b Change global_attrs back to global_config in Text 2024-12-11 10:18:05 -06:00
fce92347fa Replace get_global_config() with manim_config, and make it an addict Dict 2024-12-11 09:50:17 -06:00
4a6a125739 Change "style" in default config to "text" 2024-12-11 08:30:31 -06:00
7d3758c44c Move joint_type_map out of constants to VMobject 2024-12-10 19:33:06 -06:00
d5c36de3c5 DEFAULT_MOBJECT_TO_MOBJECT_BUFFER -> DEFAULT_MOBJECT_TO_MOBJECT_BUFF
And likewise DEFAULT_MOBJECT_TO_MOBJECT_BUFFER -> DEFAULT_MOBJECT_TO_MOBJECT_BUFF
2024-12-10 19:23:15 -06:00
c51a84a6ee Fixing a Cairo Bug (Windows OS) 2024-12-11 00:10:06 +05:30
7a69807ce6 Remove mobject.save_to_file
This simply didn't work, and had no resilience to changes to the library. For cases where this might be useful, it's likely much better deliberately save specific data which is time-consuming to generate on the fly.
2024-12-09 16:24:50 -06:00
0e83c9c0d9 Merge branch 'master' into video-work 2024-12-05 16:50:13 -06:00
5a70d67b98 Update coordinate_systems.py (#2258) 2024-12-05 14:49:16 -08:00
5d3f730824 Cleaning up some imports + Minor Bug fixed in VectorField (#2253)
* cleaning up imports

* sample_points -> sample_coords
2024-12-05 14:42:46 -08:00
c96734ace0 Remove get_downloads_dir reference from register_font 2024-12-05 15:14:37 -06:00
71e440be93 Get rid of (no longer used) mobject_data directory reference 2024-12-05 15:08:25 -06:00
4251ff436a No longer any need for custom hash_seeds in Tex and Text 2024-12-05 15:05:26 -06:00
85f8456228 If it's worth caching to disk, then might as well do so in memory too during development 2024-12-05 14:56:35 -06:00
e0031c63bc Minor clean up 2024-12-05 14:55:28 -06:00
3b9ef57b22 Remove utils/customization.py 2024-12-05 11:59:01 -06:00
43821ab2ba Make caching on disk a decorator, and update implementations for Tex and Text mobjects 2024-12-05 10:09:15 -06:00
0c385e820f Get rid of get_tex_dir and get_text_dir 2024-12-04 20:33:43 -06:00
ac01b144e8 Clean up tex_file_writing 2024-12-04 20:30:53 -06:00
129e512b0c Add caching functionality, and have Tex and Text both use it for saved svg strings 2024-12-04 19:51:01 -06:00
88370d4d5d Have StringMobject work with svg strings rather than necessarily writing to file
Change SVGMobject to allow taking in a string of svg code as an input
2024-12-04 19:11:21 -06:00
85638d88dc Update parameter range for sphere 2024-11-25 12:39:41 -07:00
54c8a9014b Add scale_stroke_with_zoom option to VMobject 2024-11-25 11:27:11 -07:00
e19ceaaff0 Have TexMobject keep track of font_size 2024-11-25 11:02:54 -07:00
5b88d2347c Allow for LaTeX in DecimalNumber, e.g. for units 2024-11-25 11:01:38 -07:00
c6b9826f84 Update TimeVaryingVectorField to match new VectorField configuration 2024-11-25 10:50:12 -07:00
90ab2f64bb Clean up style arguments on VectorField 2024-11-25 10:49:29 -07:00
1d0deb8a33 Remove OldVectorfield 2024-11-25 10:14:23 -07:00
753a042dbe Remove unused method 2024-11-25 10:13:44 -07:00
55b12c902c Use density as a parameter instead of step_multiple 2024-11-25 10:13:37 -07:00
0ad5a0e76e Further development on VectorField 2024-11-15 09:07:46 -08:00
64ae1364ca Update the Vector Field interface 2024-11-12 11:21:19 -08:00
b84376d6fd Add Cone 2024-11-08 14:28:17 -06:00
9475fcd19e Have clip plane recurse through family 2024-11-08 14:27:20 -06:00
99493fc4f7 Fix issue with Difference
https://github.com/3b1b/manim/issues/2174
2024-10-10 15:13:33 -05:00
09e9e65ba4 Merge branch 'master' of github.com:3b1b/manim into video-work 2024-10-01 13:29:42 -05:00
641c03a95b Change condition for updating VMobject. outer_vert_indices 2024-10-01 13:27:02 -05:00