mirror of
https://github.com/3b1b/manim.git
synced 2025-09-19 04:41:56 +00:00
Nice to be able to have a random seed in the configuration of Scenes
This commit is contained in:
parent
81d201e983
commit
3b5dea9a75
1 changed files with 4 additions and 0 deletions
|
@ -33,6 +33,7 @@ class Scene(object):
|
|||
"output_directory" : MOVIE_DIR,
|
||||
"name" : None,
|
||||
"always_continually_update" : False,
|
||||
"random_seed" : None,
|
||||
}
|
||||
def __init__(self, **kwargs):
|
||||
digest_config(self, kwargs)
|
||||
|
@ -45,6 +46,9 @@ class Scene(object):
|
|||
self.shared_locals = {}
|
||||
if self.name is None:
|
||||
self.name = self.__class__.__name__
|
||||
if self.random_seed is not None:
|
||||
random.seed(self.random_seed)
|
||||
np.random.seed(self.random_seed)
|
||||
|
||||
self.setup()
|
||||
if self.write_to_movie:
|
||||
|
|
Loading…
Add table
Reference in a new issue