mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +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.locked_data_keys: set[str] = set()
|
||||||
self.needs_new_bounding_box: bool = True
|
self.needs_new_bounding_box: bool = True
|
||||||
self._is_animating: bool = False
|
self._is_animating: bool = False
|
||||||
self.interaction_allowed: bool = False
|
|
||||||
self.saved_state = None
|
self.saved_state = None
|
||||||
self.target = None
|
self.target = None
|
||||||
|
|
||||||
|
@ -495,7 +494,7 @@ class Mobject(object):
|
||||||
if deep:
|
if deep:
|
||||||
try:
|
try:
|
||||||
# Often faster than deepcopy
|
# Often faster than deepcopy
|
||||||
return pickle.loads(self.serialize())
|
return pickle.loads(pickle.dumps(self))
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
return copy.deepcopy(self)
|
return copy.deepcopy(self)
|
||||||
|
|
||||||
|
@ -696,21 +695,13 @@ class Mobject(object):
|
||||||
# Check if mark as static or not for camera
|
# Check if mark as static or not for camera
|
||||||
|
|
||||||
def is_changing(self) -> bool:
|
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:
|
def set_animating_status(self, is_animating: bool, recurse: bool = True) -> None:
|
||||||
for mob in self.get_family(recurse):
|
for mob in self.get_family(recurse):
|
||||||
mob._is_animating = is_animating
|
mob._is_animating = is_animating
|
||||||
return self
|
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
|
# Transforming operations
|
||||||
|
|
||||||
def shift(self, vector: np.ndarray):
|
def shift(self, vector: np.ndarray):
|
||||||
|
|
Loading…
Add table
Reference in a new issue