OnInit¶
Qualified name: algan.animation\_timeline.animation\_contexts.OnInit
- class OnInit(func, **kwargs)[source]¶
Bases:
AnimationContextRun a function over every Mob constructed inside the block.
A hook for applying the same setup to a batch of Mobs without repeating it – a shared material, a starting position, a shader.
- Parameters:
func – Callable taking one Mob, called as each Mob inside the block is constructed.
**kwargs (Any) – Passed to
AnimationContext.
Examples
with OnInit(lambda mob: mob.set_material(MeshStandardMaterial())): shapes = [Sphere() for _ in range(3)]
Methods
Apply this context's function to a newly constructed Mob.
Attributes
animation_managerchild_contextscombine_easingcomposed_easingcurrent_timeWhere the authoring cursor sits within this context, in seconds.
easingend_timeThe furthest time anything recorded in this context reaches, in seconds.
equalize_runtimesfinishedkwargslag_rationew_animationnew_mobsprev_contextpriority_levelrecord_attr_modificationsrecord_funcsruntimeruntime_per_partspawn_at_end