mirror of
https://github.com/3b1b/manim.git
synced 2025-08-03 04:04:36 +08:00
Kill config in update.py
This commit is contained in:
@ -16,24 +16,35 @@ class UpdateFromFunc(Animation):
|
||||
to be used when the state of one mobject is dependent
|
||||
on another simultaneously animated mobject
|
||||
"""
|
||||
CONFIG = {
|
||||
"suspend_mobject_updating": False,
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
mobject: Mobject,
|
||||
update_function: Callable[[Mobject]],
|
||||
update_function: Callable[[Mobject], Mobject | None],
|
||||
suspend_mobject_updating: bool = False,
|
||||
**kwargs
|
||||
):
|
||||
self.update_function = update_function
|
||||
super().__init__(mobject, **kwargs)
|
||||
super().__init__(
|
||||
mobject,
|
||||
suspend_mobject_updating=suspend_mobject_updating,
|
||||
**kwargs
|
||||
)
|
||||
|
||||
def interpolate_mobject(self, alpha: float) -> None:
|
||||
self.update_function(self.mobject)
|
||||
|
||||
|
||||
class UpdateFromAlphaFunc(UpdateFromFunc):
|
||||
class UpdateFromAlphaFunc(Animation):
|
||||
def __init__(
|
||||
self,
|
||||
mobject: Mobject,
|
||||
update_function: Callable[[Mobject, float], Mobject | None],
|
||||
suspend_mobject_updating: bool = False,
|
||||
**kwargs
|
||||
):
|
||||
self.update_function = update_function
|
||||
super().__init__(mobject, suspend_mobject_updating=suspend_mobject_updating, **kwargs)
|
||||
|
||||
def interpolate_mobject(self, alpha: float) -> None:
|
||||
self.update_function(self.mobject, alpha)
|
||||
|
||||
|
Reference in New Issue
Block a user