diff --git a/manim/mobject/opengl/opengl_mobject.py b/manim/mobject/opengl/opengl_mobject.py index 6428995cd5..e9459fd332 100644 --- a/manim/mobject/opengl/opengl_mobject.py +++ b/manim/mobject/opengl/opengl_mobject.py @@ -2481,6 +2481,15 @@ def align_data(self, mobject: OpenGLMobject) -> Self: for key in mob1.data.keys() & mob2.data.keys(): if key == "points": continue + + # here we fixe the case when some transform function make the whole thing crashes + # it appears that in some cases a float or int is processed as an array so here change it with an ndarray of a single number + # that make the whole thing process correctly + if type(mob1.data[key]) == float or type(mob1.data[key]) == int: + mob1.data[key] = np.array([mob1.data[key]]) + if type(mob2.data[key]) == float or type(mob2.data[key]) == int: + mob2.data[key] = np.array([mob2.data[key]]) + arr1 = mob1.data[key] arr2 = mob2.data[key] if len(arr2) > len(arr1):