417 Commits

Author SHA1 Message Date
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
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
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
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
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
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
9475fcd19e Have clip plane recurse through family 2024-11-08 14:27:20 -06:00
09e9e65ba4 Merge branch 'master' of github.com:3b1b/manim into video-work 2024-10-01 13:29:42 -05:00
95bb67c47f Change return type for Mobject.get_shader_data 2024-10-01 13:18:40 -05:00
95fca885c9 Push clip plane functionality up to all Mobjects 2024-09-17 17:20:19 -05:00
1f55832a6a Clean up around z_index 2024-09-06 12:20:26 -05:00
aebf2220a6 Merge pull request #2057 from germanzhu/add-zorder-mobject
add zorder to mobject
2024-09-06 10:11:40 -07:00
c8326d1cce zorder -> z_index 2024-09-06 10:11:26 -07:00
133cec9725 zorder -> z_index 2024-09-06 10:11:21 -07:00
a713868f3d Add Mobject.get_opacities 2024-09-06 09:12:23 -05:00
c8d5e91422 Rename shader_dtype -> data_dtype 2024-08-22 14:52:35 -05:00
35ce4c6704 Use Mobject.set_uniform in Mobject.set_shading 2024-08-20 14:44:48 -05:00
7ddbd13e38 Ensure mobject uniforms get passed to ShaderWrapper on init 2024-08-20 14:44:09 -05:00
304856e6e0 Remove indices_list argument on ShaderWrapper.read_in 2024-08-20 14:21:37 -05:00
0a585b123c Use stash_mobject_pointers on Mobject.deepcopy 2024-08-20 12:15:37 -05:00
b8931e7b9c When shader_id is updated, have ancestors mark data as changed 2024-08-20 11:36:37 -05:00
e0191d81d9 Instead of tracking _shaders_initialized, just check if self.shader_wrapper is None 2024-08-20 10:48:43 -05:00
0ac9ee1fbf Don't deepcopy ShaderWrapper 2024-08-20 10:15:53 -05:00
e61957a4e0 Fix wrong check for path_func in last commit 2024-08-20 09:25:30 -05:00
a8ef9629eb More direct lerp in Mobject.interpolate 2024-08-20 09:10:33 -05:00
f12b143d16 Unify get_shader_wrapper_list, and and better subdivide render groups by ShaderWrapper ids 2024-08-20 08:53:51 -05:00
4174f314b4 Reorganize, and ensure get_shader_wrapper_list works for general Groups 2024-08-19 09:17:58 -05:00
24b160f9f9 Update VMobject shader wrapper
Use a combined VBO
Render with TRIANGLE_STRIP, and ignore every other
2024-08-19 08:05:32 -05:00
f9b9cf69fd Update so that vbo is not recreated on each from, but is read into 2024-08-17 07:11:56 -05:00
902a4f264e Add white space after assert statements 2024-08-16 12:15:55 -05:00
174f318602 Push _data_default initialization into init_data 2024-08-16 12:10:07 -05:00
d3ba101ee5 Change from tracking time_based_updater and non_time_updater lists separately to just tracking one list 2024-03-07 16:39:45 -03:00
83cd5d6246 Clean up updater matters, prune unused functions 2024-03-07 16:07:39 -03:00
70b839e188 Change to only compute has_updater status as needed 2024-03-07 15:34:26 -03:00
fd35433a62 Change name note_updated_family -> note_changed_family 2024-03-07 15:32:15 -03:00
4b14c11e4b Only reconstruct family as needed 2024-03-07 13:49:07 -03:00
e124aecd6b Clarify Mobject.needs_new_bounding_box is private 2024-03-07 13:27:29 -03:00
3c778ba678 Add comment to Mobject.animate 2024-03-07 13:27:09 -03:00
a6b46c641b Add Mobject.always and Mobject.f_always
For nicer syntax in creating updaters
2024-03-07 10:17:01 -03:00
1372cf101c Allow VGroup and Group to accept generators and iterables as arguments 2024-03-07 09:23:02 -03:00
5632fee9a3 Ensure get_opacity returns float 2024-02-21 12:25:26 -08:00
2966f358a3 Pull type definitions used for Generic[SubmobjectType] outside of if TYPE_CHECKING block 2024-02-08 14:43:37 -06:00
100b108ad1 Treat Group and VGroup more like list types
This may not be the best way to address it, but at least temporarily it prevents linting issues for calls like VGroup(Circle())[0].get_radius()
2024-02-05 15:02:13 -06:00
ebe689dede Treat is_fixed_in_frame as a float in uniforms, to allow for transformations between 2024-02-03 18:48:54 -06:00
711438f625 Update the types in decorator methods using @wraps
This is method to address issues flagged by pyright
2024-02-03 18:00:47 -06:00
8179ba88d0 Reformat defaults for n_rows and n_cols in Mobject.arrange_in_grid 2024-01-18 11:13:12 -06:00
87e4a71ca3 Add surround method for Rectangles and SurroundingRectangles 2023-09-04 18:46:11 -04:00
0b5e9d4a8b add zorder to mobject 2023-08-27 15:35:22 +08:00
4be7f611ec Fix issues with stroke opacities passed as numpy arrays 2023-08-15 20:38:55 -07:00
f01b990c2e Add default Mobject.match_style 2023-06-10 09:21:45 -07:00