ManimCommunity / ManimCommunity/manim
Resetting the opacity of NumberLine numbers doesn't animate smoothly
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
Create a number line with numbers. Animate a change in the opacity of the numbers, accessed with ```NumberLine.numbers```. The opacity changes abruptly rather than smoothly.
Smooth opacity change can be obtained by putting the numbers in a VGroup, but then the axis disappears.
## Expected behavior
The opacity should change smoothly without removing the axis.
## How to reproduce the issue
Code for reproducing the problem
```py
from manim import *
class numberline(Scene):
def construct(self):
abrupt_opacity = Tex("Opacity changes abruptly:").shift(UP)
number_line = NumberLine(include_numbers = True)
self.add(abrupt_opacity, number_line)
self.wait(1)
self.play(
number_line.numbers.animate.set_fill(opacity = .2)
)
self.wait(1)
self.remove(abrupt_opacity, number_line)
self.wait(1)
axis_disappers = Tex("Axis disappears:").shift(UP)
number_line = NumberLine(include_numbers = True)
self.add(axis_disappers, number_line)
self.wait(1)
self.play(
VGroup(*number_line.numbers).animate.set_fill(opacity = .2)
)
self.wait(1)
```
## Additional media files
Images/GIFs
https://user-images.githubusercontent.com/4729700/213765636-60e75df1-f128-42eb-86f1-4461c3a253eb.mp4
## Logs
Terminal output
```
PASTE HERE OR PROVIDE LINK TO https://pastebin.com/ OR SIMILAR
```
## System specifications
System Details
- 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
```
LaTeX details
+ LaTeX distribution (e.g. TeX Live 2020):
+ Installed LaTeX packages:
FFMPEG
Output of `ffmpeg -version`:
```
PASTE HERE
```
## 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 running the provided reproduction and inspecting how NumberLine.numbers are represented and animated. Compare direct animation of number_line.numbers with animation of VGroup(*number_line.numbers); done means opacity changes smoothly while the axis remains visible.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100