mirror of
https://github.com/3b1b/manim.git
synced 2025-08-21 05:44:04 +00:00
Camera shouldn't try to display ValueTrackers
This commit is contained in:
parent
1bb952eab7
commit
35a59474fe
1 changed files with 13 additions and 10 deletions
|
@ -2,14 +2,10 @@
|
|||
import itertools as it
|
||||
import numpy as np
|
||||
import operator as op
|
||||
import copy
|
||||
|
||||
# import aggdraw
|
||||
import copy
|
||||
import time
|
||||
|
||||
from PIL import Image
|
||||
from colour import Color
|
||||
from scipy.spatial.distance import pdist
|
||||
import cairo
|
||||
|
||||
|
@ -18,6 +14,7 @@ from mobject.types.image_mobject import AbstractImageMobject
|
|||
from mobject.mobject import Mobject
|
||||
from mobject.types.point_cloud_mobject import PMobject
|
||||
from mobject.types.vectorized_mobject import VMobject
|
||||
from mobject.value_tracker import ValueTracker
|
||||
from utils.color import color_to_int_rgba
|
||||
from utils.color import rgb_to_hex
|
||||
from utils.config_ops import digest_config
|
||||
|
@ -203,7 +200,10 @@ class Camera(object):
|
|||
|
||||
####
|
||||
|
||||
def extract_mobject_family_members(self, mobjects, only_those_with_points=False):
|
||||
def extract_mobject_family_members(
|
||||
self, mobjects,
|
||||
only_those_with_points=False,
|
||||
ignore_value_trackers=False):
|
||||
if only_those_with_points:
|
||||
method = Mobject.family_members_with_points
|
||||
else:
|
||||
|
@ -213,17 +213,20 @@ class Camera(object):
|
|||
method(m)
|
||||
for m in mobjects
|
||||
if not (isinstance(m, VMobject) and m.is_subpath)
|
||||
if not (ignore_value_trackers and isinstance(m, ValueTracker))
|
||||
])
|
||||
))
|
||||
|
||||
def get_mobjects_to_display(
|
||||
self, mobjects,
|
||||
include_submobjects=True,
|
||||
excluded_mobjects=None,
|
||||
):
|
||||
self, mobjects,
|
||||
include_submobjects=True,
|
||||
ignore_value_trackers=True,
|
||||
excluded_mobjects=None):
|
||||
if include_submobjects:
|
||||
mobjects = self.extract_mobject_family_members(
|
||||
mobjects, only_those_with_points=True
|
||||
mobjects,
|
||||
only_those_with_points=True,
|
||||
ignore_value_trackers=ignore_value_trackers,
|
||||
)
|
||||
if excluded_mobjects:
|
||||
all_excluded = self.extract_mobject_family_members(
|
||||
|
|
Loading…
Add table
Reference in a new issue