Skip to content

Commit 7d009af

Browse files
committed
Merge branch 'master' of https://github.com/manimcommunity/manim into pango-text
2 parents ff98718 + de75f5d commit 7d009af

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+3401
-526
lines changed

.github/manimdependency.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
2-
"windows": {
3-
"sox": "sox-14.4.2-win32",
4-
"ffmpeg": "https://www.gyan.dev/ffmpeg/builds/packages/ffmpeg-4.3.1-2020-09-16-full_build.zip",
5-
"pango": "v0.1.0"
6-
}
7-
}
2+
"windows": {
3+
"ffmpeg": "https://www.gyan.dev/ffmpeg/builds/packages/ffmpeg-4.3.1-2020-09-21-full_build.zip",
4+
"pango": "v0.1.0"
5+
}
6+
}

.github/workflows/ci.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
- name: Install system dependencies (MacOS)
5757
if: runner.os == 'macOS'
5858
run: |
59-
brew install openssl readline ffmpeg sox pyenv pyenv-virtualenv
59+
brew install openssl readline ffmpeg pyenv pyenv-virtualenv
6060
brew cask install basictex
6161
eval "$(/usr/libexec/path_helper -s)"
6262
sudo tlmgr update --self
@@ -74,13 +74,11 @@ jobs:
7474
uses: actions/cache@v2
7575
with:
7676
path: ${{ github.workspace }}\ManimCache
77-
key: ${{ runner.os }}-dependencies-ffmpeg-sox-tinytex-${{ hashFiles('.github/manimdependency.json') }}-${{ steps.pip-cache-and-time.outputs.date }}
77+
key: ${{ runner.os }}-dependencies-ffmpeg-tinytex-${{ hashFiles('.github/manimdependency.json') }}-${{ steps.pip-cache-and-time.outputs.date }}
7878

7979
- name: Download system dependencies (Windows)
8080
if: runner.os == 'Windows' && steps.cache-windows.outputs.cache-hit != 'true'
8181
run: |
82-
$soxVersion = python -c "import json;print(json.load(open('.github/manimdependency.json'))['windows']['sox'])"
83-
$soxVersionNumber = python -c "import json;print(json.load(open('.github/manimdependency.json'))['windows']['sox'].split('-')[1])"
8482
$ffmpegUrl = python -c "import json;print(json.load(open('.github/manimdependency.json'))['windows']['ffmpeg'])"
8583
$pangoVersion = python -c "import json;print(json.load(open('.github/manimdependency.json'))['windows']['pango'])"
8684
$OriPath = $env:PATH
@@ -91,10 +89,7 @@ jobs:
9189
tlmgr update --self
9290
tlmgr install standalone preview doublestroke ms setspace rsfs relsize ragged2e fundus-calligra microtype wasysym physics dvisvgm jknapltx wasy cm-super babel-english
9391
$env:PATH=$OriPath
94-
echo "Completed Latex Install Sox"
95-
Invoke-WebRequest "https://downloads.sourceforge.net/project/sox/sox/$($soxVersionNumber)/$($soxVersion).zip" -UserAgent "wget" -O "$($env:TMP)\SoX.zip"
96-
7z x "$($env:TMP)\SoX.zip" -o"$($PWD)\ManimCache"
97-
Move-Item "ManimCache\sox-*" "ManimCache\SoX"
92+
echo "Completed Latex"
9893
Invoke-WebRequest "$ffmpegUrl" -O "$($env:TMP)\ffmpeg.zip"
9994
7z x "$($env:TMP)\ffmpeg.zip" -o"$($PWD)\ManimCache"
10095
Move-Item "ManimCache\ffmpeg-*" "ManimCache\FFmpeg"
@@ -107,8 +102,7 @@ jobs:
107102
run: |
108103
$env:Path += ";" + "$($PWD)\ManimCache\FFmpeg\bin"
109104
$env:Path += ";" + "$($PWD)\ManimCache\LatexWindows\TinyTeX\bin\win32"
110-
$env:Path += ";" + "$($PWD)\ManimCache\SoX"
111-
$env:Path += ";" + "$($PWD)\ManimCache\Pango\pango"
105+
$env:Path += ";" + "$($PWD)\ManimCache\Pango\pango"
112106
$env:Path = "$env:USERPROFILE\.poetry\bin;$($env:PATH)"
113107
echo "::set-env name=Path::$env:Path"
114108

