Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Fix animation group opengl compatibility (#2071)

Ryan McCauley1ba8bff1fd6d
diff --git a/manim/animation/animation.py b/manim/animation/animation.py
index 67ac6ed5f..2a6119c3b 100644
--- a/manim/animation/animation.py
+++ b/manim/animation/animation.py
@@ -131,8 +131,14 @@ class Animation:
self.remover: bool = remover
self.suspend_mobject_updating: bool = suspend_mobject_updating
self.lag_ratio: float = lag_ratio
- self.starting_mobject: Mobject = Mobject()
- self.mobject: Mobject = mobject if mobject is not None else Mobject()
+ if config["renderer"] == "opengl":
+ self.starting_mobject: OpenGLMobject = OpenGLMobject()
+ self.mobject: OpenGLMobject = (
+ mobject if mobject is not None else OpenGLMobject()
+ )
+ else:
+ self.starting_mobject: Mobject = Mobject()
+ self.mobject: Mobject = mobject if mobject is not None else Mobject()
if kwargs:
logger.debug("Animation received extra kwargs: %s", kwargs)