Skip to content

MLR119: MovingCameraScene under an OpenGL-target profile

qual reports MLR119 when a scene subclasses MovingCameraScene (a definite MovingCamera contract) while an active render profile targets the OpenGL renderer.

  • Default severity: error
  • Minimum confidence: high
  • Implementation phase: 4
  • Fix: none (suggests a Cairo-only profile)

Under OpenGL, Scene.__init__ builds OpenGLRenderer() and ignores the camera_class that MovingCameraScene configures, so self.camera is an OpenGLCamera without a .frame mobject (scene.py, opengl_renderer.py). Every self.camera.frame access — including MovingCameraScene.get_moving_mobjects itself — raises AttributeError. The knowledge profile curates this contract (renderer.opengl: false on the MovingCameraScene entry).

The diagnostic anchors at the MovingCameraScene base expression and its applicable_profiles lists the OpenGL profiles (DESIGN 15.8). It supersedes the generic MLR107 on that span. Scenes whose camera contract is Unknown (unresolvable mixin bases), indirect subclasses (the root class carries the finding), and Cairo-only runs stay silent.

Wrong (with an OpenGL profile active):

class CameraZoom(MovingCameraScene):
    def construct(self):
        self.play(self.camera.frame.animate.scale(0.5))

Right: render this scene with a Cairo-only profile, or use a plain Scene for OpenGL runs.