-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Add capture(real_t p_time)
function to AnimationMixer
#8513
Comments
A long standing ask from users is to create dynamic animations with the AnimationPlayer. If Capture Mode has been removed and needs to be completely reimplemented from scratch anyway, I wonder if this could be considered for implementation.
Usecases for this would be if I want to play an animation but want to mix dynamic content into the animation. For example a cut scene where I want Capture Mode like behaviour in the middle of an animation somewhere or the end. Capture Mode so far only covered this for the first "key" of the animation. There are other ways around that problem using tweens and extensive coding, but non of them provide the ease of use and the power of the AnimationPlayer of keying all kinds of properties visually on a timeline. |
It may be difficult to do immediately now, but with the implementation of the AnimationMixer, it should be a big step toward making that. There are PR/proposals to apply blend values to each track:
they should help specify the blend values for each track. I still don't know how to go about implementing to blend AnimationPlayer values with no animation playing scene values: It is easy to record the values for one frame only and blend them, such as using the However, if you always retrieve the values from the scene, you may end up duplicating the results of a previous values which were applied by a previous AnimationPlayer. We are currently looking for a better way for update timing for that by reworking IK. Once some of the above pieces are in place, it will definitely be possible. So it is fine if there is a proposal for the future. |
capture(real_t p_time)
funtion to AnimationMixercapture(real_t p_time)
function to AnimationMixer
Describe the project you are working on
Godot Animation features stabilization
Describe the problem or limitation you are having in your project
Related: godotengine/godot#83166
Capture mode has not worked since godotengine/godot#80813. However, as described in godotengine/godot#55110, it had not been working correctly with AnimationTree for a long time. The reason for it is that the Capture mode is strongly dependent on the
AnimationPlayer::play()
function.It is not working with AnimationTree because AnimationTree does not detect things like resuming playback, and neither does AnimationMixer, which is based on AnimationTree.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Revive Capture mode with more flexible control
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Capture mode usually works the same way as Continuous mode.
The
AnimationMixer::capture()
function creates a single AnimationInstance by iterating over the tracks in the current track cache that have Capture mode set before blending and fetching the values.The AnimationInstance remains for the number of seconds specified by p_time, and will be interpolated with the "final result of the blend when no Capture is present".
The implementation of this function allows wrapper functions such as
AnimationPlayer::play_with_capture()
and the following AnimationTree controls.Fade with capture at any transition of AnimationStateMachine:
If this enhancement will not be used often, can it be worked around with a few lines of script?
No
Is there a reason why this should be core and not an add-on in the asset library?
It is core behavior
The text was updated successfully, but these errors were encountered: