Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ docs/source/_build/
target/

# Jupyter Notebook
jupyter/
.ipynb_checkpoints

# IPython
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<br />
<a href="https://pypi.org/project/manim/"><img src="https://img.shields.io/pypi/v/manim.svg?style=flat&logo=pypi" alt="PyPI Latest Release"></a>
<a href="https://hub.docker.com/r/manimcommunity/manim"><img src="https://img.shields.io/docker/v/manimcommunity/manim?color=%23099cec&label=docker%20image&logo=docker" alt="Docker image"> </a>
<a href="https://mybinder.org/v2/gist/behackl/725d956ec80969226b7bf9b4aef40b78/HEAD?filepath=basic%20example%20scenes.ipynb"><img src="https://mybinder.org/badge_logo.svg"></a>
<a href="https://mybinder.org/v2/gh/ManimCommunity/jupyter_examples/HEAD?filepath=basic_example_scenes.ipynb"><img src="https://mybinder.org/badge_logo.svg"></a>
<a href="http://choosealicense.com/licenses/mit/"><img src="https://img.shields.io/badge/license-MIT-red.svg?style=flat" alt="MIT License"></a>
<a href="https://www.reddit.com/r/manim/"><img src="https://img.shields.io/reddit/subreddit-subscribers/manim.svg?color=orange&label=reddit&logo=reddit" alt="Reddit" href=></a>
<a href="https://twitter.com/manim_community/"><img src="https://img.shields.io/twitter/url/https/twitter.com/cloudposse.svg?style=social&label=Follow%20%40manim_community" alt="Twitter">
Expand All @@ -19,7 +19,6 @@
</p>
<hr />


Manim is an animation engine for explanatory math videos. It's used to create precise animations programmatically, as demonstrated in the videos of [3Blue1Brown](https://www.3blue1brown.com/).

