Repository: ManimCommunity/manim

Issue:
`FadeIn` a `Line` when using OpenGL crashes
Consider the following code:

```python
from manim import *

class Test(Scene):
    def construct(self):
        line = Line()
        self.play(FadeIn(line))
```

When running this with `--renderer opengl`, I get this error:

```
Traceback (most recent call last):
╭──────────────────────────────────────────────────────────────────────────────────────╮
│ File "/home/sudgy/.local/lib/python3.9/site-packages/manim/cli/render/commands.py",  │
│line 108, in render                                                                   │
│    105             while keep_running:                                               │
│    106                 for SceneClass in scene_classes_from_file(file):              │
│    107                     scene = SceneClass(renderer)                              │
│  ❱ 108                     status = scene.render()                                   │
│    109                     if status:                                                │
│    110                         continue                                              │
│    111                     else:                                                     │
│ File "/home/sudgy/.local/lib/python3.9/site-packages/manim/scene/scene.py", line 215,│
│in render                                                                             │
│     212         """                                                                  │
│     213         self.setup()                                                         │
│     214         try:                                                                 │
│  ❱  215             self.construct()                                                 │
│     216         except EndSceneEarlyException:                                       │
│     217             pass                                                             │
│     218         except RerunSceneException as e:                                     │
│ File "test.py", line 6, in construct                                                 │
│    3 class Test(Scene):                                                              │
│    4     def construct(self):                                                        │
│    5         line = Line()                                                           │
│  ❱ 6         self.play(FadeIn(line))                                                 │
│ File "/home/sudgy/.local/lib/python3.9/site-packages/manim/scene/scene.py", line 877,│
│in play                                                                               │
│     874             return np.max([animation.run_time for animation in animations])  │
│     875                                                                              │
│     876     def play(self, *args, **kwargs):                                         │
│  ❱  877         self.renderer.play(self, *args, **kwargs)                            │
│     878                                                                              │
│     879     def wait(self, duration=DEFAULT_WAIT_TIME, stop_condition=None):         │
│     880         self.play(Wait(run_time=duration, stop_condition=stop_condition))    │
│ File "/home/sudgy/.local/lib/python3.9/site-packages/manim/utils/caching.py", line   │
│58, in wrapper                                                                        │
│    55             "List of the first few animation hashes of the scene: %(h)s",      │
│    56             {"h": str(self.animations_hashes[:5])},                            │
│    57         )                                                                      │
│  ❱ 58         func(self, scene, *args, **kwargs)                                     │
│    59                                                                                │
│    60     return wrapper                                                             │
│ File                                                                                 │
│"/home/sudgy/.local/lib/python3.9/site-packages/manim/renderer/cairo_renderer.py",    │
│line 46, in wrapper                                                                   │
│     43     def wrapper(self, scene, *args, **kwargs):                                │
│     44         self.animation_start_time = time.time()                               │
│     45         self.file_writer.begin_animation(not self.skip_animations)            │
│  ❱  46         func(self, scene, *args, **kwargs)                                    │
│     47         self.file_writer.end_animation(not self.skip_animations)              │
│     48         self.num_plays += 1                                                   │
│     49                                                                               │
│ File                                                                                 │
│"/home/sudgy/.local/lib/python3.9/site-packages/manim/renderer/opengl_renderer.py",   │
│line 391, in play                                                                     │
│    388     def play(self, scene, *args, **kwargs):                                   │
│    389         # TODO: Handle data locking / unlocking.                              │
│    390         if scene.compile_animation_data(*args, **kwargs):                     │
│  ❱ 391             scene.begin_animations()                                          │
│    392             scene.play_internal()                                             │
│    393                                                                               │
│    394     def clear_screen(self):                                                   │
│ File "/home/sudgy/.local/lib/python3.9/site-packages/manim/scene/scene.py", line 950,│
│in begin_animations                                                                   │
│     947     def begin_animations(self) -> None:                                      │
│     948         """Start the animations of the scene."""                             │
│     949         for animation in self.animations:                                    │
│  ❱  950             animation.begin()                                                │
│     951                                                                              │
│     952     def is_current_animation_frozen_frame(self) -> bool:                     │
│     953         """Returns whether the current animation produces a static frame (gen│
│ File "/home/sudgy/.local/lib/python3.9/site-packages/manim/animation/transform.py",  │
│line 112, in begin                                                                    │
│    109             self.mobject.align_data_and_family(self.target_copy)              │
│    110         else:                                                                 │
│    111             self.mobject.align_data(self.target_copy)                         │
│  ❱ 112         super().begin()                                                       │
│    113                                                                               │
│    114     def create_target(self) -> Mobject:                                       │
│    115         # Has no meaningful effect here, but may be useful                    │
│ File "/home/sudgy/.local/lib/python3.9/site-packages/manim/animation/animation.py",  │
│line 169, in begin                                                                    │
│    166         method.                                                               │
│    167                                                                               │
│    168         """                                                                   │
│  ❱ 169         self.starting_mobject = self.create_starting_mobject()                │
│    170         if self.suspend_mobject_updating:                                     │
│    171             # All calls to self.mobject's internal updaters                   │
│    172             # during the animation, either from this Animation                │
│ File "/home/sudgy/.local/lib/python3.9/site-packages/manim/animation/fading.py", line│
│142, in create_starting_mobject                                                       │
│    139         return self.mobject                                                   │
│    140                                                                               │
│    141     def create_starting_mobject(self):                                        │
│  ❱ 142         return self._create_faded_mobject(fadeIn=True)                        │
│    143                                                                               │
│    144                                                                               │
│    145 class FadeOut(_Fade):                                                         │
│ File "/home/sudgy/.local/lib/python3.9/site-packages/manim/animation/fading.py", line│
│93, in _create_faded_mobject                                                          │
│     90             The faded, shifted and scaled copy of the mobject.                │
│     91         """                                                                   │
│     92         faded_mobject = self.mobject.copy()                                   │
│  ❱  93         faded_mobject.fade(1)                                                 │
│     94         direction_modifier = -1 if fadeIn and not self.point_target else 1    │
│     95         faded_mobject.shift(self.shift_vector * direction_modifier)           │
│     96         faded_mobject.scale(self.scale_factor)                                │
│ File "/home/sudgy/.local/lib/python3.9/site-packages/manim/mobject/types/opengl_vecto│
│rized_mobject.py", line 253, in fade                                                  │
│     250             opacity=factor * self.get_stroke_opacity(),                      │
│     251             recurse=False,                                                   │
│     252         )                                                                    │
│  ❱  253         super().fade(darkness, recurse)                                      │
│     254         return self                                                          │
│     255                                                                              │
│     256     def get_fill_colors(self):                                               │
│ File                                                                                 │
│"/home/sudgy/.local/lib/python3.9/site-packages/manim/mobject/opengl_mobject.py", line│
│1333, in fade                                                                         │
│    1330         return self                                                          │
│    1331                                                                              │
│    1332     def fade(self, darkness=0.5, recurse=True):                              │
│  ❱ 1333         self.set_opacity(1.0 - darkness, recurse=recurse)                    │
│    1334                                                                              │
│    1335     def get_gloss(self):                                                     │
│    1336         return self.gloss                                                    │
╰──────────────────────────────────────────────────────────────────────────────────────╯
TypeError: set_opacity() got an unexpected keyword argument 'recurse'
```

It seems that a function just doesn't have a parameter it's supposed to.


Discussion:

Resolving patch:
diff --git a/manim/mobject/geometry.py b/manim/mobject/geometry.py
--- a/manim/mobject/geometry.py
+++ b/manim/mobject/geometry.py
@@ -1088,15 +1088,6 @@ def set_angle(self, angle, about_point=None):
     def set_length(self, length):
         return self.scale(length / self.get_length())
 
-    def set_opacity(self, opacity, family=True):
-        # Overwrite default, which would set
-        # the fill opacity
-        self.set_stroke(opacity=opacity)
-        if family:
-            for sm in self.submobjects:
-                sm.set_opacity(opacity, family)
-        return self
-
 
 class DashedLine(Line):
     """A dashed :class:`Line`.


Test patch: