"""Animations that update mobjects."""from__future__importannotations__all__=["UpdateFromFunc","UpdateFromAlphaFunc","MaintainPositionRelativeTo"]importoperatorasopimporttypingfrommanim.animation.animationimportAnimationiftyping.TYPE_CHECKING:frommanim.mobject.mobjectimportMobject
[docs]classUpdateFromFunc(Animation):""" update_function of the form func(mobject), presumably to be used when the state of one mobject is dependent on another simultaneously animated mobject """def__init__(self,mobject:Mobject,update_function:typing.Callable[[Mobject],typing.Any],suspend_mobject_updating:bool=False,**kwargs,)->None:self.update_function=update_functionsuper().__init__(mobject,suspend_mobject_updating=suspend_mobject_updating,**kwargs)