Skip to content

Commit

Permalink
Copy uniform arrays in Mobject.copy
Browse files Browse the repository at this point in the history
  • Loading branch information
3b1b committed Oct 3, 2021
1 parent b4132e3 commit 9483f26
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion manimlib/mobject/mobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,10 @@ def copy(self):
for key in self.data:
copy_mobject.data[key] = self.data[key].copy()

# TODO, are uniforms ever numpy arrays?
copy_mobject.uniforms = dict(self.uniforms)
for key in self.uniforms:
if isinstance(self.uniforms[key], np.ndarray):
copy_mobject.uniforms[key] = self.uniforms[key].copy()

copy_mobject.submobjects = []
copy_mobject.add(*[sm.copy() for sm in self.submobjects])
Expand Down

0 comments on commit 9483f26

Please sign in to comment.