docs/source/changelog.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ New Features
1919
Command line
2020
^^^^^^^^^^^^
2121

22-
#. Add 4k rendering option with the :code:`-k` option
23-
#. High quality rendering has gotten its own short argument (:code:`-e`)
2422
#. Output of 'manim --help' has been improved
2523
#. Implement logging with the :code:`rich` library and a :code:`logger` object instead of plain ol` prints
2624
#. Added a flag :code:`--dry_run`, which doesn’t write any media
@@ -32,6 +30,9 @@ Command line
3230
#. Re-implement GIF export with the :code:`-i` flag (using this flag outputs ONLY a .gif file, and no .mp4 file)
3331
#. Added a :code:`--verbose` flag
3432
#. You can save the logs to a file by using :code:`--log_to_file`
33+
#. Add experimental javascript rendering with :code:`--use_js_renderer`
34+
#. Add :code:`-q/--quality [k|h|m|l]` flag and removed :code:`-m/-l` flags.
35+
#. Removed :code:`--sound` flag
3536

3637

3738
Config system
@@ -62,6 +63,8 @@ Mobjects, Scenes, and Animations
6263
#. Add a :code:`Variable` class for displaying text that continuously updates to reflect the value of a python variable.
6364
#. The ``Tex`` and ``MathTex`` objects allow you to specify a custom TexTemplate using the ``template`` keyword argument.
6465
#. :code:`VGroup` now supports printing the class names of contained mobjects and :code:`VDict` supports printing the internal dict of mobjects
66+
#. :code:`Scene` now renders when :code:`Scene.render()` is called rather than upon instantiation.
67+
#. :code:`ValueTracker` now supports increment using the `+=` operator (in addition to the already existing `increment_value` method)
6568
#. Add :class:`PangoText` for rendering texts using Pango.
6669

6770

docs/source/installation/linux.rst

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ instructions in `Certifying a clean install`_.
99

1010
The two necessary dependencies are cairo and ffmpeg. LaTeX is strongly
1111
recommended, as it is necessary to have access to the ``Tex`` and ``MathTex`` classes.
12-
Sox is only required if you want manim to play sounds when rendering scenes.
1312

1413
Ubuntu/Debian
1514
*************
@@ -40,12 +39,6 @@ To install LaTeX:
4039
sudo apt install texlive texlive-latex-extra texlive-fonts-extra \
4140
texlive-latex-recommended texlive-science texlive-fonts-extra tipa
4241
43-
To install Sox (optional):
44-
45-
.. code-block:: bash
46-
47-
sudo apt install sox
48-
4942
.. note:: These instructions are also valid for other Debian-based
5043
distributions or distributions that use the ``apt`` package manager.
5144

@@ -72,11 +65,6 @@ To install LaTeX:
7265
7366
sudo pacman -S texlive-most
7467
75-
To install Sox (optional):
76-
77-
.. code-block:: bash
78-
79-
sudo pacman -S sox
8068
8169
.. note:: These instructions are also valid for other Arch-based
8270
distributions or distributions that use the ``pacman`` package
@@ -89,8 +77,7 @@ Certifying a clean install
8977
To check that all dependencies have been installed properly, you can execute
9078
the commands ``ffmpeg -version`` and ``latex``. (If LaTeX is installed
9179
properly, you will be taken to a command-line program that captures your
92-
cursor. Press CTRL+C to exit.) To check that Sox is installed correctly,
93-
simply run ``sox``.
80+
cursor. Press CTRL+C to exit.)
9481

9582
.. note:: Note the LaTeX installation may take up a lot of space. The manim
9683
community developers are currently working on providing a simpler,

docs/source/installation/mac.rst

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ To install ffmpeg:
3131
3232
brew install ffmpeg
3333
34-
To install Sox (optional):
35-
36-
.. code-block:: bash
37-
38-
brew install sox
39-
4034
To install LaTeX:
4135

