Repository: ManimCommunity/manim

Issue:
Line3D has no attribute 'fill_color`
## Description of bug / unexpected behavior
<!-- Add a clear and concise description of the problem you encountered. -->
I tried to run the following with the latest main using the opengl renderer.
```py
class Test(Scene):
    def construct(self):
        a = Line3D()
        self.add(a)
        self.interactive_embed()
```
And an error pops out, `AttributeError: 'Line3D' object has no attribute 'fill_color'`
Full error log below.
## Expected behavior
<!-- Add a clear and concise description of what you expected to happen. -->


## How to reproduce the issue
<!-- Provide a piece of code illustrating the undesired behavior. -->

<details><summary>Code for reproducing the problem</summary>

```py
Paste your code here.
```

</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 -->

```
Manim Community v0.9.0

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ C:\Users\myname\GitHub\manim\manim\cli\render\commands.py: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:                                                                  │
│                                                                                                  │
│ C:\Users\myname\GitHub\manim\manim\scene\scene.py:215 in render                                 │
│                                                                                                  │
│    212 │   │   """                                                                               │
│    213 │   │   self.setup()                                                                      │
│    214 │   │   try:                                                                              │
│ ❱  215 │   │   │   self.construct()                                                              │
│    216 │   │   except EndSceneEarlyException:                                                    │
│    217 │   │   │   pass                                                                          │
│    218 │   │   except RerunSceneException as e:                                                  │
│                                                                                                  │
│ C:\Users\myname\GitHub\manim\bruh.py:21 in      │
│ construct                                                                                        │
│                                                                                                  │
│   18                                                                                             │
│   19 class Test(Scene):                                                                          │
│   20 │   def construct(self):                                                                    │
│ ❱ 21 │   │   a = Line3D()                                                                        │
│   22 │   │   self.add(a)                                                                         │
│   23 │   │   self.interactive_embed()                                                            │
│                                                                                                  │
│ C:\Users\myname\GitHub\manim\manim\mobject\three_dimensions.py:735 in __init__                  │
│                                                                                                  │
│   732 │                                                                                          │
│   733 │   def __init__(self, start=LEFT, end=RIGHT, thickness=0.02, color=None, **kwargs):       │
│   734 │   │   self.thickness = thickness                                                         │
│ ❱ 735 │   │   self.set_start_and_end_attrs(start, end, **kwargs)                                 │
│   736 │   │   if color is not None:                                                              │
│   737 │   │   │   self.set_color(color)                                                          │
│   738                                                                                            │
│                                                                                                  │
│ C:\Users\myname\GitHub\manim\manim\mobject\three_dimensions.py:754 in set_start_and_end_attrs   │
│                                                                                                  │
│   751 │   │   # start and end, if they're mobjects                                               │
│   752 │   │   self.start = self.pointify(start, self.direction)                                  │
│   753 │   │   self.end = self.pointify(end, -self.direction)                                     │
│ ❱ 754 │   │   super().__init__(                                                                  │
│   755 │   │   │   height=np.linalg.norm(self.vect),                                              │
│   756 │   │   │   radius=self.thickness,                                                         │
│   757 │   │   │   direction=self.direction,                                                      │
│                                                                                                  │
│ C:\Users\myname\GitHub\manim\manim\mobject\three_dimensions.py:629 in __init__                  │
│                                                                                                  │
│   626 │   │   │   **kwargs,                                                                      │
│   627 │   │   )                                                                                  │
│   628 │   │   if show_ends:                                                                      │
│ ❱ 629 │   │   │   self.add_bases()                                                               │
│   630 │   │   self._current_phi = 0                                                              │
│   631 │   │   self._current_theta = 0                                                            │
│   632 │   │   self.set_direction(direction)                                                      │
│                                                                                                  │
│ C:\Users\myname\GitHub\manim\manim\mobject\three_dimensions.py:652 in add_bases                 │
│                                                                                                  │
│   649 │   │   """Adds the end caps of the cylinder."""                                           │
│   650 │   │   self.base_top = Circle(                                                            │
│   651 │   │   │   radius=self.radius,                                                            │
│ ❱ 652 │   │   │   color=self.fill_color,                                                         │
│   653 │   │   │   fill_opacity=self.fill_opacity,                                                │
│   654 │   │   │   shade_in_3d=True,                                                              │
│   655 │   │   │   stroke_width=0,                                                                │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'Line3D' object has no attribute 'fill_color'
```

<!-- 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:
Think this might have been broken recently, I could only reproduce the error when I pulled from main
Yup, I stumbled on it while experimenting. I couldn't pin the exact problem though
@hydrobeam I think this might be related to the `OpenGLSurface` compatibility change, as the highest level of `fill_color` comes from `Surface` but it will use `OpenGLSurface` as a base that uses `rgbas` instead?

Resolving patch:
diff --git a/manim/mobject/three_dimensions.py b/manim/mobject/three_dimensions.py
--- a/manim/mobject/three_dimensions.py
+++ b/manim/mobject/three_dimensions.py
@@ -630,22 +630,26 @@ def func(self, u, v):
 
     def add_bases(self):
         """Adds the end caps of the cylinder."""
+        color = self.color if config["renderer"] == "opengl" else self.fill_color
+        opacity = self.opacity if config["renderer"] == "opengl" else self.fill_opacity
+        u_min = self.u_range[0] if config["renderer"] == "opengl" else self.u_min
+        u_max = self.u_range[1] if config["renderer"] == "opengl" else self.u_max
         self.base_top = Circle(
             radius=self.radius,
-            color=self.fill_color,
-            fill_opacity=self.fill_opacity,
+            color=color,
+            fill_opacity=opacity,
             shade_in_3d=True,
             stroke_width=0,
         )
-        self.base_top.shift(self.u_max * IN)
+        self.base_top.shift(u_max * IN)
         self.base_bottom = Circle(
             radius=self.radius,
-            color=self.fill_color,
-            fill_opacity=self.fill_opacity,
+            color=color,
+            fill_opacity=opacity,
             shade_in_3d=True,
             stroke_width=0,
         )
-        self.base_bottom.shift(self.u_min * IN)
+        self.base_bottom.shift(u_min * IN)
         self.add(self.base_top, self.base_bottom)
 
     def _rotate_to_direction(self):


Test patch: