mirror of
https://github.com/3b1b/manim.git
synced 2025-04-13 09:47:07 +00:00
Remove Mobject.interaction_allowed, in favor of using _is_animating for multiple purposes
This commit is contained in:
parent
754316bf58
commit
f70e91348c
1 changed files with 2 additions and 11 deletions
|
@ -84,7 +84,6 @@ class Mobject(object):
|
|||
self.locked_data_keys: set[str] = set()
|
||||
self.needs_new_bounding_box: bool = True
|
||||
self._is_animating: bool = False
|
||||
self.interaction_allowed: bool = False
|
||||
self.saved_state = None
|
||||
self.target = None
|
||||
|
||||
|
@ -495,7 +494,7 @@ class Mobject(object):
|
|||
if deep:
|
||||
try:
|
||||
# Often faster than deepcopy
|
||||
return pickle.loads(self.serialize())
|
||||
return pickle.loads(pickle.dumps(self))
|
||||
except AttributeError:
|
||||
return copy.deepcopy(self)
|
||||
|
||||
|
@ -696,21 +695,13 @@ class Mobject(object):
|
|||
# Check if mark as static or not for camera
|
||||
|
||||
def is_changing(self) -> bool:
|
||||
return self._is_animating or self.has_updaters or self.interaction_allowed
|
||||
return self._is_animating or self.has_updaters
|
||||
|
||||
def set_animating_status(self, is_animating: bool, recurse: bool = True) -> None:
|
||||
for mob in self.get_family(recurse):
|
||||
mob._is_animating = is_animating
|
||||
return self
|
||||
|
||||
def allow_interaction(self, value: bool = True, recurse: bool = True) -> None:
|
||||
for mob in self.get_family(recurse):
|
||||
mob.interaction_allowed = value
|
||||
return self
|
||||
|
||||
def is_interaction_allowed(self) -> bool:
|
||||
return self.interaction_allowed
|
||||
|
||||
# Transforming operations
|
||||
|
||||
def shift(self, vector: np.ndarray):
|
||||
|
|
Loading…
Add table
Reference in a new issue