3b1b / 3b1b/manim

Bugs about animation

Aperta
#1,722 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Python
Stelle
93.8k
Fork
7.7k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

### Describe the bug
The amination class `FadeTransformPieces` runs as expected when both source mobject and target mobject are groups of geometries (like squares and circles), or both are groups of Tex objects, but a problematic animation will pop out if the source and the target belongs to different categories.

**Code**:
```python
group_0 = Tex("A").replicate(3).arrange(RIGHT).shift(UP)
group_1 = Circle().replicate(2).arrange(RIGHT).shift(DOWN)
self.add(group_0)
self.play(FadeTransformPieces(group_0, group_1), run_time=3)
self.wait()
```

**Wrong display or Error traceback**:
https://user-images.githubusercontent.com/50232075/151685677-95d0c599-11eb-419f-bc1f-92d3e953e17e.mp4

### Describe the bug
Since `Arrow` class now applies a step function to `stroke_width` of a line to generate arrows, transforming them will cause errors. Similar problems also occur in other parameters like `color`, `opacity`.

**Code**:
```python
mob = Arrow()
# mob = Line().set_color([BLUE, RED])
# mob = Line().set_opacity(opacity=[0, 1])

dot = Dot()
self.add(mob)
self.wait()
self.play(Transform(mob, dot))
self.wait()
```

**Wrong display or Error traceback**:
```sh
Traceback (most recent call last):
File "D:\python\Scripts\manimgl-script.py", line 33, in
sys.exit(load_entry_point('manimgl', 'console_scripts', 'manimgl')())
File "e:\manimkindergarten\manim\manimlib\__main__.py", line 25, in main
scene.run()
File "e:\manimkindergarten\manim\manimlib\scene\scene.py", line 78, in run
self.construct()
File "svg_test.py", line 116, in construct
self.play(Transform(mob, dot))
File "e:\manimkindergarten\manim\manimlib\scene\scene.py", line 414, in wrapper
func(self, *args, **kwargs)
File "e:\manimkindergarten\manim\manimlib\scene\scene.py", line 475, in play
self.progress_through_animations(animations)
File "e:\manimkindergarten\manim\manimlib\scene\scene.py", line 454, in progress_through_animations
animation.interpolate(alpha)
File "e:\manimkindergarten\manim\manimlib\animation\animation.py", line 114, in interpolate
self.interpolate_mobject(self.rate_func(alpha))
File "e:\manimkindergarten\manim\manimlib\animation\animation.py", line 126, in interpolate_mobject
self.interpolate_submobject(*mobs, sub_alpha)
File "e:\manimkindergarten\manim\manimlib\animation\transform.py", line 105, in interpolate_submobject
submob.interpolate(start, target_copy, alpha, self.path_func)
File "e:\manimkindergarten\manim\manimlib\mobject\types\vectorized_mobject.py", line 773, in interpolate
super().interpolate(mobject1, mobject2, alpha, *args, **kwargs)
File "e:\manimkindergarten\manim\manimlib\mobject\mobject.py", line 1321, in interpolate
self.data[key][:] = func(
ValueError: could not broadcast input array from shape (6,1) into shape (24,1)
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.