> NOTE: This repository is maintained by the Manim Community, and is not associated with Grant Sanderson or 3Blue1Brown in any way (although we are definitely indebted to him for providing his work to the world). If you would like to study how Grant makes his videos, head over to his repository ([3b1b/manim](https://github.com/3b1b/manim)). This fork is updated more frequently than his, and it's recommended to use this fork if you'd like to use Manim for your own projects.
Expand Down Expand Up @@ -80,8 +79,7 @@ You should see your native video player program pop up and play a simple scene i

Manim also ships with a `%%manim` IPython magic which allows to use it conveniently in JupyterLab (as well as classic Jupyter) notebooks. See the
[corresponding documentation](https://docs.manim.community/en/latest/reference/manim.utils.ipython_magic.ManimMagic.html) for some guidance and
[try it out online](https://mybinder.org/v2/gist/behackl/725d956ec80969226b7bf9b4aef40b78/HEAD?filepath=basic%20example%20scenes.ipynb).

[try it out online](https://mybinder.org/v2/gh/ManimCommunity/jupyter_examples/HEAD?filepath=basic_example_scenes.ipynb).
## Command line arguments

The general usage of Manim is as follows:
Expand Down
4 changes: 4 additions & 0 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ following pages have instructions that are specific to your system. Once you
are done installing the dependencies, come back to this page to install manim
itself.

.. tip::

In case that you want to try manim online without installation, open it in `Binder <https://mybinder.org/v2/gh/ManimCommunity/jupyter_examples/HEAD?filepath=basic_example_scenes.ipynb>`_.

Installing dependencies
***********************

Expand Down
214 changes: 214 additions & 0 deletions example_scenes/manim_jupyter_example.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"from manim import *"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"class Example1(Scene):\n",
" def construct(self):\n",
" self.add(Circle())\n",
"\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"usage: manim file [flags] [scene [scene ...]]\n",
" manim {cfg,init,plugins} [opts]\n",
"manim: error: unrecognized arguments: Example1\n"
]
}
],
"source": [
"%%manim -s -p -ql Example1\n",
"\n",
"class Example1(Scene):\n",
" def construct(self):\n",
" self.add(Circle())"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Animation 0: AnimationGroup(Group): 0%| | 0/63 [00:00<?, ?it/s]"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"# set the maximum width for video outputs to a predefined value\n",
"config.media_width = \"10vw\"\n",
"\n",
"class HelloManim(Scene):\n",
" def construct(self):\n",
" self.camera.background_color = \"#ece6e2\"\n",
" banner_large = ManimBanner(dark_theme=False).scale(0.7)\n",
" self.play(banner_large.create())\n",
" self.play(banner_large.expand())\n",
"\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" \r"
]
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #bfbf7f\">[03/23/21 08:36:57] </span><span style=\"color: #7fbf7f\">INFO</span> <span style=\"color: #008000\">Animation 0 : Partial movie file </span><a href=\"file:///Users/jan-hendrik/projects/manim/manimenv/lib/python3.9/site-packages/manim/scene/scene_file_writer.py\"><span style=\"color: #7f7f7f\">scene_file_writer.py</span></a><span style=\"color: #7f7f7f\">:395</span>\n",
" <span style=\"color: #008000\">written in </span><span style=\"color: #008000; font-weight: bold\">{</span><span style=\"color: #008000\">'/Users/jan-hendrik/project</span><span style=\"color: #008000\"> </span> \n",
" <span style=\"color: #008000\">s/manim/example_</span><span style=\"color: #800080\">scene</span><span style=\"color: #008000\">s/media/videos/exa</span><span style=\"color: #008000\"> </span> \n",
" <span style=\"color: #008000\">mple_</span><span style=\"color: #800080\">scene</span><span style=\"color: #008000\">s/720p30/partial_movie_files/</span><span style=\"color: #008000\"> </span> \n",
" <span style=\"color: #008000\">HelloManim/908850576_4260304398_1510924</span><span style=\"color: #008000\"> </span> \n",
" <span style=\"color: #008000\">71.mp4'</span><span style=\"color: #008000; font-weight: bold\">}</span><span style=\"color: #008000\"> </span> \n",
"</pre>\n"
],
"text/plain": [
"<rich.jupyter.JupyterRenderable at 0x175798c10>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" \r"
]
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #bfbf7f\">[03/23/21 08:36:58] </span><span style=\"color: #7fbf7f\">INFO</span> <span style=\"color: #008000\">Animation 1 : Partial movie file </span><a href=\"file:///Users/jan-hendrik/projects/manim/manimenv/lib/python3.9/site-packages/manim/scene/scene_file_writer.py\"><span style=\"color: #7f7f7f\">scene_file_writer.py</span></a><span style=\"color: #7f7f7f\">:395</span>\n",
" <span style=\"color: #008000\">written in </span><span style=\"color: #008000; font-weight: bold\">{</span><span style=\"color: #008000\">'/Users/jan-hendrik/project</span><span style=\"color: #008000\"> </span> \n",
" <span style=\"color: #008000\">s/manim/example_</span><span style=\"color: #800080\">scene</span><span style=\"color: #008000\">s/media/videos/exa</span><span style=\"color: #008000\"> </span> \n",
" <span style=\"color: #008000\">mple_</span><span style=\"color: #800080\">scene</span><span style=\"color: #008000\">s/720p30/partial_movie_files/</span><span style=\"color: #008000\"> </span> \n",
" <span style=\"color: #008000\">HelloManim/1169650153_2282905040_181795</span><span style=\"color: #008000\"> </span> \n",
" <span style=\"color: #008000\">9623.mp4'</span><span style=\"color: #008000; font-weight: bold\">}</span><span style=\"color: #008000\"> </span> \n",
"</pre>\n"
],
"text/plain": [
"<rich.jupyter.JupyterRenderable at 0x17588bfd0>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #bfbf7f\"> </span><span style=\"color: #7fbf7f\">INFO</span> <span style=\"color: #008000\"> </span><a href=\"file:///Users/jan-hendrik/projects/manim/manimenv/lib/python3.9/site-packages/manim/scene/scene_file_writer.py\"><span style=\"color: #7f7f7f\">scene_file_writer.py</span></a><span style=\"color: #7f7f7f\">:579</span>\n",
" <span style=\"color: #800080\">File</span><span style=\"color: #008000\"> ready at </span><span style=\"color: #800080\">/Users/jan-hendrik/projec</span><span style=\"color: #008000\"> </span> \n",
" <span style=\"color: #800080\">ts/manim/example_scenes/media/videos/ex</span><span style=\"color: #008000\"> </span> \n",
" <span style=\"color: #800080\">ample_scenes/720p30/</span><span style=\"color: #ff00ff\">HelloManim.mp4</span><span style=\"color: #008000\"> </span> \n",
" <span style=\"color: #008000\"> </span> \n",
"</pre>\n"
],
"text/plain": [
"<rich.jupyter.JupyterRenderable at 0x17588bac0>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #bfbf7f\"> </span><span style=\"color: #7fbf7f\">INFO</span> <span style=\"color: #800080\">Rendered</span><span style=\"color: #008000\"> HelloManim </span><a href=\"file:///Users/jan-hendrik/projects/manim/manimenv/lib/python3.9/site-packages/manim/scene/scene.py\"><span style=\"color: #7f7f7f\">scene.py</span></a><span style=\"color: #7f7f7f\">:183</span>\n",
" <span style=\"color: #800080\">Played</span><span style=\"color: #008000\"> 2 </span><span style=\"color: #800080\">animations</span><span style=\"color: #008000\"> </span> \n",
"</pre>\n"
],
"text/plain": [
"<rich.jupyter.JupyterRenderable at 0x17588be80>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<video src=\"media/jupyter/1f9441c1425b2d6971d4c18ea380f32c8810e087.mp4\" controls autoplay loop style=\"max-width: 100%;\" >\n",
" Your browser does not support the <code>video</code> element.\n",
" </video>"
],
"text/plain": [
"<IPython.core.display.Video object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"%%manim -p -qm HelloManim\n",
"\n",
"# set the maximum width for video outputs to a predefined value\n",
"config.media_width = \"10vw\"\n",
"\n",
"class HelloManim(Scene):\n",
" def construct(self):\n",
" self.camera.background_color = \"#ece6e2\"\n",
" banner_large = ManimBanner(dark_theme=False).scale(0.7)\n",
" self.play(banner_large.create())\n",
" self.play(banner_large.expand())"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.1"
}
},
"nbformat": 4,
"nbformat_minor": 4
}