-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Fixed broken root motion calculation in internal process of AnimationBlendTree
such as NodeOneShot
#60774
Conversation
AnimationBlendTree
such as NodeOneShot
dddc0ba
to
9c627b9
Compare
9c627b9
to
296a01e
Compare
I found some errors and fixed them additionally. Ready to review. |
46bf30b
to
5c80eda
Compare
5c80eda
to
ba8398f
Compare
time = 0; | ||
} else if (time > anim_size) { | ||
step += anim_size - time; |
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.
Adjusted by the overflow value.
@@ -1057,7 +1058,7 @@ void AnimationTree::_process_graph(double p_delta) { | |||
} | |||
a->position_track_interpolate(i, 0, &loc[1]); | |||
t->loc += (loc[1] - loc[0]) * blend; | |||
prev_time = 0; | |||
prev_time = (double)a->get_length(); |
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.
Fixed the simple bug which is broken backward root motion loop.
@@ -967,6 +967,7 @@ void AnimationTree::_process_graph(double p_delta) { | |||
int pingponged = as.pingponged; | |||
#ifndef _3D_DISABLED | |||
bool backward = signbit(delta); | |||
bool calc_root = !seeked || as.seek_root; |
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.
AnimationTree performs a seek to change the playback time, but should be able to choose whether to calculate the root motion or not.
I left a few comments to make the review easier. The other parts of these sections are argument rewrites and style corrections. |
Thanks! |
#58061 - not fixed problem actual in 4.0, last version! im use:
i rotate the model using root_motion_transform. |
@Valeryn4 I commented in #29458 (comment). |
Fixed #40294.
The root motion is calculated by subtracting delta from the current time, but if the current time is start or end an error occurred because the clamped current time was passed. This is regression by #53819 (sorry it's my mistake). In addition, make NodeOneShot not fade by default, because it would be confusing to have NodeOneShot fade by default, which would change the value of the root motion.
Fixed godotengine/godot-proposals#4418.
In the case of an implicit seek performed by an internal process such as NodeOneShot, the root motion should not be calculated. Conversely, if the user explicitly seeks with NodeSeek, the root motion should be calculated.
If NodeSeek or NodePhase(#57959) supports loops, the
p_seek_root
may need to be an int (enum) instead of a bool, but for now, this PR fixes the unusable broken calculation of the root motion for NodeOneShot.Before:
2022-05-05.11.03.03-1.mov
After:
2022-05-05.10.25.42-1.mov
In addition, this includes small fix of the enum notation in Animation.
Animation::LoopMode::LOOP_LINEAR
->Animation::LOOP_LINEAR