-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement reverse playback and ping-pong loop in AnimationPlayer and NodeAnimation #48332
Conversation
When you are ready for review can you squash the merge commits? |
374da57
to
e048e58
Compare
@fire Sure. I left a commit for other PRs to easily see, but I squashed it just now. |
Review from pouley said we wanted demos of more cases. |
Yes, I already understood that as of #41728, as I needed to test it for all track types. I will have a project file for testing later. |
d466928
to
488db24
Compare
488db24
to
979eda6
Compare
e89fded
to
9bea72c
Compare
9bea72c
to
6ac3b62
Compare
d529442
to
aa8ff80
Compare
beab9df
to
32938d9
Compare
f4d1e18
to
c73906e
Compare
ae36b8c
to
d392e5b
Compare
47dfb03
to
5fd089f
Compare
f365491
to
3d2d5dd
Compare
3d2d5dd
to
2bb62c2
Compare
My feeling about this PR is that the implementation is very complex for something that is a very corner case. If it could be done in a way that it does not require modifying Animation and it could just be contained in AnimationPlayer and AnimationTree, it could be better. |
I see no other way to do this though, so I guess its ok. |
@@ -650,7 +650,7 @@ void AudioStreamSample::_bind_methods() { | |||
|
|||
BIND_ENUM_CONSTANT(LOOP_DISABLED); | |||
BIND_ENUM_CONSTANT(LOOP_FORWARD); | |||
BIND_ENUM_CONSTANT(LOOP_PING_PONG); | |||
BIND_ENUM_CONSTANT(LOOP_PINGPONG); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious is PINGPONG the more popular spelling compared to PING_PONG? Trying to avoid renames in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since @Chaosus 's implementation of the math function is pingpong()
, it is easy to see when mixed with other enumerated values, I decided to use pingpong()
, XXX_PINGPONG
, and pingponged
.
However, since I am not so particular about it, I can consider using XXX_PING_PONG
as the enumerated type and ping_pong()
as the math function.
Co-authored-by: Chaosus <[email protected]>
2bb62c2
to
372ba76
Compare
@akien-mga Could you give me a review when you have a time? |
Thanks! |
I sincerely apologize I had to revert this PR. I am refactoring large part of animation playback code (#53689) and this PR gets in the way. Please wait a couple of days until I am done with my changes to the animation system and attempt a PR against the new code. |
For this proposal:
https://www.youtube.com/watch?v=mBOkTA4_HZE
Note:
This PR contains two PRs haven't merged as a prerequisite. One of them has been rejected in the past because its use was unclear, but this PR will require it. If you want to do the merge in stages, I recommend that you start with those PRs merges.
Note2:
One problem is that if the
TimeScale
is set to negative, it is not possible to tell when the animation is finished. This can be solved by using theBackward
option inNodeAnimation
itself.For example, if you set
this won't work as playing through backward animation (but if you want to temporarily reverse the animation, this is correct).
If you set
these will work fine.