Skip to content
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

run_time=tracker.time_until_bookmark("A") not working correctly with custom manim animations? #98

Open
Toughbook-CFC2 opened this issue Oct 9, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Toughbook-CFC2
Copy link

class breathe(Animation):
    def __init__(self, mobject, cycles=1, size_factor=1.3, **kwargs):
        self.cycles = max(1, int(cycles))
        self.sizefactor = max(1, size_factor)
        self.OGscale = 1
        super().__init__(mobject, **kwargs)

    def interpolate_mobject(self, alpha):

#        if alpha < 4/10:
#            scale_factor = (1 + (self.sizefactor - 1) * alpha * 10/4)
#        elif alpha >= 4/10: 
#            scale_factor = (self.sizefactor - (self.sizefactor - 1) * (alpha - 4/10) * 10/6)

        self.mobject.shift(LEFT * alpha)

#        self.mobject.scale(scale_factor / self.OGscale)
#        self.OGscale = scale_factor

I wrote a custom animation that would scale a mobject up and then down again, to give it
some kind of breathing motion. The custom animation doesn't seem to stick to the timing of the
bookmark I put into the Text.
Even if I strip down the interpolation to one simple line like this, it
doesn't work and it always overshoots the point of the bookmark in the text.

If I use one of the standard
manim animations like Write it works as intended, an when I put a number into run_time like 2 for
example, my animation works as well. But when I put the voiceover timing together with the custom
animation it breaks.
I think that there is some issue that need handling for building custom animations
to make them compatible with manim voiceover.

@Toughbook-CFC2 Toughbook-CFC2 added the bug Something isn't working label Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants