ManimCommunity / ManimCommunity/manim
Grouping VMobject and render with OpenGL works only with Cube()
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
I wonder if this is a bug or a missing feature. When I try to group 3D VMobjects and then render with OpenGL I get the following error
> TypeError: All submobjects must be of type VMobject
## Expected behavior
The rendering works fine with Cairo or when the VMobject I am rendering is a Cube(), while it does not work with any other surface.
## How to reproduce the issue
Code for reproducing the problem
```py
class MovingDots3(ThreeDScene):
def construct(self):
self.set_camera_orientation(phi=75 * DEGREES, theta=30 * DEGREES)
axes = ThreeDAxes()
self.add(axes)
dots_n = 10
# First initialize
x = 0
y = 0
z = 0
group_d = []
mov_range = 0.6
for i in range(0, dots_n):
x += np.random.uniform(-mov_range, mov_range)
y += np.random.uniform(-mov_range, mov_range)
z += np.random.uniform(-mov_range, mov_range)
# If instead of Dot3D I use Cube() it works properly
dot = Dot3D(radius=0.1).move_to([x, y, z])
group_d.append(dot)
anim_group = VGroup(*group_d)
self.add(anim_group)
self.add(axes)
```
When I manually remove the TypeError break the following error is:
> AttributeError: 'Dot3D' object has no attribute 'has_fill'
This makes me think the problem is linked to the way that the different surface properties are set for OpenGL rendering but I still do not understand why the problem is not there for Cube()
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 running the provided MovingDots3 reproduction with OpenGL, focusing on the Dot3D objects grouped in VGroup and comparing them with Cube(). Trace the grouping and OpenGL rendering entry points involved in the reported VMobject type check and has_fill error. Done means the reproduced group renders successfully with Dot3D and the existing Cairo and Cube() behavior remains working.
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