Commit graph

455 commits

Author SHA1 Message Date
NavpreetDevpuri
cf656e9c21
Code() in file Code_mobject.py to display code with color highlighted added Paragraph() and "exact_spaces" parameter to Text() (#1036) 2020-05-13 22:19:09 -07:00
NavpreetDevpuri
7f1a15b6ba
Fixed ffmpeg 'Impossible to Open' and 'Protocol not found' (#1057) 2020-05-13 22:13:56 -07:00
XiaoYoung
522a5b3c5f
Fix space characters problem of Text (#1035)
* Fix Text wrong display

* Fix space characters problem of Text

* Fix a potential bug using height or width in Text

* Update Text

* Fix typo in text_mobject.py
2020-05-07 01:16:39 -07:00
鹤翔万里
3362f93964
Fix three bugs(shaders/stroke/size) of Text Class (text_mobject.py) (#1030)
* fix: remove the last M tag in svg files to make Text run in shaders branch

* fix: close the svg path manually to fix the bug of wrong stroke

* fix: remove Space mobjects in Text to fix the bug of TransformText

* feat: make Text and TextMobject equal in size

* this will lead to more bugs of setting color, so I delete it
2020-05-05 00:12:22 -07:00
Mike Magruder
af65c9d5d4
Performance improvement for most scenes (#974)
tl;dr: this is a significant performance improvement for many scenes. 1.7x - 2.6x improvement in animation it/s.

This is a small change to some of the hotest paths in rendering objects. The biggest win comes from not using np.allclose() to check if two points are close enough. In general, NumPy is awesome at operating on large arrays, but overkill for very tiny questions like this. Created a small function to determine if two points are close using the same algorithm, and limited it to 2D points since that's all we need in set_cairo_context_path().

A couple of other minor tweaks to reduce or eliminate other uses of NumPy in this path.

In general, it is better to avoid wrapping lists in np.array when a real NumPy array isn't actually needed.

Added a new file for performance test scenes, with a single scene from the end of a video I've been working on.

Data:

MacBook Pro (16-inch, 2019)
macOS Catalina 10.15.4
2.4 GHz 8-Core Intel Core i9
64 GB 2667 MHz DDR4
Python 3.7.3 (default, Mar  6 2020, 22:34:30)

Profiler: yappi under Pycharm.

Using the scene Perf1 from the included perf_scenes.py, averaged over 5 runs and rendered with:
manim.py perf_scenes.py Perf1 -pl --leave_progress_bars

Before:
Animation 0: FadeInTextMobject, etc.:               8.93it/s
Animation 1: ShowCreationParametricFunction, etc.: 84.66it/s

Profiler shows 48.5% of the run spent under Camera.set_cairo_context_path()

After
Animation 0: FadeInTextMobject, etc.:               23.45it/s  -- 2.63x improvement
Animation 1: ShowCreationParametricFunction, etc.: 149.62it/s  -- 1.77x improvement

Profiler shows 19.9% of the run spent under Camera.set_cairo_context_path()

Less improvement with production-quality renders, and percent improvement varies with scene of course. This appears to be a good win for every scene I'm working on though. I hope it will be for others, too.

NB: there are more perf improvements to be had, of course, but this is the best one I currently have.
2020-04-24 21:04:08 -07:00
XiaoYoung
f0cdcd90ba
Fix Text wrong display (#889) 2020-04-23 20:36:57 -07:00
Devin Neal
19e3c97589
Revise config again (#987) 2020-04-17 02:51:25 -07:00
Devin Neal
c847988e10 Display help if no input file is specified 2020-04-17 02:36:56 -07:00
Devin Neal
87d8671995 Remove livestreaming option 2020-04-16 23:59:22 -07:00
azarzadavila
97a0a707d7 Typo in super() 77acc99 2020-02-09 11:31:54 +01:00
Grant Sanderson
77acc999cd Rename number_line_config to axis_config 2020-01-15 15:40:30 -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
Grant Sanderson
0f71b0a408 Playing wiht logo 2020-01-11 17:13:02 -08:00
Grant Sanderson
24d077fbce Change referenced directory of 3b1b content in LICENSE and README 2020-01-06 09:39:33 -08:00
Grant Sanderson
0e92deddc4 Change ShowSubmobjectsOneByOne defaults 2019-12-19 19:42:28 -08:00
Grant Sanderson
fa2c831ef3 Support UTF8 tex 2019-12-19 19:42:06 -08:00
Grant Sanderson
9deb2d3732 Change patron end screen 2019-12-17 09:38:18 -08:00
Grant Sanderson
a95318f1ab Fix print_family 2019-12-17 09:37:59 -08:00
Grant Sanderson
c74cfa3c5d Add error message for ApplyFunction 2019-12-15 08:44:57 -08:00
Grant Sanderson
c2838d78a2 Forgot to propagate kwargs in Underline 2019-12-12 14:40:08 -08:00
Grant Sanderson
fc28375e42 Changed modification for tex mobjects that begin with a newline, which involved eliminating alignment when a TexMobject creates many SingleStringTexMobject to figure out how to divvy itself up 2019-12-10 13:39:25 -08:00
Grant Sanderson
f89bb3e125 Added Underline 2019-12-10 13:38:30 -08:00
Grant Sanderson
3628b61d75 Change default color and bubble creation for teacher student scenes 2019-12-10 13:38:18 -08:00
Grant Sanderson
72006334f5 Added a small fix to the issue of Tex inputs starting with a new line 2019-12-06 17:10:51 -08:00
Grant Sanderson
94a3883880 Remove Mobject.print_family, as that is now in utils.debug 2019-12-06 17:10:26 -08:00
Grant Sanderson
84e7bdb2b1 Added a couple helpful debugging functions 2019-12-06 17:10:00 -08:00
Grant Sanderson
9811564f70 TODO stub 2019-12-05 12:31:23 -08:00
Grant Sanderson
975c4dd03c Explicitly check for None, rather than truthiness, for Axes.get_coordinate_labels 2019-11-12 11:55:19 -08:00
Grant Sanderson
b651050dd0 Merge branch 'master' of github.com:3b1b/manim into moduli 2019-11-11 14:06:32 -08:00
Grant Sanderson
13193d209e Changed patron name ordering 2019-11-11 14:06:04 -08:00
Devin Neal
bcb8824e2c
Merge pull request #698 from Elteoremadebeethoven/master_3b1b
Solve issue add sound in Windows 10
2019-11-06 16:21:58 -08:00
Devin Neal
1e3cf9fa78
Merge pull request #725 from Hammer7/master
Closes: #720
2019-11-06 16:21:23 -08:00
Grant Sanderson
4df666e964 Merge branch 'master' of github.com:3b1b/manim into hyperdarts 2019-10-28 15:35:00 -07:00
Grant Sanderson
c79474a57c Small changes to the ffmpeg args when writing video files 2019-10-28 14:40:46 -07:00
Devin Neal
ec9dd06d38
Merge pull request #748 from DzyubSpirit/fix-svg-width
Add default stroke width for the svg mobjects
2019-10-26 22:31:25 -07:00
Grant Sanderson
7674a9eaee Changed patreon end screen 2019-10-09 18:09:05 -07:00
DzyubSpirit
76c295a60b
Add default stroke width for the svg mobjects
Closes: #747
2019-10-08 10:32:04 +03:00
Grant Sanderson
f66d6e4f97 Added AddTextWordByWord, but it's not yet working, presumably because of some bug in Succession. 2019-10-03 13:58:00 -07:00
Grant Sanderson
c94aef8845 Have AnimationGroup initialize its runtime before begin is called. This way it can be composed 2019-09-30 12:06:17 -07:00
Grant Sanderson
8e15846ec5 Tiny clean to spacing 2019-09-26 11:04:35 -07:00
Grant Sanderson
557bbff36c Added PGroup 2019-09-24 14:40:21 -07:00
Grant Sanderson
42e0cd07ac Added support for changing and interpolating stroke_width on PMobjects 2019-09-19 13:38:46 -07:00
Grant Sanderson
307ac852a6 Added ShowSubmobjectsOneByOne 2019-09-19 13:38:03 -07:00
Hlaing Min
a19a6317ec Closes: #720
Fix to interpret subsequent points of absolute MoveTo (M) command as absolute LineTo (L).
2019-09-13 01:51:22 +08:00
Grant Sanderson
85e5b20ede Small tweak to patron scroll 2019-09-10 13:27:18 -07:00
Grant Sanderson
f54b2ac81a Don't add sound while skipping animations 2019-09-10 13:26:30 -07:00
Grant Sanderson
2f2ef09c92 Merge branch 'master' of github.com:3b1b/manim into windmill 2019-08-27 19:05:27 -07:00
Grant Sanderson
0ac7b420f2 End of windmill project 2019-08-27 19:02:04 -07:00
Alexander Vázquez
32abbb9371
Change way to remove sound_file_path 2019-08-20 01:34:13 -05:00
xy-23
9b3e60f5ce Update some Text Mobject changes 2019-08-16 15:53:36 +08:00