You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and i changed method 'create_c_creatures()' in class TeacherStudentsScene in file c_creature_scene.py (renamed pi_creature_scene.py)
defcreate_c_creatures(self):
self.teacher=CCreature(color=self.teacher_color)
self.teacher.to_corner(DOWN+RIGHT)
self.teacher.look(DOWN+LEFT)
'''From that self.students = VGroup(*[ Randolph(color=c) for c in self.student_colors ]) '''# To thisprint("yessssss its runing, we are creating students.")
self.students=VGroup(*[
random.choice([PlusCreature,
MinusCreature,
MultiCreature,
DivCreature,
RemCreature,
AndCreature,
EqualCreature,
RoundBracketsCreature,
CurlyBracketsCreature,
SquareBracketsCreature,
AngleBracketsCreature,
HashCreature,
QuestionCreature])(color=c)
forcinself.student_colors
])
self.students.arrange(RIGHT)
self.students.scale(self.student_scale_factor)
self.students.to_corner(DOWN+LEFT)
self.teacher.look_at(self.students[-1].eyes)
forstudentinself.students:
student.look_at(self.teacher.eyes)
return [self.teacher] +list(self.students)
i created file manimlib.imports_with_c that imports c_creatures instead of pi_creatures
when i run following code ( i tried self.setup() and self.c_creatures = VGroup(*self.create_c_creatures()) but this lines just create another creatures onto previouse ones)
frommanimlib.imports_with_cimport*classts(TeacherStudentsScene):
defconstruct(self):
#self.setup()#self.c_creatures = VGroup(*self.create_c_creatures())self.teacher_says(
"Something different today!",
run_time=2
)
Output always shows same students with two EqualCreatures and one QuestionCreature even when rendering code again and again but according to changes in method 'create_c_creatures()' in class TeacherStudentsScene in file c_creature_scene.py it should be create random creatures everytimes i run the code
same output is following
it always print the output from line print("yessssss its runing, we are creating students.") in create_c_creatures() method that means it runs every time between multiple renders. this mean may be there is something wrong with random.choice() method
but i tried following code.
then whats wrong with my code ? why always same students ?
The text was updated successfully, but these errors were encountered:
NavpreetDevpuri
changed the title
Trying to randomize students creatures in TeacherStudentsScene but it shows same students every time i render
Trying to randomize students creatures in TeacherStudentsScene but it shows same students every time when i render
Apr 25, 2020
I created new creatures named
Creatures are looks like
and added this creatures to the file c_creature (renamed pi_creature) for example this one
and i changed method 'create_c_creatures()' in class TeacherStudentsScene in file c_creature_scene.py (renamed pi_creature_scene.py)
i created file manimlib.imports_with_c that imports c_creatures instead of pi_creatures
when i run following code ( i tried self.setup() and self.c_creatures = VGroup(*self.create_c_creatures()) but this lines just create another creatures onto previouse ones)
Output always shows same students with two EqualCreatures and one QuestionCreature even when rendering code again and again but according to changes in method 'create_c_creatures()' in class TeacherStudentsScene in file c_creature_scene.py it should be create random creatures everytimes i run the code
same output is following
it always print the output from line print("yessssss its runing, we are creating students.") in create_c_creatures() method that means it runs every time between multiple renders. this mean may be there is something wrong with random.choice() method
but i tried following code.
it allways print random numbers.
but when i put this code inside create_c_creatures() like follow
now it always shows same numbers.
then whats wrong with my code ? why always same students ?
The text was updated successfully, but these errors were encountered: