Skip to content

Implement metaclass approach in geometry module to make mobjects compatible with cairo and opengl rendering #1272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 45 commits into from
May 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
4a10c5b
proof of concept: make Polygon compatible with cairo and opengl
behackl Apr 6, 2021
90b12e2
Merge remote-tracking branch 'origin/master' into opengl-metaclass
behackl Apr 9, 2021
9e7fb9b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 9, 2021
28892db
make match_style methods compatible w.r.t. signature
behackl Apr 10, 2021
b10ee8c
super() calls in geometry.py + VMobject --> metaclass MetaVMobject
behackl Apr 10, 2021
f80cf0e
minor opengl-adjustments to Line
behackl Apr 10, 2021
e589ea9
fix inheritance problem of Angle
behackl Apr 10, 2021
3551c99
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 10, 2021
01d666a
get_first_handle and get_last_handle compatibility
behackl Apr 16, 2021
7cf3eda
further compatibility changes
behackl Apr 16, 2021
17577fc
black
behackl Apr 16, 2021
7491b67
Merge remote-tracking branch 'origin/master' into opengl-metaclass
behackl Apr 16, 2021
1e4811c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 16, 2021
0704149
Merge branch 'master' into opengl-metaclass
behackl May 12, 2021
03c2634
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 12, 2021
9bb0df9
allow webgl renderer as well
behackl May 12, 2021
3b2e057
make Arc compatible with OpenGL
behackl May 12, 2021
ca1396d
fix ArcBetweenPoints
behackl May 12, 2021
21ea04e
make Arrow compatible
behackl May 12, 2021
176c7d0
np.linalg.dot --> np.dot
behackl May 12, 2021
04cc582
make Cutout compatible
behackl May 12, 2021
b878a41
make ArcPolygon compatible
behackl May 12, 2021
6cbcb1f
make CubicBezier compatible
behackl May 12, 2021
df4078c
change MovingAngle example
behackl May 12, 2021
9c1d9b4
make DoubleArrow etc. compatible
behackl May 12, 2021
282cf5c
make Annulus compatible
behackl May 12, 2021
f88db8a
Merge branch 'opengl-metaclass' of github.com:behackl/manim into open…
behackl May 12, 2021
cb2449d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 12, 2021
bb8ab38
fix FilledAngle example
behackl May 12, 2021
23902b4
Merge branch 'opengl-metaclass' of github.com:behackl/manim into open…
behackl May 12, 2021
f3b93a2
one more angle example
behackl May 12, 2021
b80e6b3
deal with DashedVMobject in a better way
behackl May 12, 2021
7a04813
Apply suggestions from code review
behackl May 12, 2021
ca09383
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 12, 2021
75950e9
set_points_as_corners in Polygon.__init__
behackl May 12, 2021
5dd0a80
Merge branch 'opengl-metaclass' of github.com:behackl/manim into open…
behackl May 12, 2021
15d42a3
change implementation of MetaVMobject using __new__ + parse renderer …
behackl May 13, 2021
8c37a33
ignore flake8 for __init__.py
behackl May 13, 2021
453663c
improve implementation of Angle again, set points of mobject directly…
behackl May 13, 2021
4ebe3df
(ind, arg) --> (i, arg)
behackl May 13, 2021
9cfdc3f
respect --use_webgl_renderer and --use_opengl_renderer
behackl May 13, 2021
6726ffd
Various style improvements from code review
behackl May 13, 2021
f95660c
Merge remote-tracking branch 'origin/master' into opengl-metaclass
behackl May 13, 2021
ba8f87b
Merge branch 'opengl-metaclass' of github.com:behackl/manim into open…
behackl May 13, 2021
6e97ae7
Merge branch 'master' into opengl-metaclass
behackl May 14, 2021
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
22 changes: 22 additions & 0 deletions manim/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env python

# flake8: noqa

try:
import importlib.metadata as importlib_metadata
except ModuleNotFoundError:
Expand All @@ -8,9 +10,29 @@
__version__ = importlib_metadata.version(__name__)


import sys

# Importing the config module should be the first thing we do, since other
# modules depend on the global config dict for initialization.
from ._config import *

# Workaround to set the renderer passed via CLI args *before* importing
# Manim's classes (as long as the metaclass approach for switching
# between OpenGL and cairo rendering is in place, classes depend
# on the value of config.renderer).
for i, arg in enumerate(sys.argv):
if arg.startswith("--renderer"):
if "=" in arg:
_, parsed_renderer = arg.split("=")
else:
parsed_renderer = sys.argv[i + 1]
config.renderer = parsed_renderer
elif arg == "--use_opengl_renderer":
config.renderer = "opengl"
elif arg == "--use_webgl_renderer":
config.renderer = "webgl"


from .animation.animation import *
from .animation.composition import *
from .animation.creation import *
Expand Down
Loading