4236
.. code-block:: bash
@@ -74,7 +68,7 @@ To check that all dependencies have been installed properly, you can execute
7468
the commands ``ffmpeg -version`` and ``latex`` (regardless of whether you
7569
installed MacTeX or BasicTeX). If LaTeX is installed properly, you will be
7670
taken to a command-line program that captures your cursor. Press CTRL+C to
77-
exit. To check that Sox is installed correctly, simply run ``sox``.
71+
exit.
7872

7973
After making sure you have a clean install, you can go back to
8074
:ref:`installing-manim`.

docs/source/installation/win.rst

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ And then you can skip all the other steps and move to installing :ref:`latex-ins
2020

2121
Pango Installation
2222
******************
23+
2324
These steps would get you `libpango-1.0-0.dll` to your ``PATH`` along
2425
with other dependencies. You may probably have them before itself if
2526
you have installed `GTK <https://www.gtk.org/>`_ or any ``GTK``
@@ -43,43 +44,6 @@ path and skip these steps.
4344
<https://www.computerhope.com/issues/ch000549.htm>`_.
4445

4546

46-
Cairo installation
47-
******************
48-
49-
1. Visit the `Download Page
50-
<https://www.lfd.uci.edu/~gohlke/pythonlibs/#pycairo>`_.
51-
52-
2. Select the download that corresponds to your PC's architechture and Python
53-
Version
54-
55-
.. image:: ../_static/windows_cairo.png
56-
:align: center
57-
:width: 400px
58-
:alt: windows cairo download page
59-
60-
.. note:: ``cp38`` corresponds to Python 3.8, ``cp37`` corresponds to Python
61-
3.7, etc. ``win_amd64`` corresponds to 64-bit machines, ``win32``
62-
corresponds to 32-bit machines.
63-
64-
3. Open up your command prompt by hitting the Win key and typing ``cmd``.
65-
66-
4. Enter the directory where you want to install cairo by typing ``cd
67-
C:\path\to\cairo`` with the path being where you downloaded the ``.whl``
68-
file in step 2.
69-
70-
5. Finally, run ``pip(pyversion) install (cairo-file).whl``, where
71-
``pyversion`` is the python version you are using. For example, if you are
72-
using python3.7, you should run ``pip3.7 install (cairo-file).whl``.
73-
74-
75-
6. Alternatively, running the command below installs pycairo. This needs to be
76-
run in an elevated command prompt like Powershell.
77-
78-
.. code-block:: bash
79-
80-
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/ManimCommunity/manim/master/scripts/pycairoinstall.py -UseBasicParsing).Content | py -3
81-
82-
8347
FFmpeg installation
8448
*******************
8549

@@ -90,14 +54,6 @@ FFmpeg installation
9054
environment variable and running ``ffmpeg``.
9155

9256

93-
Sox installation (optional)
94-
***************************
95-
96-
1. To install Sox, execute ``choco install sox.portable``.
97-
98-
2. You can check if you did it right by running ``refreshenv`` to update your
99-
environment variable and running ``sox``.
100-
10157
.. _latex-installation:
10258

10359
LaTeX Installation

docs/source/manim_directive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def run(self):
192192
"from manim import *",
193193
*file_writer_config_code,
194194
*user_code,
195-
f"{clsname}()",
195+
f"{clsname}().render()",
196196
]
197197
exec("\n".join(code), globals())
198198

docs/source/tutorials/configuration.rst

Lines changed: 67 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Usually, manim is ran from the command line by executing
1717
1818
This asks manim to search for a Scene class called :code:`SceneName` inside the
1919
file <file.py> and render it. One can also specify the render quality by using
20-
the flags :code:`-l`, :code:`-m`, :code:`-e`, or :code:`-k`, for low, medium,
20+
the flags :code:`-ql`, :code:`-qm`, :code:`-qh`, or :code:`-qk`, for low, medium,
2121
high, and 4k quality, respectively.
2222

2323
.. code-block:: bash
@@ -46,89 +46,78 @@ The output looks as follows.
4646
.. testoutput::
4747
:options: -ELLIPSIS, +NORMALIZE_WHITESPACE
4848

