Skip to content
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

Make ANIMATION_CALLBACK_MODE_DISCRETE_DOMINANT be default for AnimationPlayer #88492

Merged
merged 1 commit into from
Feb 19, 2024

Conversation

TokageItLab
Copy link
Member

@TokageItLab TokageItLab commented Feb 18, 2024

Follow up #86629.

ANIMATION_CALLBACK_MODE_DISCRETE_RECESSIVE performs no conversion to Continuous and applies the AnimationMixer blend. This was a problem in AnimationPlayer as discussed in #80813 (comment), so we make ANIMATION_CALLBACK_MODE_DISCRETE_FORCE_CONTINUOUS the default in 4.2.

In other words, ANIMATION_CALLBACK_MODE_DISCRETE_RECESSIVE was the default in the old AnimationPlayer that caused problems during AnimationMixer development. So in 4.3, ANIMATION_CALLBACK_MODE_DISCRETE_DOMINANT should be the default for the AnimationPlayer.

@CookieBadger
Copy link
Contributor

CookieBadger commented Feb 18, 2024

I just came across these changes. Does this PR fix this issue?
AnimationUpdateContinuousTimelineCursorMoveBug

The offending function:

Animation::UpdateMode Animation::value_track_get_update_mode(int p_track) const {
	ERR_FAIL_INDEX_V(p_track, tracks.size(), UPDATE_CONTINUOUS);
	Track *t = tracks[p_track];
	ERR_FAIL_COND_V(t->type != TYPE_VALUE, UPDATE_CONTINUOUS);

	ValueTrack *vt = static_cast<ValueTrack *>(t);
	return vt->update_mode;
}

Called from animation_mixer.cpp::1422, when the type is Bezier (reproducing error probably requires a Bezier track)

...
case Animation::TYPE_BEZIER:
case Animation::TYPE_VALUE: {
	if (Math::is_zero_approx(blend)) {
		continue; // Nothing to blend.
	}
	TrackCacheValue *t = static_cast<TrackCacheValue *>(track);
	bool is_discrete = a->value_track_get_update_mode(i) == Animation::UPDATE_DISCRETE;
	...

@TokageItLab
Copy link
Member Author

@CookieBadger It is not related with this PR, but fixed by #88488

Copy link
Contributor

@Mickeon Mickeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs are fine but that of course is not the most important part right now.

@akien-mga akien-mga merged commit da26ef2 into godotengine:master Feb 19, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants