ManimCommunity / ManimCommunity/manim
Remove the need to call self.add(self.camera) before adding an updater to the camera in opengl
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 40.9k
- Forks
- 3.1k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 25
Description
## Enhancement proposal
You currently need to write self.add(self.camera) to use self.camera with an updater. I propose that is removed as moving camera scene did no require that and makes the code more concise.
Example code:
```py
%%manim --write_to_movie --renderer=opengl -v WARNING -qm Example
class Example(Scene):
def construct(self):
self.add(self.camera)
d = Dot(fill_opacity=1).set_color(RED)
tr = ValueTracker(0)
self.add(d)
#Camera
self.camera.add_updater(lambda mob: mob.move_to([0,tr.get_value(),0]))
self.play(tr.animate.set_value(5),run_time=3)
```
## Additional comments
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 the OpenGL camera implementation and how camera updaters are registered when the camera is added to the scene. Reproduce the issue with the example in the report, then verify that the updater works without self.add(self.camera) while existing camera behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100