Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Add error message for ApplyFunction

Grant Sandersonc74cfa3c5d34
diff --git a/manimlib/animation/transform.py b/manimlib/animation/transform.py
index 32871c03e..ef07090cf 100644
--- a/manimlib/animation/transform.py
+++ b/manimlib/animation/transform.py
@@ -230,7 +230,10 @@ class ApplyFunction(Transform):
super().__init__(mobject, **kwargs)
def create_target(self):
- return self.function(self.mobject.copy())
+ target = self.function(self.mobject.copy())
+ if not isinstance(target, Mobject):
+ raise Exception("Functions passed to ApplyFunction must return object of type Mobject")
+ return target
class ApplyMatrix(ApplyPointwiseFunction):