ManimCommunity / ManimCommunity/manim

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

Open
#2,965 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
40.9k
Forks
3.1k
Avg merge
3d 12h
Merged PRs (30d)
25

Description

## 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

```py
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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing MovingCameraScene and the OpenGLCamera entry points involved when self.camera.frame is accessed. Compare the OpenGL camera behavior with the Cairo camera implementation, then reproduce the example and verify that a camera frame is available and supports save_state() under OpenGL.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.