Skip to content

[BUG-General] Updaters do not behave well with t values  #550

@huguesdevimeux

Description

@huguesdevimeux

Consider this scene :

RUN_TIME = 1


class Test(Scene):
    def construct(self):
        path = VMobject()
        dot = Dot()
        path.set_points_as_corners([dot.get_center(), dot.get_center()])
        def update_path(path):
            previus_path = path.copy()
            previus_path.add_points_as_corners([dot.get_center()])
            path.become(previus_path)
        path.add_updater(update_path)
        self.add(path, dot)
        self.play(Rotating(dot, radians=PI, about_point=RIGHT, run_time=RUN_TIME))
        self.play(dot.shift, UP)

Running normally (Rotating with RUN_TIME = 1, t values = 0,1/15,2/15 etc) :
Test

When changing RUN_TIME to 0.1. there is therefore way less t values, and :
Test
As you can see, it's not smooth at all.

When there is only one t = 1, (eg when rendering the last frame with -s ):
Test

as you can see, the updaters are updated only if there is a t value. Although this can be seen as the normal processus, it causes trouble, for example here, when scene-cacher skips an animation (the t value is directly set to the end). One gets this :

This happens as the first animation (Rotating) is cached so it uses a partial movie file instead of playing the animation. When the second animation is played the t value is directly set to 1, and manim is tricked into drawing a straight path, when there should be several points correponding to all the t values.

This is seemingly quite impossible to fix, as it would mean refactoring the whole t values thing, which .. is simple.

Related to #339

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue:bugSomething isn't working... For use in issues

    Type

    No type

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions