#4932·manim

Mobject.split() behaves differently between Cairo and OpenGL

Author: nikolajmunkCreated Aug 11, 2026Updated Aug 11, 2026

Description of bug / unexpected behavior

As mentioned in #4914, the behavior of split is different between the two types of Mobject. Here is the implementation of Mobject.split:

python
def split(self) -> list[Mobject]:
    result: list[Mobject] = [self] if len(self.points) > 0 else []
    return result + self.submobjects

and here is the implementation of OpenGLMobject.split:

python
def split(self) -> Sequence[OpenGLMobject]:
    return self.submobjects

In short, the Cairo version potentially includes the calling mobject itself if it has any points, and otherwise simply returns a copy of self.submobjects. The OpenGL version never includes the mobject itself and it doesn't copy self.submobjects but simply returns the list itself.

It seems like this difference has existed since OpenGLMobject was introduced in the library, and nothing has broken horribly, so probably this isn't a huge issue in Manim's own source code. It might confuse users who switch from one to the other, though.

Expected behavior

I expect both types of Mobject to behave identically. I don't know which is the correct behavior; the method has no docstring and I haven't been able to find a case where split is called on a mobject which both has 1) points and 2) submobjects, so it isn't clear to me how to find out.

How to reproduce the issue

Code for reproducing the problem
python
class SplitTest(Scene):
    def construct(self):
        mob = Circle().move_to((-2, 1, 0))
        mob.add(Square().move_to((0, 1, 0)))
        mob.add(Triangle().move_to((2, 1, 0)))
        self.add(mob)
        self.add(mob[:].copy().shift(DOWN * 2))

Additional media files

Images/GIFs

This is the output when rendering with Cairo: Cairo version

This is the output when rendering with OpenGL: OpenGL version

Logs

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

System specifications

System Details
  • OS (with version, e.g., Windows 10 v2004 or macOS 10.15 (Catalina)):
  • RAM:
  • Python version (python/py/python3 --version):
  • Installed modules (provide output from pip list):
PASTE HERE
LaTeX details
  • LaTeX distribution (e.g. TeX Live 2020):
  • Installed LaTeX packages:

Additional comments