From 0586c856f678e87f14c73de3bcedf268a8cc9909 Mon Sep 17 00:00:00 2001 From: lolligerjoj Date: Thu, 19 Mar 2020 21:08:24 +0100 Subject: [PATCH] Expose Animation::value_track_interpolate to GDscript (cherry picked from commit ff4af94414ff34e1993fa315fa8988af78ee6d8c) --- doc/classes/Animation.xml | 11 +++++++++++ scene/resources/animation.cpp | 1 + 2 files changed, 12 insertions(+) diff --git a/doc/classes/Animation.xml b/doc/classes/Animation.xml index 2071ac564a9..4a476b2fbae 100644 --- a/doc/classes/Animation.xml +++ b/doc/classes/Animation.xml @@ -681,6 +681,17 @@ Sets the update mode (see [enum UpdateMode]) of a value track. + + + + + + + + + Returns the interpolated value at the given time (in seconds). The [code]track_idx[/code] must be the index of a value track. + + diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index 98c82bf0a20..56c886c24b9 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -2788,6 +2788,7 @@ void Animation::_bind_methods() { ClassDB::bind_method(D_METHOD("value_track_get_update_mode", "track_idx"), &Animation::value_track_get_update_mode); ClassDB::bind_method(D_METHOD("value_track_get_key_indices", "track_idx", "time_sec", "delta"), &Animation::_value_track_get_key_indices); + ClassDB::bind_method(D_METHOD("value_track_interpolate", "track_idx", "time_sec"), &Animation::value_track_interpolate); ClassDB::bind_method(D_METHOD("method_track_get_key_indices", "track_idx", "time_sec", "delta"), &Animation::_method_track_get_key_indices); ClassDB::bind_method(D_METHOD("method_track_get_name", "track_idx", "key_idx"), &Animation::method_track_get_name);