|
1 | 1 | """Basic canvas for animations."""
|
2 | 2 |
|
3 | 3 |
|
4 |
| -__all__ = ["Scene", "EndSceneEarlyException"] |
| 4 | +__all__ = ["Scene"] |
5 | 5 |
|
6 | 6 |
|
7 | 7 | import inspect
|
|
25 | 25 | from ..utils.hashing import get_hash_from_play_call, get_hash_from_wait_call
|
26 | 26 | from ..utils.family import extract_mobject_family_members
|
27 | 27 | from ..renderer.cairo_renderer import CairoRenderer
|
| 28 | +from ..utils.exceptions import EndSceneEarlyException |
28 | 29 |
|
29 | 30 |
|
30 | 31 | class Scene(Container):
|
@@ -732,22 +733,6 @@ def compile_method(state):
|
732 | 733 |
|
733 | 734 | return animations
|
734 | 735 |
|
735 |
| - def update_skipping_status(self): |
736 |
| - """ |
737 |
| - This method is used internally to check if the current |
738 |
| - animation needs to be skipped or not. It also checks if |
739 |
| - the number of animations that were played correspond to |
740 |
| - the number of animations that need to be played, and |
741 |
| - raises an EndSceneEarlyException if they don't correspond. |
742 |
| - """ |
743 |
| - if file_writer_config["from_animation_number"]: |
744 |
| - if self.num_plays < file_writer_config["from_animation_number"]: |
745 |
| - file_writer_config["skip_animations"] = True |
746 |
| - if file_writer_config["upto_animation_number"]: |
747 |
| - if self.num_plays > file_writer_config["upto_animation_number"]: |
748 |
| - file_writer_config["skip_animations"] = True |
749 |
| - raise EndSceneEarlyException() |
750 |
| - |
751 | 736 | def begin_animations(self, animations):
|
752 | 737 | """
|
753 | 738 | This method begins the list of animations that is passed,
|
@@ -821,7 +806,7 @@ def play(self, *args, **kwargs):
|
821 | 806 |
|
822 | 807 | def cached_play(self, *args, **kwargs):
|
823 | 808 | self.revert_to_original_skipping_status()
|
824 |
| - self.update_skipping_status() |
| 809 | + self.renderer.update_skipping_status() |
825 | 810 | animations = self.compile_play_args_to_animation_list(*args, **kwargs)
|
826 | 811 | self.add_mobjects_from_animations(animations)
|
827 | 812 | if file_writer_config["skip_animations"]:
|
@@ -1078,7 +1063,3 @@ def show_frame(self):
|
1078 | 1063 | """
|
1079 | 1064 | self.renderer.update_frame(ignore_skipping=True)
|
1080 | 1065 | self.camera.get_image().show()
|
1081 |
| - |
1082 |
| - |
1083 |
| -class EndSceneEarlyException(Exception): |
1084 |
| - pass |
0 commit comments