Skip to content

animation_override not supported by OpenGLMobject #2446

@hydrobeam

Description

@hydrobeam

Description of bug / unexpected behavior

Unlike Mobject, OpenGLMobject does not have the decorators required to make this feature work, introduced by #1422 :
https://github.com/ManimCommunity/manim/blob/main/manim/mobject/mobject.py#L107-L176

here's the doc link for the feature if you're unaware of its purpose.

Expected behavior

Animation being overwritten.

How to reproduce the issue

class MySquare(Square):
    @override_animation(FadeIn)
    def _fade_in_override(self, **kwargs):
        return Create(self, **kwargs)

class OverrideAnimationExample(Scene):
    def construct(self):
        self.play(FadeIn(MySquare()))

Running the code in the doc link simply plays FadeIn, when it should be playing Create.
Simply copying over mobject.py code to opengl_mobject.py does not affect the outcome.

Additional comments

I don't really understand the purpose of this feature, since overriding an existing animation doesn't seem like it makes sense when you could simply define a new one. Instead of redefining Create for a custom animation, it would make more sense to have the animation be a method of the mobject, as was done for Table, via Table.create.

So, I don't think it's worth investigating the issue to try to bring it over.

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue:bugSomething isn't working... For use in issuesopenglConcerning the OpenGL renderer.

    Type

    No type

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions