Skip to content

Conversation

@GreentheNinja
Copy link

This resolves a minor annoyance I had.

I don't think interpolation is performed while using nearest interpolation anyway, so this should be more accurate regardless.

@GreentheNinja GreentheNinja requested a review from a team as a code owner October 7, 2025 17:18
@GreentheNinja
Copy link
Author

Uhh, hopefully the name of the commit itself isn't super important. I don't know if I can change that.

@TokageItLab
Copy link
Member

The problem is that even when using Nearest, interpolation occurs via AnimationTree or AnimationPlayer's crossfades. If you want to completely disable this type of warning, I think the way to go is to add a property to the Editor options that disables warnings.

Or, perhaps we should prepare a WARN_PRINT_EXPERIMENTAL macro for the entire Godot engine and add an option to the Editor's General section to disable experimental warnings. We should probably discuss this with the Editor or Documentation team. cc @Mickeon @AThousandShips @Calinou

@GreentheNinja
Copy link
Author

That's a good point, but wouldn't the other track without nearest interpolation trigger the warning? Or do crossfades always run interpolation regardless?

@TokageItLab
Copy link
Member

TokageItLab commented Oct 7, 2025

Crossfades always interpolate Nearest track, which is natural. Consider crossfading a Nearest track like modulate/color:alpha of type Float for a clearer example.

However, there is no way to determine whether a crossfade actually occurs, so the warning will be issued even without crossfading.

This warning should not appear unless the type is String or StringName. If a warning appears for any other type, it is a bug and should be reported.

@GreentheNinja
Copy link
Author

GreentheNinja commented Oct 7, 2025

To elaborate, I made this because I was getting a warning for using a continuous/nearest StringName track, which I was using because discrete tracks would seek to the wrong keyframe when playing/seeking backwards. Unless there's some other way to achieve this behavior with a discrete track?

The only solution I could find suggested a continuous/nearest track was the intended way to do this, so getting a warning for it is rather annoying.

It bugged me enough to edit this into the version of Godot I was using (since I already previously recompiled it to introduce some semi-janky AnimatedSprite2D clickable area logic, like what Sprite2D has).

I'm honestly surprised to see that crossfades apply to two nearest interpolated tracks, but I suppose that functionality is probably useful for someone out there. Closing this is probably fair enough, then (though I'll keep it open for a time in case anyone has anything else to add).

@Calinou Calinou added this to the 4.x milestone Oct 7, 2025
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