49-
usage: manim [-h] [-o OUTPUT_FILE] [-p] [-f] [--sound] [--leave_progress_bars]
50-
[-a] [-w] [-s] [-g] [-i] [--disable_caching] [--flush_cache]
51-
[--log_to_file] [-c BACKGROUND_COLOR]
52-
[--background_opacity BACKGROUND_OPACITY] [--media_dir MEDIA_DIR]
53-
[--log_dir LOG_DIR] [--tex_template TEX_TEMPLATE] [--dry_run]
54-
[-t] [-l] [-m] [-e] [-k] [-r RESOLUTION]
55-
[-n FROM_ANIMATION_NUMBER] [--config_file CONFIG_FILE]
56-
[--custom_folders] [-v {DEBUG,INFO,WARNING,ERROR,CRITICAL}]
57-
[--progress_bar True/False]
58-
{cfg} ... file [scene_names [scene_names ...]]
59-
60-
Animation engine for explanatory math videos
61-
62-
positional arguments:
63-
{cfg}
64-
file path to file holding the python code for the scene
65-
scene_names Name of the Scene class you want to see
66-
67-
optional arguments:
68-
-h, --help show this help message and exit
69-
-o OUTPUT_FILE, --output_file OUTPUT_FILE
70-
Specify the name of the output file, if it should be
71-
different from the scene class name
72-
-p, --preview Automatically open the saved file once its done
73-
-f, --show_in_file_browser
74-
Show the output file in the File Browser
75-
--sound Play a success/failure sound
76-
--leave_progress_bars
77-
Leave progress bars displayed in terminal
78-
-a, --write_all Write all the scenes from a file
79-
-w, --write_to_movie Render the scene as a movie file (this is on by
80-
default)
81-
-s, --save_last_frame
82-
Save the last frame only (no movie file is generated)
83-
-g, --save_pngs Save each frame as a png
84-
-i, --save_as_gif Save the video as gif
85-
--disable_caching Disable caching (will generate partial-movie-files
86-
anyway)
87-
--flush_cache Remove all cached partial-movie-files
88-
--log_to_file Log terminal output to file
89-
-c BACKGROUND_COLOR, --background_color BACKGROUND_COLOR
90-
Specify background color
91-
--background_opacity BACKGROUND_OPACITY
92-
Specify background opacity
93-
--media_dir MEDIA_DIR
94-
Directory to store media (including video files)
95-
--log_dir LOG_DIR Directory to store log files
96-
--tex_template TEX_TEMPLATE
97-
Specify a custom TeX template file
98-
--dry_run Do a dry run (render scenes but generate no output
99-
files)
100-
-t, --transparent Render a scene with an alpha channel
101-
-l, --low_quality Render at low quality
102-
-m, --medium_quality Render at medium quality
103-
-e, --high_quality Render at high quality
104-
-k, --fourk_quality Render at 4K quality
105-
-r RESOLUTION, --resolution RESOLUTION
106-
Resolution, passed as "height,width". Overrides the
107-
-l, -m, -e, and -k flags, if present
108-
-n FROM_ANIMATION_NUMBER, --from_animation_number FROM_ANIMATION_NUMBER
109-
Start rendering at the specified animation index,
110-
instead of the first animation. If you pass in two
111-
comma separated values, e.g. '3,6', it will end the
112-
rendering at the second value
113-
--config_file CONFIG_FILE
114-
Specify the configuration file
115-
--custom_folders Use the folders defined in the [custom_folders]
116-
section of the config file to define the output folder
117-
structure
118-
-v {DEBUG,INFO,WARNING,ERROR,CRITICAL}, --verbosity {DEBUG,INFO,WARNING,ERROR,CRITICAL}
119-
Verbosity level. Also changes the ffmpeg log level
120-
unless the latter is specified in the config
121-
--progress_bar True/False
122-
Display the progress bar
123-
124-
Made with <3 by the manim community devs
49+
usage: manim [-h] [-o OUTPUT_FILE] [-p] [-f] [--leave_progress_bars] [-a] [-w] [-s] [-g] [-i] [--disable_caching] [--flush_cache] [--log_to_file] [-c BACKGROUND_COLOR]
50+
[--background_opacity BACKGROUND_OPACITY] [--media_dir MEDIA_DIR] [--log_dir LOG_DIR] [--tex_template TEX_TEMPLATE] [--dry_run] [-t] [-q {k,h,m,l}] [--low_quality] [--medium_quality]
51+
[--high_quality] [--fourk_quality] [-r RESOLUTION] [-n FROM_ANIMATION_NUMBER] [--use_js_renderer] [--js_renderer_path JS_RENDERER_PATH] [--config_file CONFIG_FILE] [--custom_folders]
52+
[-v {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [--progress_bar True/False]
53+
{cfg} ... file [scene_names [scene_names ...]]
54+
55+
Animation engine for explanatory math videos
56+
57+
positional arguments:
58+
{cfg}
59+
file path to file holding the python code for the scene
60+
scene_names Name of the Scene class you want to see
61+
62+
optional arguments:
63+
-h, --help show this help message and exit
64+
-o OUTPUT_FILE, --output_file OUTPUT_FILE
65+
Specify the name of the output file, if it should be different from the scene class name
66+
-p, --preview Automatically open the saved file once its done
67+
-f, --show_in_file_browser
68+
Show the output file in the File Browser
69+
--leave_progress_bars
70+
Leave progress bars displayed in terminal
71+
-a, --write_all Write all the scenes from a file
72+
-w, --write_to_movie Render the scene as a movie file (this is on by default)
73+
-s, --save_last_frame
74+
Save the last frame only (no movie file is generated)
75+
-g, --save_pngs Save each frame as a png
76+
-i, --save_as_gif Save the video as gif
77+
--disable_caching Disable caching (will generate partial-movie-files anyway)
78+
--flush_cache Remove all cached partial-movie-files
79+
--log_to_file Log terminal output to file
80+
-c BACKGROUND_COLOR, --background_color BACKGROUND_COLOR
81+
Specify background color
82+
--background_opacity BACKGROUND_OPACITY
83+
Specify background opacity
84+
--media_dir MEDIA_DIR
85+
Directory to store media (including video files)
86+
--log_dir LOG_DIR Directory to store log files
87+
--tex_template TEX_TEMPLATE
88+
Specify a custom TeX template file
89+
--dry_run Do a dry run (render scenes but generate no output files)
90+
-t, --transparent Render a scene with an alpha channel
91+
-q {k,h,m,l}, --quality {k,h,m,l}
92+
Render at specific quality, short form of the --*_quality flags
93+
--low_quality Render at low quality
94+
--medium_quality Render at medium quality
95+
--high_quality Render at high quality
96+
--fourk_quality Render at 4K quality
97+
-r RESOLUTION, --resolution RESOLUTION
98+
Resolution, passed as "height,width". Overrides any quality flags, if present
99+
-n FROM_ANIMATION_NUMBER, --from_animation_number FROM_ANIMATION_NUMBER
100+
Start rendering at the specified animation index, instead of the first animation. If you pass in two comma separated values, e.g. '3,6', it will end the rendering at the second
101+
value
102+
--use_js_renderer Render animations using the javascript frontend
103+
--js_renderer_path JS_RENDERER_PATH
104+
Path to the javascript frontend
105+
--config_file CONFIG_FILE
106+
Specify the configuration file
107+
--custom_folders Use the folders defined in the [custom_folders] section of the config file to define the output folder structure
108+
-v {DEBUG,INFO,WARNING,ERROR,CRITICAL}, --verbosity {DEBUG,INFO,WARNING,ERROR,CRITICAL}
109+
Verbosity level. Also changes the ffmpeg log level unless the latter is specified in the config
110+
--progress_bar True/False
111+
Display the progress bar
112+
113+
Made with <3 by the manim community devs
125114

126115
For example, to render a scene in high quality, but only output the last frame
127116
of the scene instead of the whole video, you can execute
128117

129118
.. code-block:: bash
130119
131-
$ manim <file.py> SceneName -es
120+
$ manim <file.py> SceneName -sqh
132121
133122
The following example specifies the output file name (with the :code:`-o`
134123
flag), renders only the first ten animations (:code:`-n` flag) with a white

0 commit comments

Comments
 (0)