Repository: ManimCommunity/manim

Issue:
Opengl -a flag not working with opengl
## Description of bug / unexpected behavior
<!-- Add a clear and concise description of the problem you encountered. -->

The behaviour of the -a flag is to output all scenes, however only a single scene is output when using the opengl renderer

## Expected behavior
<!-- Add a clear and concise description of what you expected to happen. -->

Expect all scenes to be previewed with the -p flag and output. I guess it is not applicable with interactive mode?

## How to reproduce the issue
<!-- Provide a piece of code illustrating the undesired behavior. -->

Run multple scenes with the `-a` flag and opengl renderer, for example `python -m manim example_scenes.py --renderer opengl -a -pql`

<details><summary>Code for reproducing the problem</summary>

```py
class SquareToCircle(Scene):
    def construct(self):
        circle = Circle()
        circle.set_fill(PINK, opacity=0.5)

        square = Square() 
        square.rotate(PI / 4)

        self.play(Create(square))
        self.play(Transform(square, circle))
        self.play(FadeOut(square))

class CircleToSquare(Scene):
    def construct(self):
        circle = Circle() 
        circle.set_fill(PINK, opacity=0.5)

        square = Square()
        square.rotate(PI / 4) 

        self.play(Create(circle)) 
        self.play(Transform(circle, square)) 
        self.play(FadeOut(circle)) 
```

</details>


## Additional media files
<!-- Paste in the files manim produced on rendering the code above. -->

<details><summary>Images/GIFs</summary>

<!-- PASTE MEDIA HERE -->

</details>


## Logs
<details><summary>Terminal output</summary>
<!-- Add "-v DEBUG" when calling manim to generate more detailed logs -->

```
PASTE HERE OR PROVIDE LINK TO https://pastebin.com/ OR SIMILAR
```

<!-- Insert screenshots here (only when absolutely necessary, we prefer copy/pasted output!) -->

</details>


## System specifications

<details><summary>System Details</summary>

- OS (with version, e.g Windows 10 v2004 or macOS 10.15 (Catalina)):
- RAM:
- Python version (`python/py/python3 --version`):
- Installed modules (provide output from `pip list`):
```
PASTE HERE
```
</details>

<details><summary>LaTeX details</summary>

+ LaTeX distribution (e.g. TeX Live 2020):
+ Installed LaTeX packages:
<!-- output of `tlmgr list --only-installed` for TeX Live or a screenshot of the Packages page for MikTeX -->
</details>

<details><summary>FFMPEG</summary>

Output of `ffmpeg -version`:

```
PASTE HERE
```
</details>

## Additional comments
<!-- Add further context that you think might be relevant for this issue here. -->



Discussion:

Resolving patch:
diff --git a/manim/cli/render/commands.py b/manim/cli/render/commands.py
--- a/manim/cli/render/commands.py
+++ b/manim/cli/render/commands.py
@@ -105,12 +105,16 @@ def __repr__(self):
             while keep_running:
                 for SceneClass in scene_classes_from_file(file):
                     scene = SceneClass(renderer)
-                    status = scene.render()
-                    if status:
+                    rerun = scene.render()
+                    if rerun or config["write_all"]:
+                        renderer.num_plays = 0
                         continue
                     else:
                         keep_running = False
                         break
+                if config["write_all"]:
+                    keep_running = False
+
         except Exception:
             error_console.print_exception()
             sys.exit(1)


Test patch: