manim icon indicating copy to clipboard operation
manim copied to clipboard

OpenGL - Cairo discrepancy: AttributeError: 'OpenGLCamera' object has no attribute 'frame'

Open kleinesfilmroellchen opened this issue 3 years ago • 4 comments

Description of bug / unexpected behavior

Even in a MovingCameraScene, there is no camera frame when rendering with OpenGL.

Expected behavior

A camera frame object just like in Cairo should exist.

How to reproduce the issue

Code for reproducing the problem
class LinearPredictiveCoding(MovingCameraScene):
    def construct(self):
        self.camera.frame.save_state()

Logs

Terminal output
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ Python\Python310\lib\site-packages\manim\cli\render\commands.py:103 in render                    │
│                                                                                                  │
│   101 │   │   │   │   │   with tempconfig(config):                                               │
│   102 │   │   │   │   │   │   scene = SceneClass(renderer)                                       │
│ ❱ 103 │   │   │   │   │   │   rerun = scene.render()                                             │
│   104 │   │   │   │   │   if rerun or config["write_all"]:                                       │
│   105 │   │   │   │   │   │   renderer.num_plays = 0                                             │
│   106 │   │   │   │   │   │   continue                                                           │
│                                                                                                  │
│ Python\Python310\lib\site-packages\manim\scene\scene.py:222 in render                            │
│                                                                                                  │
│    219 │   │   """                                                                               │
│    220 │   │   self.setup()                                                                      │
│    221 │   │   try:                                                                              │
│ ❱  222 │   │   │   self.construct()                                                              │
│    223 │   │   except EndSceneEarlyException:                                                    │
│    224 │   │   │   pass                                                                          │
│    225 │   │   except RerunSceneException as e:                                                  │
│                                                                                                  │
│ some_file.py:7 in construct                                                                      │
│                                                                                                  │
│ ❱   7 │   │   self.camera.frame.save_state()                                                     │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'OpenGLCamera' object has no attribute 'frame'

Additional comments

I'm well aware that this might be a known not implemented feature, but I'm creating this bug so that it is documented.

kleinesfilmroellchen avatar Sep 26 '22 14:09 kleinesfilmroellchen

I had the same issue as well.

John98Zakaria avatar Oct 09 '22 15:10 John98Zakaria

this is expected, the opengl renderer does not support scenes other than Scene and ThreeDScene.

using the opengl renderer, the camera is itself a mobject, hence every Scene could be a MovingCameraScene. you should be able to do self.camera.save_state()

icedcoffeeee avatar Oct 10 '22 07:10 icedcoffeeee

That is however another problematic discrepancy if one renderer uses self.camera and one uses self.camera.frame.

kleinesfilmroellchen avatar Oct 14 '22 14:10 kleinesfilmroellchen

any update on this issue was there a solution ?

MarkNwilliam avatar Sep 08 '25 22:09 MarkNwilliam