mirror of
https://github.com/3b1b/manim.git
synced 2025-09-01 00:48:45 +00:00
Added Mobject.shuffle_submobjects
This commit is contained in:
parent
71400a3941
commit
28362f1547
1 changed files with 7 additions and 0 deletions
|
@ -5,6 +5,7 @@ import itertools as it
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import operator as op
|
import operator as op
|
||||||
import os
|
import os
|
||||||
|
import random
|
||||||
|
|
||||||
from colour import Color
|
from colour import Color
|
||||||
|
|
||||||
|
@ -798,6 +799,12 @@ class Mobject(Container):
|
||||||
)
|
)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
def shuffle_submobjects(self, recursive=False):
|
||||||
|
if recursive:
|
||||||
|
for submob in self.submobjects:
|
||||||
|
submob.shuffle_submobjects(recursive=True)
|
||||||
|
random.shuffle(self.submobjects)
|
||||||
|
|
||||||
def print_submobject_family(self, n_tabs=0):
|
def print_submobject_family(self, n_tabs=0):
|
||||||
"""For debugging purposes"""
|
"""For debugging purposes"""
|
||||||
print "\t" * n_tabs, self, id(self)
|
print "\t" * n_tabs, self, id(self)
|
||||||
|
|
Loading…
Add table
Reference in a new issue