Skip to content

Commit

Permalink
Release v0.2.0 (#897)
Browse files Browse the repository at this point in the history
Changes since v0.1.1.
  • Loading branch information
eulertour authored Jan 2, 2021
1 parent 92939cd commit 99c79e9
Show file tree
Hide file tree
Showing 94 changed files with 3,082 additions and 1,948 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
manim/grpc/gen/* linguist-generated=true
3 changes: 0 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ COPY . /opt/manim
WORKDIR /opt/manim
RUN pip install --no-cache .

# ensure that ffi bindings are generated
RUN python -c "import pangocairocffi"

# create working directory for user to mount local directory into
WORKDIR /manim
RUN chmod 666 /manim
Expand Down
100 changes: 97 additions & 3 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,100 @@ Upcoming release
Changes for the upcoming release are tracked `in our GitHub wiki <https://github.com/ManimCommunity/manim/wiki/Changelog-for-next-release>`_.


******
v0.2.0
******

:Date: January 1, 2021

The changes since Manim Community release v0.1.1 are listed below.

Breaking Changes
================

- Remove all CONFIG dictionaries and all calls to ``digest_config`` and allow
passing options directly to the constructor of the corresponding classes (:pr:`783`).

Practically, this means that old constructions using ``CONFIG`` like::

class SomeMobject(Thing):
CONFIG = {
"my_awesome_property": 42
}

where corresponding objects were then instantiated as ``my_mobject = SomeMobject()``
should now be created simply using ``my_mobject = SomeMobject(my_awesome_property=42)``.

- Remove old syntax for animating mobject methods by passing the methods and arguments to ``self.play``,
and use a new syntax featuring the ``animate`` property (:pr:`881`).

For example: the old-style ``play`` call
::

self.play(my_square.shift, LEFT)

should be replaced with the new following call using the ``animate`` property::

self.play(my_square.animate.shift(LEFT))

New Features
============

- Added creation animation for :class:`~.ManimBanner` (:pr:`814`)
- Added some documentation to :meth:`~.Scene.construct` (:pr:`753`)
- Added a black and white monochromatic version of Manim's logo (:pr:`826`)
- Added support for a plugin system (``manim plugin`` subcommand + documentation) (:pr:`784`)
- Implemented ``__add__``, ``__iadd__``, ``__sub__``, and ``__isub__`` for :class:`~.Mobject` (allowing for notation like ``some_vgroup + some_mobject``) (:pr:`790`)
- Added type hints to several files in the library (:pr:`835`)
- Added some examples to :mod:`~.animation.creation` (:pr:`820`)
- Added some examples to :class:`~.DashedLine` and :class:`~.CurvesAsSubmobjects` (:pr:`833`)
- Added new implementation for text rendered with Pango, :class:`~.MarkupText`, which can be formatted with an HTML-like syntax (:pr:`855`)
- Added Fading in and out examples and deprecation of ``FadeInFromDown`` and ``FadeOutAndShiftDown`` (:pr:`827`)
- Added example for :class:`~.MoveAlongPath` to the docs (:pr:`873`)
- Added ambient rotate for other angles - theta, phi, gamma (:pr:`660`)
- Use custom bindings for Pango (:pr:`878`)
- Added :class:`~.Graph`, a basic implementation for (graph theory) graphs (:pr:`861`)
- Allow for chaining methods when using the new ``.animate`` syntax in :meth:`~.Scene.play` (:pr:`889`)

Bugfixes
========

- Fix doctests in .rst files (:pr:`797`)
- Fix failing doctest after adding ``manim plugin`` subcommand (:pr:`831`)
- Normalize the direction vector in :meth:`~.mobject_update_utils.always_shift` (:pr:`839`)
- Add ``disable_ligatures`` to :class:`~.Text` (via :pr:`804`)
- Make scene caching aware of order of Mobjects (:pr:`845`)
- Fix :class:`~.CairoText` to work with new config structure (:pr:`858`)
- Added missing argument to classes inheriting from :class:`~.Matrix` (:pr:`859`)
- Fixed: ``z_index`` of mobjects contained in others as submobjects is now properly respected (:pr:`872`)
- Let :meth:`~.ParametricSurface.set_fill_by_checkboard` return the modified surface to allow method chaining (:pr:`883`)
- Mobjects added during an updater are added to ``Scene.moving_mobjects`` (:pr:`838`)
- Pass background color to JS renderer (:pr:`876`)
- Small fixes to docstrings. Tiny cleanups. Remove ``digest_mobject_attrs``. (:pr:`834`)
- Added closed shape detection in :class:`~.DashedVMobject` in order to achieve an even dash pattern (:pr:`884`)
- Fix Spelling in docstrings and variables across the library (:pr:`890`)

Other changes
=============

- Change library name to manim (:pr:`811`)
- Docker: use local files when building an image (:pr:`803`)
- Let ffmpeg render partial movie files directly instead of temp files (:pr:`817`)
- ``manimce`` to ``manim`` & capitalizing Manim in readme (:pr:`794`)
- Added flowchart for different docstring categories (:pr:`828`)
- Improve example in module docstring of :mod:`~.animation.creation` + explicitly document buff parameter in :meth:`~.Mobject.arrange` (:pr:`825`)
- Disable CI pipeline for Python 3.6 (:pr:`823`)
- Update URLs in docs (:pr:`832`)
- Move upcoming changelog to GitHub-wiki (:pr:`822`)
- Change badges in readme (:pr:`854`)
- Exclude generated gRPC files from source control (:pr:`868`)
- Added linguist-generated attribute to ``.gitattributes`` (:pr:`877`)
- Cleanup: removed inheritance from ``object`` for some classes, refactor some imports (:pr:`795`)
- Change several ``str.format()`` to ``f``-strings (:pr:`867`)
- Update javascript renderer (:pr:`830`)
- Bump version number to 0.2.0, update changelog (:pr:`894`)


******
v0.1.1
******
Expand Down Expand Up @@ -105,7 +199,7 @@ Command line

#. Output of 'manim --help' has been improved
#. Implement logging with the :code:`rich` library and a :code:`logger` object instead of plain ol' prints
#. Added a flag :code:`--dry_run`, which doesnt write any media
#. Added a flag :code:`--dry_run`, which doesn't write any media
#. Allow for running manim with :code:`python3 -m manim`
#. Refactored Tex Template management. You can now use custom templates with command line args using :code:`--tex_template`!
#. Re-add :code:`--save_frames` flag, which will save each frame as a png
Expand Down Expand Up @@ -187,7 +281,7 @@ Of interest to developers

#. Python code formatting is now enforced by using the :code:`black` tool
#. PRs now require two approving code reviews from community devs before they can be merged
#. Added tests to ensure stuff doesnt break between commits (For developers) [Uses Github CI, and Pytest]
#. Added tests to ensure stuff doesn't break between commits (For developers) [Uses Github CI, and Pytest]
#. Add contribution guidelines (for developers)
#. Added autogenerated documentation with sphinx and autodoc/autosummary [WIP]
#. Made manim internally use relative imports
Expand All @@ -203,4 +297,4 @@ Other Changes
#. Cleanup 3b1b Specific Files
#. Rename package from manimlib to manim
#. Move all imports to :code:`__init__`, so :code:`from manim import *` replaces :code:`from manimlib.imports import *`
#. Global dir variable handling has been removed. Instead :code:`initialize_directories`, if needed, overrides the values from the cfg files at runtime.
#. Global dir variable handling has been removed. Instead :code:`initialize_directories`, if needed, overrides the values from the cfg files at runtime.
82 changes: 42 additions & 40 deletions docs/source/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,6 @@ Basic Concepts
self.add(logo)


.. manim:: GradientImageFromArray
:save_last_frame:
:ref_classes: ImageMobject

class GradientImageFromArray(Scene):
def construct(self):
n = 256
imageArray = np.uint8(
[[i * 256 / n for i in range(0, n)] for _ in range(0, n)]
)
image = ImageMobject(imageArray).scale(2)
self.add(image)

.. manim:: BraceAnnotation
:save_last_frame:
Expand Down Expand Up @@ -91,6 +79,19 @@ Basic Concepts
tip_text = Text('(2, 2)').next_to(arrow.get_end(), RIGHT)
self.add(numberplane, dot, arrow, origin_text, tip_text)

.. manim:: GradientImageFromArray
:save_last_frame:
:ref_classes: ImageMobject

class GradientImageFromArray(Scene):
def construct(self):
n = 256
imageArray = np.uint8(
[[i * 256 / n for i in range(0, n)] for _ in range(0, n)]
)
image = ImageMobject(imageArray).scale(2)
self.add(image)

.. manim:: BezierSpline
:save_last_frame:
:ref_classes: Line VGroup
Expand Down Expand Up @@ -203,10 +204,10 @@ Animations
def construct(self):
square = Square(color=BLUE, fill_opacity=1)

self.play(square.shift, LEFT)
self.play(square.set_fill, ORANGE)
self.play(square.scale, 0.3)
self.play(square.rotate, 0.4)
self.play(square.animate.shift(LEFT))
self.play(square.animate.set_fill(ORANGE))
self.play(square.animate.scale(0.3))
self.play(square.animate.rotate(0.4))

.. manim:: MovingFrameBox
:ref_modules: manim.mobject.svg.tex_mobject
Expand Down Expand Up @@ -267,8 +268,8 @@ Animations
self.add(path, dot)
self.play(Rotating(dot, radians=PI, about_point=RIGHT, run_time=2))
self.wait()
self.play(dot.shift, UP)
self.play(dot.shift, LEFT)
self.play(dot.animate.shift(UP))
self.play(dot.animate.shift(LEFT))
self.wait()


Expand Down Expand Up @@ -393,9 +394,9 @@ Special Camera Settings
moving_dot = Dot().move_to(graph.points[0]).set_color(ORANGE)

dot_at_start_graph = Dot().move_to(graph.points[0])
dot_at_end_grap = Dot().move_to(graph.points[-1])
self.add(graph, dot_at_end_grap, dot_at_start_graph, moving_dot)
self.play( self.camera_frame.scale,0.5,self.camera_frame.move_to,moving_dot)
dot_at_end_graph = Dot().move_to(graph.points[-1])
self.add(graph, dot_at_end_graph, dot_at_start_graph, moving_dot)
self.play(self.camera_frame.animate.scale(0.5).move_to(moving_dot))

def update_curve(mob):
mob.move_to(moving_dot.get_center())
Expand Down Expand Up @@ -461,15 +462,15 @@ Special Camera Settings
# Scale in x y z
scale_factor = [0.5, 1.5, 0]
self.play(
frame.scale, scale_factor,
zoomed_display.scale, scale_factor,
frame.animate.scale(scale_factor),
zoomed_display.animate.scale(scale_factor),
FadeOut(zoomed_camera_text),
FadeOut(frame_text)
)
self.wait()
self.play(ScaleInPlace(zoomed_display, 2))
self.wait()
self.play(frame.shift, 2.5 * DOWN)
self.play(frame.animate.shift(2.5 * DOWN))
self.wait()
self.play(self.get_zoomed_display_pop_out_animation(), unfold_camera, rate_func=lambda t: smooth(1 - t))
self.play(Uncreate(zoomed_display_frame), FadeOut(frame))
Expand Down Expand Up @@ -603,8 +604,8 @@ Advanced Projects

class OpeningManim(Scene):
def construct(self):
title = Tex("This is some \\LaTeX")
basel = MathTex("\\sum_{n=1}^\\infty " "\\frac{1}{n^2} = \\frac{\\pi^2}{6}")
title = Tex(r"This is some \LaTeX")
basel = MathTex(r"\sum_{n=1}^\infty \frac{1}{n^2} = \frac{\pi^2}{6}")
VGroup(title, basel).arrange(DOWN)
self.play(
Write(title),
Expand All @@ -616,7 +617,7 @@ Advanced Projects
transform_title.to_corner(UP + LEFT)
self.play(
Transform(title, transform_title),
LaggedStart(*map(lambda obj: FadeOutAndShift(obj, direction=DOWN), basel)),
LaggedStart(*[FadeOutAndShift(obj, direction=DOWN) for obj in basel]),
)
self.wait()
Expand All @@ -634,19 +635,20 @@ Advanced Projects
self.wait()

grid_transform_title = Tex(
"That was a non-linear function \\\\" "applied to the grid"
r"That was a non-linear function \\ applied to the grid"
)
grid_transform_title.move_to(grid_title, UL)
grid.prepare_for_nonlinear_transform()
self.play(
grid.apply_function,
lambda p: p
+ np.array(
[
np.sin(p[1]),
np.sin(p[0]),
0,
]
grid.animate.apply_function(
lambda p: p
+ np.array(
[
np.sin(p[1]),
np.sin(p[0]),
0,
]
)
),
run_time=3,
)
Expand Down Expand Up @@ -679,7 +681,7 @@ Advanced Projects
self.add(x_axis, y_axis)
self.add_x_labels()

self.orgin_point = np.array([-4,0,0])
self.origin_point = np.array([-4,0,0])
self.curve_start = np.array([-3,0,0])

def add_x_labels(self):
Expand All @@ -694,14 +696,14 @@ Advanced Projects

def show_circle(self):
circle = Circle(radius=1)
circle.move_to(self.orgin_point)
circle.move_to(self.origin_point)

self.add(circle)
self.circle = circle

def move_dot_and_draw_curve(self):
orbit = self.circle
orgin_point = self.orgin_point
origin_point = self.origin_point

dot = Dot(radius=0.08, color=YELLOW)
dot.move_to(orbit.point_from_proportion(0))
Expand All @@ -714,7 +716,7 @@ Advanced Projects
mob.move_to(orbit.point_from_proportion(self.t_offset % 1))

def get_line_to_circle():
return Line(orgin_point, dot.get_center(), color=BLUE)
return Line(origin_point, dot.get_center(), color=BLUE)

def get_line_to_curve():
x = self.curve_start[0] + self.t_offset * 4
Expand Down
10 changes: 0 additions & 10 deletions docs/source/installation/mac.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@ To install cairo:
brew install cairo
To install Pango and it dependencies:

.. code-block:: bash
brew install pkg-config
brew install libffi
brew install pango
brew install glib
To install ffmpeg:

.. code-block:: bash
Expand Down
38 changes: 18 additions & 20 deletions docs/source/installation/troubleshooting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,28 @@ Troubleshooting

List of known installation problems.

(Windows) OSError: dlopen() failed to load a library: pango?
------------------------------------------------------------

If your manual installation of Manim (or even the installation using
Chocolatey) fails with the error
``pip install manim`` fails when installing manimpango?
-------------------------------------------------------
Most likely this means that pip was not able to use our pre-built wheels
of ``manimpango``. Let us know (via our `Discord <https://discord.gg/mMRrZQW>`_
or by opening a
`new issue on GitHub <https://github.com/ManimCommunity/ManimPango/issues/new>`_)
which architecture you would like to see supported, and we'll see what we
can do about it.

To fix errors when installing ``manimpango``, you need to make sure you
have all the necessary build requirements. Check out the detailed
instructions given in
`the BUILDING section <https://github.com/ManimCommunity/ManimPango#BUILDING>`_
of the corresponding `GitHub repository <https://github.com/ManimCommunity/ManimPango>`_.

.. code-block::

OSError: dlopen() failed to load a library: pango / pango-1 / pango-1.0 / pango-1.0-0
possibly combined with alerts warning about procedure entry points
``"deflateSetHeader"`` and ``"inflateReset2"`` that could not be
located, you might run into an issue with a patched version of ``zlib1.dll``
shipped by Intel, `as described here <https://github.com/msys2/MINGW-packages/issues/813>`_.
(Windows) OSError: dlopen() failed to load a library: pango?
------------------------------------------------------------

To resolve this issue, you can copy ``zlib1.dll`` from the directory
provided for the Pango binaries to the directory Manim is installed to.
This should be fixed in Manim's latest version, update
using ``pip install --upgrade manim``.

For a more global solution (try at your own risk!), try renaming the
file ``zlib1.dll`` located at ``C:\Program Files\Intel\Wifi\bin`` to
something like ``zlib1.dll.bak`` -- and then try installing Manim again
(either using ``pip install manim`` or with Chocolatey). Ensure that
you are able to revert this name change in case you run into troubles
with your WiFi (we did not get any reports about such a problem, however).


Some letters are missing from TextMobject/TexMobject output?
Expand Down
Loading

0 comments on commit 99c79e9

Please sign in to comment.