Closed huguesdevimeux closed 4 years ago
Paging @XorUnison, what do you think about this in terms of convenience?
From a user's perspective, it is strange to have specific functions for fading from one direction, but not from others. Even though I am too small a sample to be representative, I would prefer a generic function with the direction given as a parameter and a reasonable default.
I mean, there's also the factor that manim used to have this whole convoluted process of mixing animations. Now we can just do:
self.play(mobject.rotate,np.pi,
mobject.shift,DOWN)
And call it a day.
That's because manim can now mash and mix all properly coded methods of mobjects such as shift and rotate. Works with custom stuff too.
So what we should do is probably nuke those archaic methods, and instead add mobject.fade_out and mobject.fade_in. Then we can just go the much better way of:
self.play(mobject.fade_out,np.pi,
mobject.shift,DOWN)
And any other combination we may want.
(And FadeIn(mobject, direction = DOWN) , FadeOutAndShift(mobject, direction = DOWN) are equivalent)
This... however doesn't seem to be the case on my end? FadeIn is FadeIn for me, direction passed or not. I see no way for FadeIn to digest a direction into anything meaningful either.
Now we can just do:
Hol' up, have we fixed the multiple animations on one mobject issue already? On which PR?
Which issue exactly? I see no such open issue and this is currently possible in vanilla manim, and I've not been able to find any issues with it either. What's the problem?
Oh... I was thinking of the "bug" that doesn't let you do
self.play(Rotating(mobj), FadeIn(mobj))
(for e.g.)
Right, this has been a thing for a good long while, and I'm not even sure what the issue is, nor if it can and should be fixed. But as I said, the syntax I highlighted above does now work. But as far as I know it requires mobject.methods to work with.
So it seems that there's agreement on removing FadeInFromDown
and FadeOutAndShiftDown
and other similar methods.
Now, do we want to just nuke them or deprecate them (ie issue a DeprecationWarning for now and delete them later)?
I prefer the latter. It is always frustrating when stuff disappears without prior notice. If nobody else is currently on it, I might be able to prepare a PR to solve this issue.
@huguesdevimeux, or anyone else, are there any volunteers to write a PR that deprecates FadeInFromDown
, FadeOutAndShiftDown
, and other similar methods?
@PhilippImhof Feel free to submit a PR :)
@PhilippImhof Feel free to submit a PR :)
Haha, j'allais dire la même chose.... 😊 I'll have a look at it, but I 'm not sure whether I got all of it right.
but I 'm not sure whether I got all of it right.
That's what code reviews are for! Looking forward to your PR.
In my opinion they are completly useless since when
FadeInFrom
andFadeOutAndShift
are calleddirection = DOWN
is set by default.(And
FadeInFrom(mobject, direction = DOWN)
,FadeOutAndShift(mobject, direction = DOWN)
are equivalent)EDIT : I mixed up
FadeIn
andFadeInFrom
. I'm talking about the latter;FadeIn
is fine