ManimCommunity / ManimCommunity/manim
OpenGL - Cairo discrepancy: AttributeError: 'OpenGLCamera' object has no attribute 'frame'
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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