How to use the manimlib.utils.config_ops.digest_config function in manimlib

To help you get started, we’ve selected a few manimlib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github 3b1b / manim / manimlib / mobject / svg / drawings.py View on Github external
def __init__(self, clock, **kwargs):
        digest_config(self, kwargs)
        assert(isinstance(clock, Clock))
        rot_kwargs = {
            "axis": OUT,
            "about_point": clock.get_center()
        }
        hour_radians = -self.hours_passed * 2 * np.pi / 12
        self.hour_rotation = Rotating(
            clock.hour_hand,
            radians=hour_radians,
            **rot_kwargs
        )
        self.hour_rotation.begin()
        self.minute_rotation = Rotating(
            clock.minute_hand,
            radians=12 * hour_radians,
            **rot_kwargs
github 3b1b / manim / manimlib / mobject / geometry.py View on Github external
def __init__(self, start=LEFT, end=RIGHT, **kwargs):
        digest_config(self, kwargs)
        self.set_start_and_end_attrs(start, end)
        VMobject.__init__(self, **kwargs)
github Elteoremadebeethoven / MyAnimations / omega_creature / omega_creature_class.py View on Github external
def __init__(self, pi_creature, *content, **kwargs):
        digest_config(self, kwargs)
        bubble = pi_creature.get_bubble(
            *content,
            bubble_class=self.bubble_class,
            **self.bubble_kwargs
        )
        Group(bubble, bubble.content).shift_onto_screen()

        pi_creature.generate_target()
        pi_creature.target.change_mode(self.target_mode)
        if self.look_at_arg is not None:
            pi_creature.target.look_at(self.look_at_arg)

        change_mode = MoveToTarget(pi_creature, **self.change_mode_kwargs)
        bubble_creation = self.bubble_creation_class(
            bubble, **self.bubble_creation_kwargs
        )
github 3b1b / manim / manimlib / mobject / svg / svg_mobject.py View on Github external
def __init__(self, file_name=None, **kwargs):
        digest_config(self, kwargs)
        self.file_name = file_name or self.file_name
        self.ensure_valid_file()
        VMobject.__init__(self, **kwargs)
        self.move_into_position()
github 3b1b / manim / manimlib / continual_animation / continual_animation.py View on Github external
def __init__(self, mobject, **kwargs):
        mobject = instantiate(mobject)
        assert(isinstance(mobject, Mobject))
        digest_config(self, kwargs, locals())
        self.internal_time = 0
        self.external_time = 0
        self.setup()
        self.update(0)
github 3b1b / manim / manimlib / mobject / functions.py View on Github external
def __init__(self, function, **kwargs):
        digest_config(self, kwargs)
        self.parametric_function = \
            lambda t: np.array([t, function(t), 0])
        ParametricFunction.__init__(
            self,
            self.parametric_function,
            t_min=self.x_min,
            t_max=self.x_max,
            **kwargs
        )
        self.function = function
github 3b1b / manim / manimlib / animation / animation.py View on Github external
def __init__(self, mobject, **kwargs):
        assert(isinstance(mobject, Mobject))
        digest_config(self, kwargs)
        self.mobject = mobject
github 3b1b / manim / manimlib / mobject / types / point_cloud_mobject.py View on Github external
def __init__(self, **kwargs):
        digest_config(self, kwargs)
        self.epsilon = 1.0 / self.density
        Mobject.__init__(self, **kwargs)
github 3b1b / manim / manimlib / mobject / number_line.py View on Github external
def __init__(self, **kwargs):
        digest_config(self, kwargs)
        start = self.unit_size * self.x_min * RIGHT
        end = self.unit_size * self.x_max * RIGHT
        Line.__init__(self, start, end, **kwargs)
        self.shift(-self.number_to_point(self.number_at_center))

        self.init_leftmost_tick()
        if self.include_tip:
            self.add_tip()
        if self.include_ticks:
            self.add_tick_marks()
        if self.include_numbers:
            self.add_numbers()
github 3b1b / manim / manimlib / camera / mapping_camera.py View on Github external
def __init__(self, left_camera, right_camera, **kwargs):
        digest_config(self, kwargs)
        self.left_camera = left_camera
        self.right_camera = right_camera

        half_width = self.get_pixel_width() / 2
        for camera in [self.left_camera, self.right_camera]:
            # TODO: Round up on one if width is odd
            camera.reset_pixel_shape(camera.get_pixel_height(), half_width)

        OldMultiCamera.__init__(
            self,
            (left_camera, (0, 0)),
            (right_camera, (0, half_width)),
        )