From c74cfa3c5d3486bcfaf76a544b7b6888c757f74b Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Sun, 15 Dec 2019 08:44:57 -0800 Subject: [PATCH] Add error message for ApplyFunction --- manimlib/animation/transform.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/manimlib/animation/transform.py b/manimlib/animation/transform.py index 32871c03..ef07090c 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):