Skip to content

Bug with substrings_to_isolate animation #2664

@sponege

Description

@sponege

Description of bug / unexpected behavior

I'm trying to animate an equation, I want to have it animate nicely with a new equation.

from
x^2 + y^2 = z^2
to
2x + 2y = 2z

Unfortunately, it doesn't even render anything else but an x in the first equation, not even the powers.

Expected behavior

I expected the number 2 (three twos that match up) to move, as well as the x, y, and z variables.
The number twos move when you give a substrings_to_isolate value of "2" instead of an array, it just acts a bit funky when you provide it with an array for some reason.

How to reproduce the issue

Code for reproducing the problem
class Scene(Scene):
    def construct(self):
        title = Tex(r"Implicit differentiation")
        eq = MathTex(r"x^2+y^2=z^2", substrings_to_isolate=["2","x","y","z"]) ##MathTex(r"\sum_{n=1}^\infty \frac{1}{n^2} = \frac{\pi^2}{6}")
        diffeq = MathTex(r"2x+2y=2z", substrings_to_isolate=["2","x","y","z"])
        VGroup(title, eq, diffeq).arrange(DOWN)
        self.play(
            Write(title),
            Write(eq),
        )
        self.wait()

        self.play(
            TransformMatchingTex(eq.copy(), diffeq)
        )

        self.wait()

Additional media files

Images/GIFs

substrings_to_isolate="2": https://cdn.discordapp.com/attachments/582403919754297363/904968054243487785/scriptoutput.mp4
substrings_to_isolate=["2","x","y","z"]: https://cdn.discordapp.com/attachments/582403919754297363/904968565923401778/scriptoutput.mp4

Logs

Terminal output
PASTE HERE OR PROVIDE LINK TO https://pastebin.com/ OR SIMILAR

System specifications

System Details

The videos I provided used the online Manim Discord bot, which rendered the two videos.

Additional comments

I wonder if substrings_to_isolate only supports one character rather than an array of characters?

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