Commit graph

72 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
f9a44c9975 Make ffmpeg_bin specification a piece of file_writer_config 2024-12-10 19:29:55 -06:00
Grant Sanderson
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
Grant Sanderson
29cb6f76fe Write scene insertions into a subdirectory 2024-10-02 07:24:33 -05:00
Grant Sanderson
c8d5e91422 Rename shader_dtype -> data_dtype 2024-08-22 14:52:35 -05:00
Grant Sanderson
df0ae6fdc9 Fix missing ignore_skipping -> force_draw 2024-08-15 16:40:16 -05:00
Grant Sanderson
0609c1bfa8 Change default saturation and gamma to each be 1 2023-06-10 09:25:03 -07:00
Grant Sanderson
162fd4a92b Change defaults for where videos are saved
Save them directly to the relevant output directory, rather than to a "videos" subdirectory within it.
2023-06-10 09:24:50 -07:00
Grant Sanderson
557cb66c52 Fix transparent background videos 2023-02-15 09:38:35 -08:00
Grant Sanderson
3e3e4de5e9 Add option for gamma correction to SceneFileWriter 2023-02-08 20:09:33 -08:00
Grant Sanderson
ded06c1f88 Give SceneFileWriter an option for saturation, and set default to 1.7
The colors in a scene can look a little different in a preview window vs. in the rendered file written by ffmpeg. This is mean to bring them closer together.
2023-02-08 19:41:07 -08:00
Grant Sanderson
a54d1eddfc Set default pixel format to yuv420p 2023-02-03 12:48:56 -08:00
Grant Sanderson
e1bb360e0b Add CLI args for setting video codec and pixel forma 2023-02-03 12:46:01 -08:00
Grant Sanderson
12dc124d72 Revert to simple progress_description_len default 2023-02-03 11:46:03 -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
2beb55727f Change naming logic for recorded inserts 2023-01-25 17:30:12 -08:00
Grant Sanderson
8a6deb4068 Enable recording during a Scene embed 2023-01-23 17:10:18 -08:00
LucaCappelletti94
1708fbd672 Updated tqdm to support also notebooks 2023-01-12 12:03:14 +01:00
Grant Sanderson
afab37c2d2 Remove stray digest_config references 2022-12-16 11:00:59 -08:00
Grant Sanderson
69b0b0727e Kill CONFIG in scene_file_writer.py 2022-12-14 17:07:05 -08:00
Grant Sanderson
7de03e2541 Change/refactor progress display defaults in scene file writing 2022-11-18 09:12:40 -08:00
Grant Sanderson
6decb0c32a Rename frame_rate -> fps 2022-05-14 17:47:31 -07:00
Grant Sanderson
f741217c34 Make sure keyboard interrupted renders don't overwrite pre-existing video files 2022-05-11 12:48:08 -07:00
Grant Sanderson
c4d452248a Move mirror output path logic to config.py 2022-05-04 21:21:49 -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
5927f6a1cd Default to "" for scene_file_writer output dir 2022-04-22 08:14:29 -07:00
Grant Sanderson
78a7078772 Move saved mobject directory logic to scene_file_writer.py 2022-04-21 15:02:11 -07:00
Grant Sanderson
d24b8ff48f
Merge branch 'master' into master 2022-04-20 22:40:11 -07:00
Grant Sanderson
eae7dbbe6e Change default transparent background codec to be prores 2022-04-20 21:51:36 -07:00
Grant Sanderson
a3579eab41 Have SceneFileWriter handle a location for saved mobjects 2022-04-20 21:51:18 -07:00
YishiMichael
9ef9961d0e
Sort imports 2022-04-12 19:19:59 +08:00
TonyCrane
4fbe948b63
style: insert an empty line after import 2022-02-16 21:08:25 +08:00
TonyCrane
be5de32d70
chore: add type hints to manimlib.scene 2022-02-14 21:22:18 +08:00
Grant Sanderson
5aa8d15d85 Use FFMPEG_BIN instead of "ffmpeg" for sound incorporation 2021-12-21 10:58:58 -08:00
Grant Sanderson
f8e6e7df3c Update progress display for full scene render 2021-12-07 10:06:48 -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
Michael W
0e574882b3
Refactor #1637 (#1650)
* Refactor #1637

* Refactor #1637

* Refactor #1637

* Refactor #1637

* Refactor #1637

* Refactor #1637

* Update config.py

Co-authored-by: 鹤翔万里 <tonycrane@foxmail.com>
2021-10-16 13:04:52 +08:00
TonyCrane
7425057d9f use rich to log 2021-10-07 17:37:10 +08:00
slowy07
1e621e8278 fix: fix typo spelling grammar 2021-08-07 22:25:26 +07:00
Grant Sanderson
a58772db87 Fix writing to gifs 2021-01-23 16:08:39 -08:00
Grant Sanderson
0ac155d150 Making writing to partial movies optional, and set the default to be False. 2021-01-23 11:02:22 -08:00
Grant Sanderson
592432611b Remove all configuration from constants.py, and clean up the many files affected by this move 2021-01-02 20:47:51 -08:00
Grant Sanderson
81f6063736 Change string format style 2020-06-18 16:26:04 -07:00
Grant Sanderson
145c6a7e78 Remove already commented out alternate pix_fmt 2020-06-13 15:22:44 -07:00
Grant Sanderson
0b8cb3b6e1 Leaving a note for the better color-preserving encoding 2020-04-12 09:53:14 -07:00
Grant Sanderson
c591954fc3 Small formatting change 2020-02-13 10:41:55 -08:00
Grant Sanderson
2cf21fd0ad Add file opening operations to SceneFileWriter 2020-02-11 19:50:36 -08:00
Grant Sanderson
8488b9053d Removed live_streaming conditions, as those don't work anyway and will be replaced in functionality soon. Also have the ffmpeg pipe take in raw bytes directly, rather than going through the intermediary of a numpy array 2020-02-04 15:26:09 -08:00
Grant Sanderson
1279f040da Temporarily adding input_file_path to SceneFileWrite config. Not sure why this isn't there already, or if there are problems with setting a default, but it fixed a weird bug that had arisen 2020-01-11 17:14:02 -08:00