Commit graph

57 commits

Author SHA1 Message Date
Grant Sanderson
f427fc67df
A few bug fixes (#2277)
* 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
2024-12-12 18:45:34 -08:00
Grant Sanderson
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
Grant Sanderson
fce92347fa Replace get_global_config() with manim_config, and make it an addict Dict 2024-12-11 09:50:17 -06:00
Grant Sanderson
284c1d8f2c Move message for no scenes found to extract_scene 2024-12-10 14:43:10 -06:00
Grant Sanderson
f9fa8ac846 Make scene configuration part of the global configuration 2024-12-10 13:58:03 -06:00
Grant Sanderson
0692afdfec Bug fix 2024-12-09 11:59:16 -06:00
Grant Sanderson
14c6fdc1d9 Slight refactor of get_indent 2024-12-09 09:49:48 -06:00
Grant Sanderson
90dfb02cc6 Move get_scene_module logic to extract_scene.py 2024-12-06 12:24:16 -07:00
Grant Sanderson
361d9d0652 Minor clean up 2024-12-05 14:42:22 -06:00
Grant Sanderson
96a4a4b76f Factor out configuration to be passed into a scene vs. that used to run a scene 2024-12-05 14:36:21 -06:00
Grant Sanderson
34ad61d013 Clean up how configuration is handled
In principle, all we need here is that manim looks to the default_config.yaml file, and updates it based on any local configuration files, whether in the current working directory or as specified by a CLI argument.
2024-12-05 11:53:18 -06:00
Grant Sanderson
bc107787cc Clean up get_scenes_to_render 2023-02-03 11:45:47 -08:00
Grant Sanderson
b25f022859 Make it an option (default to false) to prerun a scene to calculate its number of frames 2023-02-03 11:06:07 -08:00
Grant Sanderson
cae13aa1f0 Add space 2023-01-08 10:15:22 -05:00
Grant Sanderson
0c1abebd95 Don't save last frame by default 2023-01-04 16:39:59 -08:00
Grant Sanderson
4e014d7a8f Have get_scene_config automatically find intersection of Scene parameters and config keys
Previously it required duplicating any new parameter
2022-12-29 14:36:50 -08:00
Grant Sanderson
e728196814 Remove implicit string concatenation 2022-12-18 10:50:34 -08:00
IcyChlorine
8882030136 thumbnails 2022-08-27 12:11:55 +08:00
IcyChlorine
8719107b18 fix the bug that progress bar can't be correctly showed while rendering if scene class name isn't passed in args explicitly. 2022-08-27 11:25:36 +08:00
Grant Sanderson
6decb0c32a Rename frame_rate -> fps 2022-05-14 17:47:31 -07:00
Grant Sanderson
308aadcec5 Make show_animation_progress effective 2022-05-02 11:09:09 -07:00
Grant Sanderson
2ba9243067 Merge branch 'master' of github.com:3b1b/manim into video-work 2022-04-23 09:03:53 -07:00
Grant Sanderson
2737d9a736 Have BlankScene inherit from InteractiveScene 2022-04-22 08:33:18 -07:00
YishiMichael
9ef9961d0e
Sort imports 2022-04-12 19:19:59 +08:00
Grant Sanderson
602809758e
Video work (#1739)
* Enable setting points to a null list, and adding one point at a time.

* Add refresh_locked_data

* Add presenter mode to scenes with -p option

* Allow for an embed by hitting e during interaction

* Add set_min_height, etc.

* Make sure null parametric curve has at least one point

* Account for edge case where \{ is used in Tex

* Allow for logging notes in wait calls, useful for presenter mode

* Simplify choose, and add gen_choose for fractional amounts

* Default to no top on axes

* Allow match_x, match_y, etc. to take in a point

* Allow wait calls to ignore presenter mode

* Just use math.combo, no caching with choose(n, r)

* Use generator instead of list in bezier

* Bubble init_colors should override

* Account for "px" values read in from an svg

* Stop displaying when writing is happening

* Update the way Bubble override SVG colors
2022-02-13 15:16:16 -08:00
Grant Sanderson
85e90a1488 Don't print info for pre-run scene 2021-12-07 10:07:15 -08:00
Grant Sanderson
9dd1f47dab Create single progress display for full scene render
When a scene is written to file, it will now do a preliminary run of a copy of the scene with skip_animations turned on to count the total frames, which has the added benefit of catching runtime errors early, and allowing an quicker preview of the last frame to be sure everything will render as expected.

The Progress display bars for individual animations are replaced with a more global progress display bar showing the full render time for the scene.

This has the downside that all the non-rendering computations in a scene are run twice, so any scene with slow computations unrelated to rendering will take longer. But those are rarer, so the benefits seem worth it.
2021-11-30 11:41:33 -08:00
TonyCrane
7425057d9f use rich to log 2021-10-07 17:37:10 +08:00
Tony031218
00fe33957c rename custom_defaults -> custom_config defaults -> default_config 2021-02-07 21:38:19 +08:00
Sahil Makhijani
c0f6e94545 Removed unused import that was added by IDE autocomplete!! 2021-02-05 13:11:26 +05:30
Sahil Makhijani
390bfac9df prompt_user_for_choice now prompts for Scene Name or Number 2021-02-05 13:09:03 +05:30
Pedro Maia
b1efee5088
Grammar correction
mulziple -> multiple, line 35.
2021-02-04 11:30:13 -03:00
Tony031218
78848b971c fix a wrong usage of logging.log 2021-01-15 20:21:17 +08:00
Grant Sanderson
6da1836f02 Take scene finding messages out of constants 2021-01-02 22:26:49 -08:00
Grant Sanderson
e01496e8bd Rearrange how passing in no module or scenes is handled 2021-01-02 22:20:13 -08:00
Grant Sanderson
93fe783b80 Make it so that simply typing 'python -m manim' will embed you in a blank scene to work with 2021-01-02 22:03:00 -08:00
Grant Sanderson
cf01a215db Stop treating extract_scene like a script 2021-01-02 19:03:01 -08:00
Tony031218
8b2785fdc9 fix bugs in extract_scene.py 2021-01-02 19:17:11 +08:00
Grant Sanderson
ebd4016fb3 Small refactor of extract_scene et. al. 2020-02-11 19:52:14 -08:00
xy-23
82a1b05f28 Add a feature #650 2019-07-26 14:34:21 +08:00
zavden
3cee3de94f
Update extract_scene.py 2019-07-24 18:01:12 -05:00
Grant Sanderson
4fa782b8b5 Remove extract_scene use of an All_SCENES list 2019-04-21 08:12:44 -07:00
Pokechu22
3393bf616b Fix --preview on cygwin 2019-04-03 21:10:20 -07:00
Grant Sanderson
0255627922 Allow scene extraction from a special file which contains an ALL_SCENE_CLASSES list and an OUTPUT_DIRECTORY. This is part of a move to make the output file organization independent from the sourcecode organization 2019-01-25 11:03:14 -08:00
Grant Sanderson
900e6ac837 Use frame_rate, instead of frame_duration, and make that part of the camera rather than the scene 2019-01-25 10:13:17 -08:00
Grant Sanderson
8ae0556394 First pass at SceneFileWriter refactor 2019-01-24 21:47:40 -08:00
Grant Sanderson
214ba5979b Added --leave_progress_bars option, with the deault being to remove them 2019-01-16 11:08:14 -08:00
Grant Sanderson
199a3b82c6 Make it possible to render multiple scenes 2019-01-12 12:31:29 -08:00
Grant Sanderson
d98d1ec610 Changed default behavior to have no finishing sound, and instead of passing in --no-sound to prevent the sound, one would pass in --sound to activate it 2019-01-07 13:24:16 -08:00
Grant Sanderson
b7cb66fe5d Tiny PEP fix 2019-01-04 12:46:52 -08:00