mirror of
https://github.com/3b1b/manim.git
synced 2025-11-14 04:57:46 +00:00
Removed the option for displaying to excluse submobjects
This commit is contained in:
parent
1609be6d49
commit
40c8b7db76
4 changed files with 18 additions and 20 deletions
|
|
@ -198,17 +198,13 @@ class Camera(object):
|
|||
return self
|
||||
|
||||
###
|
||||
def get_mobjects_to_display(
|
||||
self, mobjects,
|
||||
include_submobjects=True,
|
||||
excluded_mobjects=None):
|
||||
if include_submobjects:
|
||||
mobjects = extract_mobject_family_members(
|
||||
mobjects, only_those_with_points=True,
|
||||
)
|
||||
if excluded_mobjects:
|
||||
all_excluded = extract_mobject_family_members(excluded_mobjects)
|
||||
mobjects = list_difference_update(mobjects, all_excluded)
|
||||
def get_mobjects_to_display(self, mobjects, excluded_mobjects=None):
|
||||
mobjects = extract_mobject_family_members(
|
||||
mobjects, only_those_with_points=True,
|
||||
)
|
||||
if excluded_mobjects:
|
||||
all_excluded = extract_mobject_family_members(excluded_mobjects)
|
||||
mobjects = list_difference_update(mobjects, all_excluded)
|
||||
return mobjects
|
||||
|
||||
def is_in_frame(self, mobject):
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ class MappingCamera(Camera):
|
|||
mobject.insert_n_curves(self.min_num_curves)
|
||||
Camera.capture_mobjects(
|
||||
self, mobject_copies,
|
||||
include_submobjects=False,
|
||||
excluded_mobjects=None,
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
from manimlib.camera.moving_camera import MovingCamera
|
||||
from manimlib.scene.scene import Scene
|
||||
from manimlib.utils.iterables import list_update
|
||||
from manimlib.utils.family_ops import extract_mobject_family_members
|
||||
|
||||
|
||||
class MovingCameraScene(Scene):
|
||||
|
|
@ -18,7 +19,7 @@ class MovingCameraScene(Scene):
|
|||
|
||||
def get_moving_mobjects(self, *animations):
|
||||
moving_mobjects = Scene.get_moving_mobjects(self, *animations)
|
||||
all_moving_mobjects = self.camera.extract_mobject_family_members(
|
||||
all_moving_mobjects = extract_mobject_family_members(
|
||||
moving_mobjects
|
||||
)
|
||||
movement_indicators = self.camera.get_mobjects_indicating_movement()
|
||||
|
|
|
|||
|
|
@ -113,27 +113,29 @@ class Scene(Container):
|
|||
def reset_camera(self):
|
||||
self.camera.reset()
|
||||
|
||||
def capture_mobjects_in_camera(self, mobjects, **kwargs):
|
||||
self.camera.capture_mobjects(mobjects, **kwargs)
|
||||
def capture_mobjects_in_camera(self, mobjects, excluded_mobjects=None):
|
||||
self.camera.capture_mobjects(mobjects, excluded_mobjects=excluded_mobjects)
|
||||
|
||||
def update_frame(
|
||||
self,
|
||||
mobjects=None,
|
||||
background=None,
|
||||
include_submobjects=True,
|
||||
ignore_skipping=True,
|
||||
**kwargs):
|
||||
ignore_skipping=False,
|
||||
excluded_mobjects=None):
|
||||
if self.skip_animations and not ignore_skipping:
|
||||
return
|
||||
# Default to displaying everything in self.mobjects
|
||||
if mobjects is None:
|
||||
mobjects = self.mobjects
|
||||
|
||||
if background is not None:
|
||||
self.set_camera_pixel_array(background)
|
||||
else:
|
||||
self.reset_camera()
|
||||
|
||||
kwargs["include_submobjects"] = include_submobjects
|
||||
self.capture_mobjects_in_camera(mobjects, **kwargs)
|
||||
self.capture_mobjects_in_camera(
|
||||
mobjects, excluded_mobjects=excluded_mobjects,
|
||||
)
|
||||
|
||||
def freeze_background(self):
|
||||
self.update_frame()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue