Skip to content

# Changes in camera.py to fix fixed frame option in 3D #281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions manim/camera/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ def extract_mobject_family_members(self, mobjects, only_those_with_points=False)
else:
method = Mobject.get_family
if self.use_z_index:
mobjects.sort(key=lambda m: m.z_index)
mobjects = sorted(mobjects, key=lambda m: m.z_index)
return remove_list_redundancies(list(it.chain(*[method(m) for m in mobjects])))

def get_mobjects_to_display(
Expand All @@ -439,7 +439,7 @@ def get_mobjects_to_display(
"""
if include_submobjects:
mobjects = self.extract_mobject_family_members(
mobjects, only_those_with_points=True,
mobjects, only_those_with_points=True
)
if excluded_mobjects:
all_excluded = self.extract_mobject_family_members(excluded_mobjects)
Expand Down Expand Up @@ -974,9 +974,7 @@ def overlay_rgba_array(self, pixel_array, new_array):
new_array : np.array
The new pixel array to overlay.
"""
self.overlay_PIL_image(
pixel_array, self.get_image(new_array),
)
self.overlay_PIL_image(pixel_array, self.get_image(new_array))

def overlay_PIL_image(self, pixel_array, image):
"""Overlays a PIL image on the passed pixel array.
Expand Down Expand Up @@ -1092,9 +1090,9 @@ def adjusted_thickness(self, thickness):
"""
# TODO: This seems...unsystematic
big_sum = op.add(
camera_config["default_pixel_height"], camera_config["default_pixel_width"],
camera_config["default_pixel_height"], camera_config["default_pixel_width"]
)
this_sum = op.add(self.get_pixel_height(), self.get_pixel_width(),)
this_sum = op.add(self.get_pixel_height(), self.get_pixel_width())
factor = fdiv(big_sum, this_sum)
return 1 + (thickness - 1) / factor

Expand Down