|
|
@@ -14,6 +14,8 @@ Animation
|
|
|
|
|
|
Contains data used to animate everything in the engine.
|
|
|
|
|
|
+.. rst-class:: classref-introduction-group
|
|
|
+
|
|
|
Description
|
|
|
-----------
|
|
|
|
|
|
@@ -48,840 +50,1208 @@ Animations are just data containers, and must be added to nodes such as an :ref:
|
|
|
|
|
|
\ **Note:** For 3D position/rotation/scale, using the dedicated :ref:`TYPE_POSITION_3D<class_Animation_constant_TYPE_POSITION_3D>`, :ref:`TYPE_ROTATION_3D<class_Animation_constant_TYPE_ROTATION_3D>` and :ref:`TYPE_SCALE_3D<class_Animation_constant_TYPE_SCALE_3D>` track types instead of :ref:`TYPE_VALUE<class_Animation_constant_TYPE_VALUE>` is recommended for performance reasons.
|
|
|
|
|
|
+.. rst-class:: classref-introduction-group
|
|
|
+
|
|
|
Tutorials
|
|
|
---------
|
|
|
|
|
|
- :doc:`Animation documentation index <../tutorials/animation/index>`
|
|
|
|
|
|
+.. rst-class:: classref-reftable-group
|
|
|
+
|
|
|
Properties
|
|
|
----------
|
|
|
|
|
|
-+------------------------------------------+------------------------------------------------------+---------+
|
|
|
-| :ref:`float<class_float>` | :ref:`length<class_Animation_property_length>` | ``1.0`` |
|
|
|
-+------------------------------------------+------------------------------------------------------+---------+
|
|
|
-| :ref:`LoopMode<enum_Animation_LoopMode>` | :ref:`loop_mode<class_Animation_property_loop_mode>` | ``0`` |
|
|
|
-+------------------------------------------+------------------------------------------------------+---------+
|
|
|
-| :ref:`float<class_float>` | :ref:`step<class_Animation_property_step>` | ``0.1`` |
|
|
|
-+------------------------------------------+------------------------------------------------------+---------+
|
|
|
-
|
|
|
-Methods
|
|
|
--------
|
|
|
+.. table::
|
|
|
+ :widths: auto
|
|
|
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`int<class_int>` | :ref:`add_track<class_Animation_method_add_track>` **(** :ref:`TrackType<enum_Animation_TrackType>` type, :ref:`int<class_int>` at_position=-1 **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`StringName<class_StringName>` | :ref:`animation_track_get_key_animation<class_Animation_method_animation_track_get_key_animation>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`int<class_int>` | :ref:`animation_track_insert_key<class_Animation_method_animation_track_insert_key>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`StringName<class_StringName>` animation **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| void | :ref:`animation_track_set_key_animation<class_Animation_method_animation_track_set_key_animation>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`StringName<class_StringName>` animation **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`float<class_float>` | :ref:`audio_track_get_key_end_offset<class_Animation_method_audio_track_get_key_end_offset>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`float<class_float>` | :ref:`audio_track_get_key_start_offset<class_Animation_method_audio_track_get_key_start_offset>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`Resource<class_Resource>` | :ref:`audio_track_get_key_stream<class_Animation_method_audio_track_get_key_stream>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`int<class_int>` | :ref:`audio_track_insert_key<class_Animation_method_audio_track_insert_key>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Resource<class_Resource>` stream, :ref:`float<class_float>` start_offset=0, :ref:`float<class_float>` end_offset=0 **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| void | :ref:`audio_track_set_key_end_offset<class_Animation_method_audio_track_set_key_end_offset>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` offset **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| void | :ref:`audio_track_set_key_start_offset<class_Animation_method_audio_track_set_key_start_offset>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` offset **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| void | :ref:`audio_track_set_key_stream<class_Animation_method_audio_track_set_key_stream>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`Resource<class_Resource>` stream **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`Vector2<class_Vector2>` | :ref:`bezier_track_get_key_in_handle<class_Animation_method_bezier_track_get_key_in_handle>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`Vector2<class_Vector2>` | :ref:`bezier_track_get_key_out_handle<class_Animation_method_bezier_track_get_key_out_handle>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`float<class_float>` | :ref:`bezier_track_get_key_value<class_Animation_method_bezier_track_get_key_value>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`int<class_int>` | :ref:`bezier_track_insert_key<class_Animation_method_bezier_track_insert_key>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`float<class_float>` value, :ref:`Vector2<class_Vector2>` in_handle=Vector2(0, 0), :ref:`Vector2<class_Vector2>` out_handle=Vector2(0, 0) **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`float<class_float>` | :ref:`bezier_track_interpolate<class_Animation_method_bezier_track_interpolate>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time **)** |const| |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| void | :ref:`bezier_track_set_key_in_handle<class_Animation_method_bezier_track_set_key_in_handle>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`Vector2<class_Vector2>` in_handle, :ref:`float<class_float>` balanced_value_time_ratio=1.0 **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| void | :ref:`bezier_track_set_key_out_handle<class_Animation_method_bezier_track_set_key_out_handle>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`Vector2<class_Vector2>` out_handle, :ref:`float<class_float>` balanced_value_time_ratio=1.0 **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| void | :ref:`bezier_track_set_key_value<class_Animation_method_bezier_track_set_key_value>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` value **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`int<class_int>` | :ref:`blend_shape_track_insert_key<class_Animation_method_blend_shape_track_insert_key>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`float<class_float>` amount **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| void | :ref:`clear<class_Animation_method_clear>` **(** **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| void | :ref:`compress<class_Animation_method_compress>` **(** :ref:`int<class_int>` page_size=8192, :ref:`int<class_int>` fps=120, :ref:`float<class_float>` split_tolerance=4.0 **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| void | :ref:`copy_track<class_Animation_method_copy_track>` **(** :ref:`int<class_int>` track_idx, :ref:`Animation<class_Animation>` to_animation **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`int<class_int>` | :ref:`find_track<class_Animation_method_find_track>` **(** :ref:`NodePath<class_NodePath>` path, :ref:`TrackType<enum_Animation_TrackType>` type **)** |const| |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`int<class_int>` | :ref:`get_track_count<class_Animation_method_get_track_count>` **(** **)** |const| |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`method_track_get_key_indices<class_Animation_method_method_track_get_key_indices>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time_sec, :ref:`float<class_float>` delta **)** |const| |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`StringName<class_StringName>` | :ref:`method_track_get_name<class_Animation_method_method_track_get_name>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`Array<class_Array>` | :ref:`method_track_get_params<class_Animation_method_method_track_get_params>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`int<class_int>` | :ref:`position_track_insert_key<class_Animation_method_position_track_insert_key>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Vector3<class_Vector3>` position **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| void | :ref:`remove_track<class_Animation_method_remove_track>` **(** :ref:`int<class_int>` track_idx **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`int<class_int>` | :ref:`rotation_track_insert_key<class_Animation_method_rotation_track_insert_key>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Quaternion<class_Quaternion>` rotation **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`int<class_int>` | :ref:`scale_track_insert_key<class_Animation_method_scale_track_insert_key>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Vector3<class_Vector3>` scale **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`int<class_int>` | :ref:`track_find_key<class_Animation_method_track_find_key>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`bool<class_bool>` exact=false **)** |const| |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`bool<class_bool>` | :ref:`track_get_interpolation_loop_wrap<class_Animation_method_track_get_interpolation_loop_wrap>` **(** :ref:`int<class_int>` track_idx **)** |const| |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`InterpolationType<enum_Animation_InterpolationType>` | :ref:`track_get_interpolation_type<class_Animation_method_track_get_interpolation_type>` **(** :ref:`int<class_int>` track_idx **)** |const| |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`int<class_int>` | :ref:`track_get_key_count<class_Animation_method_track_get_key_count>` **(** :ref:`int<class_int>` track_idx **)** |const| |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`float<class_float>` | :ref:`track_get_key_time<class_Animation_method_track_get_key_time>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`float<class_float>` | :ref:`track_get_key_transition<class_Animation_method_track_get_key_transition>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`Variant<class_Variant>` | :ref:`track_get_key_value<class_Animation_method_track_get_key_value>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`NodePath<class_NodePath>` | :ref:`track_get_path<class_Animation_method_track_get_path>` **(** :ref:`int<class_int>` track_idx **)** |const| |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`TrackType<enum_Animation_TrackType>` | :ref:`track_get_type<class_Animation_method_track_get_type>` **(** :ref:`int<class_int>` track_idx **)** |const| |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`int<class_int>` | :ref:`track_insert_key<class_Animation_method_track_insert_key>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Variant<class_Variant>` key, :ref:`float<class_float>` transition=1 **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`bool<class_bool>` | :ref:`track_is_compressed<class_Animation_method_track_is_compressed>` **(** :ref:`int<class_int>` track_idx **)** |const| |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`bool<class_bool>` | :ref:`track_is_enabled<class_Animation_method_track_is_enabled>` **(** :ref:`int<class_int>` track_idx **)** |const| |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`bool<class_bool>` | :ref:`track_is_imported<class_Animation_method_track_is_imported>` **(** :ref:`int<class_int>` track_idx **)** |const| |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| void | :ref:`track_move_down<class_Animation_method_track_move_down>` **(** :ref:`int<class_int>` track_idx **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| void | :ref:`track_move_to<class_Animation_method_track_move_to>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` to_idx **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| void | :ref:`track_move_up<class_Animation_method_track_move_up>` **(** :ref:`int<class_int>` track_idx **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| void | :ref:`track_remove_key<class_Animation_method_track_remove_key>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| void | :ref:`track_remove_key_at_time<class_Animation_method_track_remove_key_at_time>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| void | :ref:`track_set_enabled<class_Animation_method_track_set_enabled>` **(** :ref:`int<class_int>` track_idx, :ref:`bool<class_bool>` enabled **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| void | :ref:`track_set_imported<class_Animation_method_track_set_imported>` **(** :ref:`int<class_int>` track_idx, :ref:`bool<class_bool>` imported **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| void | :ref:`track_set_interpolation_loop_wrap<class_Animation_method_track_set_interpolation_loop_wrap>` **(** :ref:`int<class_int>` track_idx, :ref:`bool<class_bool>` interpolation **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| void | :ref:`track_set_interpolation_type<class_Animation_method_track_set_interpolation_type>` **(** :ref:`int<class_int>` track_idx, :ref:`InterpolationType<enum_Animation_InterpolationType>` interpolation **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| void | :ref:`track_set_key_time<class_Animation_method_track_set_key_time>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` time **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| void | :ref:`track_set_key_transition<class_Animation_method_track_set_key_transition>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` transition **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| void | :ref:`track_set_key_value<class_Animation_method_track_set_key_value>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key, :ref:`Variant<class_Variant>` value **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| void | :ref:`track_set_path<class_Animation_method_track_set_path>` **(** :ref:`int<class_int>` track_idx, :ref:`NodePath<class_NodePath>` path **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| void | :ref:`track_swap<class_Animation_method_track_swap>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` with_idx **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`value_track_get_key_indices<class_Animation_method_value_track_get_key_indices>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time_sec, :ref:`float<class_float>` delta **)** |const| |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`UpdateMode<enum_Animation_UpdateMode>` | :ref:`value_track_get_update_mode<class_Animation_method_value_track_get_update_mode>` **(** :ref:`int<class_int>` track_idx **)** |const| |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| :ref:`Variant<class_Variant>` | :ref:`value_track_interpolate<class_Animation_method_value_track_interpolate>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time_sec **)** |const| |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-| void | :ref:`value_track_set_update_mode<class_Animation_method_value_track_set_update_mode>` **(** :ref:`int<class_int>` track_idx, :ref:`UpdateMode<enum_Animation_UpdateMode>` mode **)** |
|
|
|
-+------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
-
|
|
|
-Signals
|
|
|
--------
|
|
|
+ +------------------------------------------+------------------------------------------------------+---------+
|
|
|
+ | :ref:`float<class_float>` | :ref:`length<class_Animation_property_length>` | ``1.0`` |
|
|
|
+ +------------------------------------------+------------------------------------------------------+---------+
|
|
|
+ | :ref:`LoopMode<enum_Animation_LoopMode>` | :ref:`loop_mode<class_Animation_property_loop_mode>` | ``0`` |
|
|
|
+ +------------------------------------------+------------------------------------------------------+---------+
|
|
|
+ | :ref:`float<class_float>` | :ref:`step<class_Animation_property_step>` | ``0.1`` |
|
|
|
+ +------------------------------------------+------------------------------------------------------+---------+
|
|
|
|
|
|
-.. _class_Animation_signal_tracks_changed:
|
|
|
+.. rst-class:: classref-reftable-group
|
|
|
|
|
|
-- **tracks_changed** **(** **)**
|
|
|
+Methods
|
|
|
+-------
|
|
|
|
|
|
-Emitted when there's a change in the list of tracks, e.g. tracks are added, moved or have changed paths.
|
|
|
+.. table::
|
|
|
+ :widths: auto
|
|
|
+
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`int<class_int>` | :ref:`add_track<class_Animation_method_add_track>` **(** :ref:`TrackType<enum_Animation_TrackType>` type, :ref:`int<class_int>` at_position=-1 **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`StringName<class_StringName>` | :ref:`animation_track_get_key_animation<class_Animation_method_animation_track_get_key_animation>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`int<class_int>` | :ref:`animation_track_insert_key<class_Animation_method_animation_track_insert_key>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`StringName<class_StringName>` animation **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | void | :ref:`animation_track_set_key_animation<class_Animation_method_animation_track_set_key_animation>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`StringName<class_StringName>` animation **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`float<class_float>` | :ref:`audio_track_get_key_end_offset<class_Animation_method_audio_track_get_key_end_offset>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`float<class_float>` | :ref:`audio_track_get_key_start_offset<class_Animation_method_audio_track_get_key_start_offset>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`Resource<class_Resource>` | :ref:`audio_track_get_key_stream<class_Animation_method_audio_track_get_key_stream>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`int<class_int>` | :ref:`audio_track_insert_key<class_Animation_method_audio_track_insert_key>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Resource<class_Resource>` stream, :ref:`float<class_float>` start_offset=0, :ref:`float<class_float>` end_offset=0 **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | void | :ref:`audio_track_set_key_end_offset<class_Animation_method_audio_track_set_key_end_offset>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` offset **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | void | :ref:`audio_track_set_key_start_offset<class_Animation_method_audio_track_set_key_start_offset>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` offset **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | void | :ref:`audio_track_set_key_stream<class_Animation_method_audio_track_set_key_stream>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`Resource<class_Resource>` stream **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`Vector2<class_Vector2>` | :ref:`bezier_track_get_key_in_handle<class_Animation_method_bezier_track_get_key_in_handle>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`Vector2<class_Vector2>` | :ref:`bezier_track_get_key_out_handle<class_Animation_method_bezier_track_get_key_out_handle>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`float<class_float>` | :ref:`bezier_track_get_key_value<class_Animation_method_bezier_track_get_key_value>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`int<class_int>` | :ref:`bezier_track_insert_key<class_Animation_method_bezier_track_insert_key>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`float<class_float>` value, :ref:`Vector2<class_Vector2>` in_handle=Vector2(0, 0), :ref:`Vector2<class_Vector2>` out_handle=Vector2(0, 0) **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`float<class_float>` | :ref:`bezier_track_interpolate<class_Animation_method_bezier_track_interpolate>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time **)** |const| |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | void | :ref:`bezier_track_set_key_in_handle<class_Animation_method_bezier_track_set_key_in_handle>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`Vector2<class_Vector2>` in_handle, :ref:`float<class_float>` balanced_value_time_ratio=1.0 **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | void | :ref:`bezier_track_set_key_out_handle<class_Animation_method_bezier_track_set_key_out_handle>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`Vector2<class_Vector2>` out_handle, :ref:`float<class_float>` balanced_value_time_ratio=1.0 **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | void | :ref:`bezier_track_set_key_value<class_Animation_method_bezier_track_set_key_value>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` value **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`int<class_int>` | :ref:`blend_shape_track_insert_key<class_Animation_method_blend_shape_track_insert_key>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`float<class_float>` amount **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | void | :ref:`clear<class_Animation_method_clear>` **(** **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | void | :ref:`compress<class_Animation_method_compress>` **(** :ref:`int<class_int>` page_size=8192, :ref:`int<class_int>` fps=120, :ref:`float<class_float>` split_tolerance=4.0 **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | void | :ref:`copy_track<class_Animation_method_copy_track>` **(** :ref:`int<class_int>` track_idx, :ref:`Animation<class_Animation>` to_animation **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`int<class_int>` | :ref:`find_track<class_Animation_method_find_track>` **(** :ref:`NodePath<class_NodePath>` path, :ref:`TrackType<enum_Animation_TrackType>` type **)** |const| |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`int<class_int>` | :ref:`get_track_count<class_Animation_method_get_track_count>` **(** **)** |const| |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`StringName<class_StringName>` | :ref:`method_track_get_name<class_Animation_method_method_track_get_name>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`Array<class_Array>` | :ref:`method_track_get_params<class_Animation_method_method_track_get_params>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`int<class_int>` | :ref:`position_track_insert_key<class_Animation_method_position_track_insert_key>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Vector3<class_Vector3>` position **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | void | :ref:`remove_track<class_Animation_method_remove_track>` **(** :ref:`int<class_int>` track_idx **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`int<class_int>` | :ref:`rotation_track_insert_key<class_Animation_method_rotation_track_insert_key>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Quaternion<class_Quaternion>` rotation **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`int<class_int>` | :ref:`scale_track_insert_key<class_Animation_method_scale_track_insert_key>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Vector3<class_Vector3>` scale **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`int<class_int>` | :ref:`track_find_key<class_Animation_method_track_find_key>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`bool<class_bool>` exact=false **)** |const| |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`bool<class_bool>` | :ref:`track_get_interpolation_loop_wrap<class_Animation_method_track_get_interpolation_loop_wrap>` **(** :ref:`int<class_int>` track_idx **)** |const| |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`InterpolationType<enum_Animation_InterpolationType>` | :ref:`track_get_interpolation_type<class_Animation_method_track_get_interpolation_type>` **(** :ref:`int<class_int>` track_idx **)** |const| |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`int<class_int>` | :ref:`track_get_key_count<class_Animation_method_track_get_key_count>` **(** :ref:`int<class_int>` track_idx **)** |const| |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`float<class_float>` | :ref:`track_get_key_time<class_Animation_method_track_get_key_time>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`float<class_float>` | :ref:`track_get_key_transition<class_Animation_method_track_get_key_transition>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`Variant<class_Variant>` | :ref:`track_get_key_value<class_Animation_method_track_get_key_value>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const| |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`NodePath<class_NodePath>` | :ref:`track_get_path<class_Animation_method_track_get_path>` **(** :ref:`int<class_int>` track_idx **)** |const| |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`TrackType<enum_Animation_TrackType>` | :ref:`track_get_type<class_Animation_method_track_get_type>` **(** :ref:`int<class_int>` track_idx **)** |const| |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`int<class_int>` | :ref:`track_insert_key<class_Animation_method_track_insert_key>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Variant<class_Variant>` key, :ref:`float<class_float>` transition=1 **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`bool<class_bool>` | :ref:`track_is_compressed<class_Animation_method_track_is_compressed>` **(** :ref:`int<class_int>` track_idx **)** |const| |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`bool<class_bool>` | :ref:`track_is_enabled<class_Animation_method_track_is_enabled>` **(** :ref:`int<class_int>` track_idx **)** |const| |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`bool<class_bool>` | :ref:`track_is_imported<class_Animation_method_track_is_imported>` **(** :ref:`int<class_int>` track_idx **)** |const| |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | void | :ref:`track_move_down<class_Animation_method_track_move_down>` **(** :ref:`int<class_int>` track_idx **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | void | :ref:`track_move_to<class_Animation_method_track_move_to>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` to_idx **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | void | :ref:`track_move_up<class_Animation_method_track_move_up>` **(** :ref:`int<class_int>` track_idx **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | void | :ref:`track_remove_key<class_Animation_method_track_remove_key>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | void | :ref:`track_remove_key_at_time<class_Animation_method_track_remove_key_at_time>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | void | :ref:`track_set_enabled<class_Animation_method_track_set_enabled>` **(** :ref:`int<class_int>` track_idx, :ref:`bool<class_bool>` enabled **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | void | :ref:`track_set_imported<class_Animation_method_track_set_imported>` **(** :ref:`int<class_int>` track_idx, :ref:`bool<class_bool>` imported **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | void | :ref:`track_set_interpolation_loop_wrap<class_Animation_method_track_set_interpolation_loop_wrap>` **(** :ref:`int<class_int>` track_idx, :ref:`bool<class_bool>` interpolation **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | void | :ref:`track_set_interpolation_type<class_Animation_method_track_set_interpolation_type>` **(** :ref:`int<class_int>` track_idx, :ref:`InterpolationType<enum_Animation_InterpolationType>` interpolation **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | void | :ref:`track_set_key_time<class_Animation_method_track_set_key_time>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` time **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | void | :ref:`track_set_key_transition<class_Animation_method_track_set_key_transition>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` transition **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | void | :ref:`track_set_key_value<class_Animation_method_track_set_key_value>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key, :ref:`Variant<class_Variant>` value **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | void | :ref:`track_set_path<class_Animation_method_track_set_path>` **(** :ref:`int<class_int>` track_idx, :ref:`NodePath<class_NodePath>` path **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | void | :ref:`track_swap<class_Animation_method_track_swap>` **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` with_idx **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`UpdateMode<enum_Animation_UpdateMode>` | :ref:`value_track_get_update_mode<class_Animation_method_value_track_get_update_mode>` **(** :ref:`int<class_int>` track_idx **)** |const| |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | :ref:`Variant<class_Variant>` | :ref:`value_track_interpolate<class_Animation_method_value_track_interpolate>` **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time_sec **)** |const| |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+ | void | :ref:`value_track_set_update_mode<class_Animation_method_value_track_set_update_mode>` **(** :ref:`int<class_int>` track_idx, :ref:`UpdateMode<enum_Animation_UpdateMode>` mode **)** |
|
|
|
+ +------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
+
|
|
|
+.. rst-class:: classref-section-separator
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. rst-class:: classref-descriptions-group
|
|
|
|
|
|
Enumerations
|
|
|
------------
|
|
|
|
|
|
.. _enum_Animation_TrackType:
|
|
|
|
|
|
+.. rst-class:: classref-enumeration
|
|
|
+
|
|
|
+enum **TrackType**:
|
|
|
+
|
|
|
.. _class_Animation_constant_TYPE_VALUE:
|
|
|
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
+
|
|
|
+:ref:`TrackType<enum_Animation_TrackType>` **TYPE_VALUE** = ``0``
|
|
|
+
|
|
|
+Value tracks set values in node properties, but only those which can be interpolated. For 3D position/rotation/scale, using the dedicated :ref:`TYPE_POSITION_3D<class_Animation_constant_TYPE_POSITION_3D>`, :ref:`TYPE_ROTATION_3D<class_Animation_constant_TYPE_ROTATION_3D>` and :ref:`TYPE_SCALE_3D<class_Animation_constant_TYPE_SCALE_3D>` track types instead of :ref:`TYPE_VALUE<class_Animation_constant_TYPE_VALUE>` is recommended for performance reasons.
|
|
|
+
|
|
|
.. _class_Animation_constant_TYPE_POSITION_3D:
|
|
|
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
+
|
|
|
+:ref:`TrackType<enum_Animation_TrackType>` **TYPE_POSITION_3D** = ``1``
|
|
|
+
|
|
|
+3D position track (values are stored in :ref:`Vector3<class_Vector3>`\ s).
|
|
|
+
|
|
|
.. _class_Animation_constant_TYPE_ROTATION_3D:
|
|
|
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
+
|
|
|
+:ref:`TrackType<enum_Animation_TrackType>` **TYPE_ROTATION_3D** = ``2``
|
|
|
+
|
|
|
+3D rotation track (values are stored in :ref:`Quaternion<class_Quaternion>`\ s).
|
|
|
+
|
|
|
.. _class_Animation_constant_TYPE_SCALE_3D:
|
|
|
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
+
|
|
|
+:ref:`TrackType<enum_Animation_TrackType>` **TYPE_SCALE_3D** = ``3``
|
|
|
+
|
|
|
+3D scale track (values are stored in :ref:`Vector3<class_Vector3>`\ s).
|
|
|
+
|
|
|
.. _class_Animation_constant_TYPE_BLEND_SHAPE:
|
|
|
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
+
|
|
|
+:ref:`TrackType<enum_Animation_TrackType>` **TYPE_BLEND_SHAPE** = ``4``
|
|
|
+
|
|
|
+Blend shape track.
|
|
|
+
|
|
|
.. _class_Animation_constant_TYPE_METHOD:
|
|
|
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
+
|
|
|
+:ref:`TrackType<enum_Animation_TrackType>` **TYPE_METHOD** = ``5``
|
|
|
+
|
|
|
+Method tracks call functions with given arguments per key.
|
|
|
+
|
|
|
.. _class_Animation_constant_TYPE_BEZIER:
|
|
|
|
|
|
-.. _class_Animation_constant_TYPE_AUDIO:
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
|
|
|
-.. _class_Animation_constant_TYPE_ANIMATION:
|
|
|
+:ref:`TrackType<enum_Animation_TrackType>` **TYPE_BEZIER** = ``6``
|
|
|
|
|
|
-enum **TrackType**:
|
|
|
+Bezier tracks are used to interpolate a value using custom curves. They can also be used to animate sub-properties of vectors and colors (e.g. alpha value of a :ref:`Color<class_Color>`).
|
|
|
|
|
|
-- **TYPE_VALUE** = **0** --- Value tracks set values in node properties, but only those which can be interpolated. For 3D position/rotation/scale, using the dedicated :ref:`TYPE_POSITION_3D<class_Animation_constant_TYPE_POSITION_3D>`, :ref:`TYPE_ROTATION_3D<class_Animation_constant_TYPE_ROTATION_3D>` and :ref:`TYPE_SCALE_3D<class_Animation_constant_TYPE_SCALE_3D>` track types instead of :ref:`TYPE_VALUE<class_Animation_constant_TYPE_VALUE>` is recommended for performance reasons.
|
|
|
+.. _class_Animation_constant_TYPE_AUDIO:
|
|
|
|
|
|
-- **TYPE_POSITION_3D** = **1** --- 3D position track (values are stored in :ref:`Vector3<class_Vector3>`\ s).
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
|
|
|
-- **TYPE_ROTATION_3D** = **2** --- 3D rotation track (values are stored in :ref:`Quaternion<class_Quaternion>`\ s).
|
|
|
+:ref:`TrackType<enum_Animation_TrackType>` **TYPE_AUDIO** = ``7``
|
|
|
|
|
|
-- **TYPE_SCALE_3D** = **3** --- 3D scale track (values are stored in :ref:`Vector3<class_Vector3>`\ s).
|
|
|
+Audio tracks are used to play an audio stream with either type of :ref:`AudioStreamPlayer<class_AudioStreamPlayer>`. The stream can be trimmed and previewed in the animation.
|
|
|
|
|
|
-- **TYPE_BLEND_SHAPE** = **4** --- Blend shape track.
|
|
|
+.. _class_Animation_constant_TYPE_ANIMATION:
|
|
|
|
|
|
-- **TYPE_METHOD** = **5** --- Method tracks call functions with given arguments per key.
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
|
|
|
-- **TYPE_BEZIER** = **6** --- Bezier tracks are used to interpolate a value using custom curves. They can also be used to animate sub-properties of vectors and colors (e.g. alpha value of a :ref:`Color<class_Color>`).
|
|
|
+:ref:`TrackType<enum_Animation_TrackType>` **TYPE_ANIMATION** = ``8``
|
|
|
|
|
|
-- **TYPE_AUDIO** = **7** --- Audio tracks are used to play an audio stream with either type of :ref:`AudioStreamPlayer<class_AudioStreamPlayer>`. The stream can be trimmed and previewed in the animation.
|
|
|
+Animation tracks play animations in other :ref:`AnimationPlayer<class_AnimationPlayer>` nodes.
|
|
|
|
|
|
-- **TYPE_ANIMATION** = **8** --- Animation tracks play animations in other :ref:`AnimationPlayer<class_AnimationPlayer>` nodes.
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
|
|
----
|
|
|
|
|
|
.. _enum_Animation_InterpolationType:
|
|
|
|
|
|
+.. rst-class:: classref-enumeration
|
|
|
+
|
|
|
+enum **InterpolationType**:
|
|
|
+
|
|
|
.. _class_Animation_constant_INTERPOLATION_NEAREST:
|
|
|
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
+
|
|
|
+:ref:`InterpolationType<enum_Animation_InterpolationType>` **INTERPOLATION_NEAREST** = ``0``
|
|
|
+
|
|
|
+No interpolation (nearest value).
|
|
|
+
|
|
|
.. _class_Animation_constant_INTERPOLATION_LINEAR:
|
|
|
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
+
|
|
|
+:ref:`InterpolationType<enum_Animation_InterpolationType>` **INTERPOLATION_LINEAR** = ``1``
|
|
|
+
|
|
|
+Linear interpolation.
|
|
|
+
|
|
|
.. _class_Animation_constant_INTERPOLATION_CUBIC:
|
|
|
|
|
|
-.. _class_Animation_constant_INTERPOLATION_LINEAR_ANGLE:
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
|
|
|
-.. _class_Animation_constant_INTERPOLATION_CUBIC_ANGLE:
|
|
|
+:ref:`InterpolationType<enum_Animation_InterpolationType>` **INTERPOLATION_CUBIC** = ``2``
|
|
|
|
|
|
-enum **InterpolationType**:
|
|
|
+Cubic interpolation. This looks smoother than linear interpolation, but is more expensive to interpolate. Stick to :ref:`INTERPOLATION_LINEAR<class_Animation_constant_INTERPOLATION_LINEAR>` for complex 3D animations imported from external software, even if it requires using a higher animation framerate in return.
|
|
|
|
|
|
-- **INTERPOLATION_NEAREST** = **0** --- No interpolation (nearest value).
|
|
|
+.. _class_Animation_constant_INTERPOLATION_LINEAR_ANGLE:
|
|
|
|
|
|
-- **INTERPOLATION_LINEAR** = **1** --- Linear interpolation.
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
|
|
|
-- **INTERPOLATION_CUBIC** = **2** --- Cubic interpolation. This looks smoother than linear interpolation, but is more expensive to interpolate. Stick to :ref:`INTERPOLATION_LINEAR<class_Animation_constant_INTERPOLATION_LINEAR>` for complex 3D animations imported from external software, even if it requires using a higher animation framerate in return.
|
|
|
+:ref:`InterpolationType<enum_Animation_InterpolationType>` **INTERPOLATION_LINEAR_ANGLE** = ``3``
|
|
|
|
|
|
-- **INTERPOLATION_LINEAR_ANGLE** = **3** --- Linear interpolation with shortest path rotation.
|
|
|
+Linear interpolation with shortest path rotation.
|
|
|
|
|
|
\ **Note:** The result value is always normalized and may not match the key value.
|
|
|
|
|
|
-- **INTERPOLATION_CUBIC_ANGLE** = **4** --- Cubic interpolation with shortest path rotation.
|
|
|
+.. _class_Animation_constant_INTERPOLATION_CUBIC_ANGLE:
|
|
|
+
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
+
|
|
|
+:ref:`InterpolationType<enum_Animation_InterpolationType>` **INTERPOLATION_CUBIC_ANGLE** = ``4``
|
|
|
+
|
|
|
+Cubic interpolation with shortest path rotation.
|
|
|
|
|
|
\ **Note:** The result value is always normalized and may not match the key value.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _enum_Animation_UpdateMode:
|
|
|
|
|
|
+.. rst-class:: classref-enumeration
|
|
|
+
|
|
|
+enum **UpdateMode**:
|
|
|
+
|
|
|
.. _class_Animation_constant_UPDATE_CONTINUOUS:
|
|
|
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
+
|
|
|
+:ref:`UpdateMode<enum_Animation_UpdateMode>` **UPDATE_CONTINUOUS** = ``0``
|
|
|
+
|
|
|
+Update between keyframes and hold the value.
|
|
|
+
|
|
|
.. _class_Animation_constant_UPDATE_DISCRETE:
|
|
|
|
|
|
-.. _class_Animation_constant_UPDATE_TRIGGER:
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
|
|
|
-.. _class_Animation_constant_UPDATE_CAPTURE:
|
|
|
+:ref:`UpdateMode<enum_Animation_UpdateMode>` **UPDATE_DISCRETE** = ``1``
|
|
|
|
|
|
-enum **UpdateMode**:
|
|
|
+Update at the keyframes.
|
|
|
+
|
|
|
+.. _class_Animation_constant_UPDATE_CAPTURE:
|
|
|
|
|
|
-- **UPDATE_CONTINUOUS** = **0** --- Update between keyframes.
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
|
|
|
-- **UPDATE_DISCRETE** = **1** --- Update at the keyframes and hold the value.
|
|
|
+:ref:`UpdateMode<enum_Animation_UpdateMode>` **UPDATE_CAPTURE** = ``2``
|
|
|
|
|
|
-- **UPDATE_TRIGGER** = **2** --- Update at the keyframes.
|
|
|
+Same as linear interpolation, but also interpolates from the current value (i.e. dynamically at runtime) if the first key isn't at 0 seconds.
|
|
|
|
|
|
-- **UPDATE_CAPTURE** = **3** --- Same as linear interpolation, but also interpolates from the current value (i.e. dynamically at runtime) if the first key isn't at 0 seconds.
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
|
|
----
|
|
|
|
|
|
.. _enum_Animation_LoopMode:
|
|
|
|
|
|
+.. rst-class:: classref-enumeration
|
|
|
+
|
|
|
+enum **LoopMode**:
|
|
|
+
|
|
|
.. _class_Animation_constant_LOOP_NONE:
|
|
|
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
+
|
|
|
+:ref:`LoopMode<enum_Animation_LoopMode>` **LOOP_NONE** = ``0``
|
|
|
+
|
|
|
+At both ends of the animation, the animation will stop playing.
|
|
|
+
|
|
|
.. _class_Animation_constant_LOOP_LINEAR:
|
|
|
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
+
|
|
|
+:ref:`LoopMode<enum_Animation_LoopMode>` **LOOP_LINEAR** = ``1``
|
|
|
+
|
|
|
+At both ends of the animation, the animation will be repeated without changing the playback direction.
|
|
|
+
|
|
|
.. _class_Animation_constant_LOOP_PINGPONG:
|
|
|
|
|
|
-enum **LoopMode**:
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
+
|
|
|
+:ref:`LoopMode<enum_Animation_LoopMode>` **LOOP_PINGPONG** = ``2``
|
|
|
+
|
|
|
+Repeats playback and reverse playback at both ends of the animation.
|
|
|
+
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. _enum_Animation_LoopedFlag:
|
|
|
+
|
|
|
+.. rst-class:: classref-enumeration
|
|
|
+
|
|
|
+enum **LoopedFlag**:
|
|
|
+
|
|
|
+.. _class_Animation_constant_LOOPED_FLAG_NONE:
|
|
|
+
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
+
|
|
|
+:ref:`LoopedFlag<enum_Animation_LoopedFlag>` **LOOPED_FLAG_NONE** = ``0``
|
|
|
+
|
|
|
+This flag indicates that the animation proceeds without any looping.
|
|
|
+
|
|
|
+.. _class_Animation_constant_LOOPED_FLAG_END:
|
|
|
+
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
+
|
|
|
+:ref:`LoopedFlag<enum_Animation_LoopedFlag>` **LOOPED_FLAG_END** = ``1``
|
|
|
|
|
|
-- **LOOP_NONE** = **0** --- At both ends of the animation, the animation will stop playing.
|
|
|
+This flag indicates that the animation has reached the end of the animation and just after loop processed.
|
|
|
|
|
|
-- **LOOP_LINEAR** = **1** --- At both ends of the animation, the animation will be repeated without changing the playback direction.
|
|
|
+.. _class_Animation_constant_LOOPED_FLAG_START:
|
|
|
|
|
|
-- **LOOP_PINGPONG** = **2** --- Repeats playback and reverse playback at both ends of the animation.
|
|
|
+.. rst-class:: classref-enumeration-constant
|
|
|
+
|
|
|
+:ref:`LoopedFlag<enum_Animation_LoopedFlag>` **LOOPED_FLAG_START** = ``2``
|
|
|
+
|
|
|
+This flag indicates that the animation has reached the start of the animation and just after loop processed.
|
|
|
+
|
|
|
+.. rst-class:: classref-section-separator
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. rst-class:: classref-descriptions-group
|
|
|
|
|
|
Property Descriptions
|
|
|
---------------------
|
|
|
|
|
|
.. _class_Animation_property_length:
|
|
|
|
|
|
-- :ref:`float<class_float>` **length**
|
|
|
+.. rst-class:: classref-property
|
|
|
+
|
|
|
+:ref:`float<class_float>` **length** = ``1.0``
|
|
|
+
|
|
|
+.. rst-class:: classref-property-setget
|
|
|
|
|
|
-+-----------+-------------------+
|
|
|
-| *Default* | ``1.0`` |
|
|
|
-+-----------+-------------------+
|
|
|
-| *Setter* | set_length(value) |
|
|
|
-+-----------+-------------------+
|
|
|
-| *Getter* | get_length() |
|
|
|
-+-----------+-------------------+
|
|
|
+- void **set_length** **(** :ref:`float<class_float>` value **)**
|
|
|
+- :ref:`float<class_float>` **get_length** **(** **)**
|
|
|
|
|
|
The total length of the animation (in seconds).
|
|
|
|
|
|
\ **Note:** Length is not delimited by the last key, as this one may be before or after the end to ensure correct interpolation and looping.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_property_loop_mode:
|
|
|
|
|
|
-- :ref:`LoopMode<enum_Animation_LoopMode>` **loop_mode**
|
|
|
+.. rst-class:: classref-property
|
|
|
+
|
|
|
+:ref:`LoopMode<enum_Animation_LoopMode>` **loop_mode** = ``0``
|
|
|
|
|
|
-+-----------+----------------------+
|
|
|
-| *Default* | ``0`` |
|
|
|
-+-----------+----------------------+
|
|
|
-| *Setter* | set_loop_mode(value) |
|
|
|
-+-----------+----------------------+
|
|
|
-| *Getter* | get_loop_mode() |
|
|
|
-+-----------+----------------------+
|
|
|
+.. rst-class:: classref-property-setget
|
|
|
+
|
|
|
+- void **set_loop_mode** **(** :ref:`LoopMode<enum_Animation_LoopMode>` value **)**
|
|
|
+- :ref:`LoopMode<enum_Animation_LoopMode>` **get_loop_mode** **(** **)**
|
|
|
|
|
|
Determines the behavior of both ends of the animation timeline during animation playback. This is used for correct interpolation of animation cycles, and for hinting the player that it must restart the animation.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_property_step:
|
|
|
|
|
|
-- :ref:`float<class_float>` **step**
|
|
|
+.. rst-class:: classref-property
|
|
|
|
|
|
-+-----------+-----------------+
|
|
|
-| *Default* | ``0.1`` |
|
|
|
-+-----------+-----------------+
|
|
|
-| *Setter* | set_step(value) |
|
|
|
-+-----------+-----------------+
|
|
|
-| *Getter* | get_step() |
|
|
|
-+-----------+-----------------+
|
|
|
+:ref:`float<class_float>` **step** = ``0.1``
|
|
|
+
|
|
|
+.. rst-class:: classref-property-setget
|
|
|
+
|
|
|
+- void **set_step** **(** :ref:`float<class_float>` value **)**
|
|
|
+- :ref:`float<class_float>` **get_step** **(** **)**
|
|
|
|
|
|
The animation step value.
|
|
|
|
|
|
+.. rst-class:: classref-section-separator
|
|
|
+
|
|
|
+----
|
|
|
+
|
|
|
+.. rst-class:: classref-descriptions-group
|
|
|
+
|
|
|
Method Descriptions
|
|
|
-------------------
|
|
|
|
|
|
.. _class_Animation_method_add_track:
|
|
|
|
|
|
-- :ref:`int<class_int>` **add_track** **(** :ref:`TrackType<enum_Animation_TrackType>` type, :ref:`int<class_int>` at_position=-1 **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`int<class_int>` **add_track** **(** :ref:`TrackType<enum_Animation_TrackType>` type, :ref:`int<class_int>` at_position=-1 **)**
|
|
|
|
|
|
Adds a track to the Animation.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_animation_track_get_key_animation:
|
|
|
|
|
|
-- :ref:`StringName<class_StringName>` **animation_track_get_key_animation** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`StringName<class_StringName>` **animation_track_get_key_animation** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
|
|
|
|
|
|
Returns the animation name at the key identified by ``key_idx``. The ``track_idx`` must be the index of an Animation Track.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_animation_track_insert_key:
|
|
|
|
|
|
-- :ref:`int<class_int>` **animation_track_insert_key** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`StringName<class_StringName>` animation **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`int<class_int>` **animation_track_insert_key** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`StringName<class_StringName>` animation **)**
|
|
|
|
|
|
Inserts a key with value ``animation`` at the given ``time`` (in seconds). The ``track_idx`` must be the index of an Animation Track.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_animation_track_set_key_animation:
|
|
|
|
|
|
-- void **animation_track_set_key_animation** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`StringName<class_StringName>` animation **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+void **animation_track_set_key_animation** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`StringName<class_StringName>` animation **)**
|
|
|
|
|
|
Sets the key identified by ``key_idx`` to value ``animation``. The ``track_idx`` must be the index of an Animation Track.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_audio_track_get_key_end_offset:
|
|
|
|
|
|
-- :ref:`float<class_float>` **audio_track_get_key_end_offset** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`float<class_float>` **audio_track_get_key_end_offset** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
|
|
|
|
|
|
Returns the end offset of the key identified by ``key_idx``. The ``track_idx`` must be the index of an Audio Track.
|
|
|
|
|
|
End offset is the number of seconds cut off at the ending of the audio stream.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_audio_track_get_key_start_offset:
|
|
|
|
|
|
-- :ref:`float<class_float>` **audio_track_get_key_start_offset** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`float<class_float>` **audio_track_get_key_start_offset** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
|
|
|
|
|
|
Returns the start offset of the key identified by ``key_idx``. The ``track_idx`` must be the index of an Audio Track.
|
|
|
|
|
|
Start offset is the number of seconds cut off at the beginning of the audio stream.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_audio_track_get_key_stream:
|
|
|
|
|
|
-- :ref:`Resource<class_Resource>` **audio_track_get_key_stream** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`Resource<class_Resource>` **audio_track_get_key_stream** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
|
|
|
|
|
|
Returns the audio stream of the key identified by ``key_idx``. The ``track_idx`` must be the index of an Audio Track.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_audio_track_insert_key:
|
|
|
|
|
|
-- :ref:`int<class_int>` **audio_track_insert_key** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Resource<class_Resource>` stream, :ref:`float<class_float>` start_offset=0, :ref:`float<class_float>` end_offset=0 **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`int<class_int>` **audio_track_insert_key** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Resource<class_Resource>` stream, :ref:`float<class_float>` start_offset=0, :ref:`float<class_float>` end_offset=0 **)**
|
|
|
|
|
|
Inserts an Audio Track key at the given ``time`` in seconds. The ``track_idx`` must be the index of an Audio Track.
|
|
|
|
|
|
\ ``stream`` is the :ref:`AudioStream<class_AudioStream>` resource to play. ``start_offset`` is the number of seconds cut off at the beginning of the audio stream, while ``end_offset`` is at the ending.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_audio_track_set_key_end_offset:
|
|
|
|
|
|
-- void **audio_track_set_key_end_offset** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` offset **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+void **audio_track_set_key_end_offset** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` offset **)**
|
|
|
|
|
|
Sets the end offset of the key identified by ``key_idx`` to value ``offset``. The ``track_idx`` must be the index of an Audio Track.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_audio_track_set_key_start_offset:
|
|
|
|
|
|
-- void **audio_track_set_key_start_offset** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` offset **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+void **audio_track_set_key_start_offset** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` offset **)**
|
|
|
|
|
|
Sets the start offset of the key identified by ``key_idx`` to value ``offset``. The ``track_idx`` must be the index of an Audio Track.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_audio_track_set_key_stream:
|
|
|
|
|
|
-- void **audio_track_set_key_stream** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`Resource<class_Resource>` stream **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+void **audio_track_set_key_stream** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`Resource<class_Resource>` stream **)**
|
|
|
|
|
|
Sets the stream of the key identified by ``key_idx`` to value ``stream``. The ``track_idx`` must be the index of an Audio Track.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_bezier_track_get_key_in_handle:
|
|
|
|
|
|
-- :ref:`Vector2<class_Vector2>` **bezier_track_get_key_in_handle** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`Vector2<class_Vector2>` **bezier_track_get_key_in_handle** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
|
|
|
|
|
|
Returns the in handle of the key identified by ``key_idx``. The ``track_idx`` must be the index of a Bezier Track.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_bezier_track_get_key_out_handle:
|
|
|
|
|
|
-- :ref:`Vector2<class_Vector2>` **bezier_track_get_key_out_handle** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`Vector2<class_Vector2>` **bezier_track_get_key_out_handle** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
|
|
|
|
|
|
Returns the out handle of the key identified by ``key_idx``. The ``track_idx`` must be the index of a Bezier Track.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_bezier_track_get_key_value:
|
|
|
|
|
|
-- :ref:`float<class_float>` **bezier_track_get_key_value** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`float<class_float>` **bezier_track_get_key_value** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
|
|
|
|
|
|
Returns the value of the key identified by ``key_idx``. The ``track_idx`` must be the index of a Bezier Track.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_bezier_track_insert_key:
|
|
|
|
|
|
-- :ref:`int<class_int>` **bezier_track_insert_key** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`float<class_float>` value, :ref:`Vector2<class_Vector2>` in_handle=Vector2(0, 0), :ref:`Vector2<class_Vector2>` out_handle=Vector2(0, 0) **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`int<class_int>` **bezier_track_insert_key** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`float<class_float>` value, :ref:`Vector2<class_Vector2>` in_handle=Vector2(0, 0), :ref:`Vector2<class_Vector2>` out_handle=Vector2(0, 0) **)**
|
|
|
|
|
|
Inserts a Bezier Track key at the given ``time`` in seconds. The ``track_idx`` must be the index of a Bezier Track.
|
|
|
|
|
|
\ ``in_handle`` is the left-side weight of the added Bezier curve point, ``out_handle`` is the right-side one, while ``value`` is the actual value at this point.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_bezier_track_interpolate:
|
|
|
|
|
|
-- :ref:`float<class_float>` **bezier_track_interpolate** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time **)** |const|
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`float<class_float>` **bezier_track_interpolate** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time **)** |const|
|
|
|
|
|
|
Returns the interpolated value at the given ``time`` (in seconds). The ``track_idx`` must be the index of a Bezier Track.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_bezier_track_set_key_in_handle:
|
|
|
|
|
|
-- void **bezier_track_set_key_in_handle** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`Vector2<class_Vector2>` in_handle, :ref:`float<class_float>` balanced_value_time_ratio=1.0 **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+void **bezier_track_set_key_in_handle** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`Vector2<class_Vector2>` in_handle, :ref:`float<class_float>` balanced_value_time_ratio=1.0 **)**
|
|
|
|
|
|
Sets the in handle of the key identified by ``key_idx`` to value ``in_handle``. The ``track_idx`` must be the index of a Bezier Track.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_bezier_track_set_key_out_handle:
|
|
|
|
|
|
-- void **bezier_track_set_key_out_handle** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`Vector2<class_Vector2>` out_handle, :ref:`float<class_float>` balanced_value_time_ratio=1.0 **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+void **bezier_track_set_key_out_handle** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`Vector2<class_Vector2>` out_handle, :ref:`float<class_float>` balanced_value_time_ratio=1.0 **)**
|
|
|
|
|
|
Sets the out handle of the key identified by ``key_idx`` to value ``out_handle``. The ``track_idx`` must be the index of a Bezier Track.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_bezier_track_set_key_value:
|
|
|
|
|
|
-- void **bezier_track_set_key_value** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` value **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+void **bezier_track_set_key_value** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` value **)**
|
|
|
|
|
|
Sets the value of the key identified by ``key_idx`` to the given value. The ``track_idx`` must be the index of a Bezier Track.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_blend_shape_track_insert_key:
|
|
|
|
|
|
-- :ref:`int<class_int>` **blend_shape_track_insert_key** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`float<class_float>` amount **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`int<class_int>` **blend_shape_track_insert_key** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`float<class_float>` amount **)**
|
|
|
|
|
|
Inserts a key in a given blend shape track. Returns the key index.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_clear:
|
|
|
|
|
|
-- void **clear** **(** **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+void **clear** **(** **)**
|
|
|
|
|
|
Clear the animation (clear all tracks and reset all).
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_compress:
|
|
|
|
|
|
-- void **compress** **(** :ref:`int<class_int>` page_size=8192, :ref:`int<class_int>` fps=120, :ref:`float<class_float>` split_tolerance=4.0 **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
|
|
|
-Compress the animation and all its tracks in-place. This will make :ref:`track_is_compressed<class_Animation_method_track_is_compressed>` return ``true`` once called on this ``Animation``. Compressed tracks require less memory to be played, and are designed to be used for complex 3D animations (such as cutscenes) imported from external 3D software. Compression is lossy, but the difference is usually not noticeable in real world conditions.
|
|
|
+void **compress** **(** :ref:`int<class_int>` page_size=8192, :ref:`int<class_int>` fps=120, :ref:`float<class_float>` split_tolerance=4.0 **)**
|
|
|
+
|
|
|
+Compress the animation and all its tracks in-place. This will make :ref:`track_is_compressed<class_Animation_method_track_is_compressed>` return ``true`` once called on this **Animation**. Compressed tracks require less memory to be played, and are designed to be used for complex 3D animations (such as cutscenes) imported from external 3D software. Compression is lossy, but the difference is usually not noticeable in real world conditions.
|
|
|
|
|
|
\ **Note:** Compressed tracks have various limitations (such as not being editable from the editor), so only use compressed animations if you actually need them.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_copy_track:
|
|
|
|
|
|
-- void **copy_track** **(** :ref:`int<class_int>` track_idx, :ref:`Animation<class_Animation>` to_animation **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+void **copy_track** **(** :ref:`int<class_int>` track_idx, :ref:`Animation<class_Animation>` to_animation **)**
|
|
|
|
|
|
Adds a new track that is a copy of the given track from ``to_animation``.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_find_track:
|
|
|
|
|
|
-- :ref:`int<class_int>` **find_track** **(** :ref:`NodePath<class_NodePath>` path, :ref:`TrackType<enum_Animation_TrackType>` type **)** |const|
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`int<class_int>` **find_track** **(** :ref:`NodePath<class_NodePath>` path, :ref:`TrackType<enum_Animation_TrackType>` type **)** |const|
|
|
|
|
|
|
Returns the index of the specified track. If the track is not found, return -1.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_get_track_count:
|
|
|
|
|
|
-- :ref:`int<class_int>` **get_track_count** **(** **)** |const|
|
|
|
+.. rst-class:: classref-method
|
|
|
|
|
|
-Returns the amount of tracks in the animation.
|
|
|
-
|
|
|
-----
|
|
|
-
|
|
|
-.. _class_Animation_method_method_track_get_key_indices:
|
|
|
+:ref:`int<class_int>` **get_track_count** **(** **)** |const|
|
|
|
|
|
|
-- :ref:`PackedInt32Array<class_PackedInt32Array>` **method_track_get_key_indices** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time_sec, :ref:`float<class_float>` delta **)** |const|
|
|
|
+Returns the amount of tracks in the animation.
|
|
|
|
|
|
-Returns all the key indices of a method track, given a position and delta time.
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_method_track_get_name:
|
|
|
|
|
|
-- :ref:`StringName<class_StringName>` **method_track_get_name** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`StringName<class_StringName>` **method_track_get_name** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
|
|
|
|
|
|
Returns the method name of a method track.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_method_track_get_params:
|
|
|
|
|
|
-- :ref:`Array<class_Array>` **method_track_get_params** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`Array<class_Array>` **method_track_get_params** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
|
|
|
|
|
|
Returns the arguments values to be called on a method track for a given key in a given track.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_position_track_insert_key:
|
|
|
|
|
|
-- :ref:`int<class_int>` **position_track_insert_key** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Vector3<class_Vector3>` position **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`int<class_int>` **position_track_insert_key** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Vector3<class_Vector3>` position **)**
|
|
|
|
|
|
Inserts a key in a given 3D position track. Returns the key index.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_remove_track:
|
|
|
|
|
|
-- void **remove_track** **(** :ref:`int<class_int>` track_idx **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+void **remove_track** **(** :ref:`int<class_int>` track_idx **)**
|
|
|
|
|
|
Removes a track by specifying the track index.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_rotation_track_insert_key:
|
|
|
|
|
|
-- :ref:`int<class_int>` **rotation_track_insert_key** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Quaternion<class_Quaternion>` rotation **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`int<class_int>` **rotation_track_insert_key** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Quaternion<class_Quaternion>` rotation **)**
|
|
|
|
|
|
Inserts a key in a given 3D rotation track. Returns the key index.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_scale_track_insert_key:
|
|
|
|
|
|
-- :ref:`int<class_int>` **scale_track_insert_key** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Vector3<class_Vector3>` scale **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`int<class_int>` **scale_track_insert_key** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Vector3<class_Vector3>` scale **)**
|
|
|
|
|
|
Inserts a key in a given 3D scale track. Returns the key index.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_track_find_key:
|
|
|
|
|
|
-- :ref:`int<class_int>` **track_find_key** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`bool<class_bool>` exact=false **)** |const|
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`int<class_int>` **track_find_key** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`bool<class_bool>` exact=false **)** |const|
|
|
|
|
|
|
Finds the key index by time in a given track. Optionally, only find it if the exact time is given.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_track_get_interpolation_loop_wrap:
|
|
|
|
|
|
-- :ref:`bool<class_bool>` **track_get_interpolation_loop_wrap** **(** :ref:`int<class_int>` track_idx **)** |const|
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`bool<class_bool>` **track_get_interpolation_loop_wrap** **(** :ref:`int<class_int>` track_idx **)** |const|
|
|
|
|
|
|
Returns ``true`` if the track at ``track_idx`` wraps the interpolation loop. New tracks wrap the interpolation loop by default.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_track_get_interpolation_type:
|
|
|
|
|
|
-- :ref:`InterpolationType<enum_Animation_InterpolationType>` **track_get_interpolation_type** **(** :ref:`int<class_int>` track_idx **)** |const|
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`InterpolationType<enum_Animation_InterpolationType>` **track_get_interpolation_type** **(** :ref:`int<class_int>` track_idx **)** |const|
|
|
|
|
|
|
Returns the interpolation type of a given track.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_track_get_key_count:
|
|
|
|
|
|
-- :ref:`int<class_int>` **track_get_key_count** **(** :ref:`int<class_int>` track_idx **)** |const|
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`int<class_int>` **track_get_key_count** **(** :ref:`int<class_int>` track_idx **)** |const|
|
|
|
|
|
|
Returns the number of keys in a given track.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_track_get_key_time:
|
|
|
|
|
|
-- :ref:`float<class_float>` **track_get_key_time** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`float<class_float>` **track_get_key_time** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
|
|
|
|
|
|
Returns the time at which the key is located.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_track_get_key_transition:
|
|
|
|
|
|
-- :ref:`float<class_float>` **track_get_key_transition** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`float<class_float>` **track_get_key_transition** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
|
|
|
|
|
|
Returns the transition curve (easing) for a specific key (see the built-in math function :ref:`@GlobalScope.ease<class_@GlobalScope_method_ease>`).
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_track_get_key_value:
|
|
|
|
|
|
-- :ref:`Variant<class_Variant>` **track_get_key_value** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`Variant<class_Variant>` **track_get_key_value** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)** |const|
|
|
|
|
|
|
Returns the value of a given key in a given track.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_track_get_path:
|
|
|
|
|
|
-- :ref:`NodePath<class_NodePath>` **track_get_path** **(** :ref:`int<class_int>` track_idx **)** |const|
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`NodePath<class_NodePath>` **track_get_path** **(** :ref:`int<class_int>` track_idx **)** |const|
|
|
|
|
|
|
Gets the path of a track. For more information on the path format, see :ref:`track_set_path<class_Animation_method_track_set_path>`.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_track_get_type:
|
|
|
|
|
|
-- :ref:`TrackType<enum_Animation_TrackType>` **track_get_type** **(** :ref:`int<class_int>` track_idx **)** |const|
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`TrackType<enum_Animation_TrackType>` **track_get_type** **(** :ref:`int<class_int>` track_idx **)** |const|
|
|
|
|
|
|
Gets the type of a track.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_track_insert_key:
|
|
|
|
|
|
-- :ref:`int<class_int>` **track_insert_key** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Variant<class_Variant>` key, :ref:`float<class_float>` transition=1 **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`int<class_int>` **track_insert_key** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time, :ref:`Variant<class_Variant>` key, :ref:`float<class_float>` transition=1 **)**
|
|
|
|
|
|
Inserts a generic key in a given track. Returns the key index.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_track_is_compressed:
|
|
|
|
|
|
-- :ref:`bool<class_bool>` **track_is_compressed** **(** :ref:`int<class_int>` track_idx **)** |const|
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`bool<class_bool>` **track_is_compressed** **(** :ref:`int<class_int>` track_idx **)** |const|
|
|
|
|
|
|
Returns ``true`` if the track is compressed, ``false`` otherwise. See also :ref:`compress<class_Animation_method_compress>`.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_track_is_enabled:
|
|
|
|
|
|
-- :ref:`bool<class_bool>` **track_is_enabled** **(** :ref:`int<class_int>` track_idx **)** |const|
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`bool<class_bool>` **track_is_enabled** **(** :ref:`int<class_int>` track_idx **)** |const|
|
|
|
|
|
|
Returns ``true`` if the track at index ``track_idx`` is enabled.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_track_is_imported:
|
|
|
|
|
|
-- :ref:`bool<class_bool>` **track_is_imported** **(** :ref:`int<class_int>` track_idx **)** |const|
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`bool<class_bool>` **track_is_imported** **(** :ref:`int<class_int>` track_idx **)** |const|
|
|
|
|
|
|
Returns ``true`` if the given track is imported. Else, return ``false``.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_track_move_down:
|
|
|
|
|
|
-- void **track_move_down** **(** :ref:`int<class_int>` track_idx **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+void **track_move_down** **(** :ref:`int<class_int>` track_idx **)**
|
|
|
|
|
|
Moves a track down.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_track_move_to:
|
|
|
|
|
|
-- void **track_move_to** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` to_idx **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+void **track_move_to** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` to_idx **)**
|
|
|
|
|
|
Changes the index position of track ``track_idx`` to the one defined in ``to_idx``.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_track_move_up:
|
|
|
|
|
|
-- void **track_move_up** **(** :ref:`int<class_int>` track_idx **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+void **track_move_up** **(** :ref:`int<class_int>` track_idx **)**
|
|
|
|
|
|
Moves a track up.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_track_remove_key:
|
|
|
|
|
|
-- void **track_remove_key** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+void **track_remove_key** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx **)**
|
|
|
|
|
|
Removes a key by index in a given track.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_track_remove_key_at_time:
|
|
|
|
|
|
-- void **track_remove_key_at_time** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+void **track_remove_key_at_time** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time **)**
|
|
|
|
|
|
Removes a key at ``time`` in a given track.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_track_set_enabled:
|
|
|
|
|
|
-- void **track_set_enabled** **(** :ref:`int<class_int>` track_idx, :ref:`bool<class_bool>` enabled **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+void **track_set_enabled** **(** :ref:`int<class_int>` track_idx, :ref:`bool<class_bool>` enabled **)**
|
|
|
|
|
|
Enables/disables the given track. Tracks are enabled by default.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_track_set_imported:
|
|
|
|
|
|
-- void **track_set_imported** **(** :ref:`int<class_int>` track_idx, :ref:`bool<class_bool>` imported **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+void **track_set_imported** **(** :ref:`int<class_int>` track_idx, :ref:`bool<class_bool>` imported **)**
|
|
|
|
|
|
Sets the given track as imported or not.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_track_set_interpolation_loop_wrap:
|
|
|
|
|
|
-- void **track_set_interpolation_loop_wrap** **(** :ref:`int<class_int>` track_idx, :ref:`bool<class_bool>` interpolation **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+void **track_set_interpolation_loop_wrap** **(** :ref:`int<class_int>` track_idx, :ref:`bool<class_bool>` interpolation **)**
|
|
|
|
|
|
If ``true``, the track at ``track_idx`` wraps the interpolation loop.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_track_set_interpolation_type:
|
|
|
|
|
|
-- void **track_set_interpolation_type** **(** :ref:`int<class_int>` track_idx, :ref:`InterpolationType<enum_Animation_InterpolationType>` interpolation **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+void **track_set_interpolation_type** **(** :ref:`int<class_int>` track_idx, :ref:`InterpolationType<enum_Animation_InterpolationType>` interpolation **)**
|
|
|
|
|
|
Sets the interpolation type of a given track.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_track_set_key_time:
|
|
|
|
|
|
-- void **track_set_key_time** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` time **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+void **track_set_key_time** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` time **)**
|
|
|
|
|
|
Sets the time of an existing key.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_track_set_key_transition:
|
|
|
|
|
|
-- void **track_set_key_transition** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` transition **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+void **track_set_key_transition** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key_idx, :ref:`float<class_float>` transition **)**
|
|
|
|
|
|
Sets the transition curve (easing) for a specific key (see the built-in math function :ref:`@GlobalScope.ease<class_@GlobalScope_method_ease>`).
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_track_set_key_value:
|
|
|
|
|
|
-- void **track_set_key_value** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key, :ref:`Variant<class_Variant>` value **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+void **track_set_key_value** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` key, :ref:`Variant<class_Variant>` value **)**
|
|
|
|
|
|
Sets the value of an existing key.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_track_set_path:
|
|
|
|
|
|
-- void **track_set_path** **(** :ref:`int<class_int>` track_idx, :ref:`NodePath<class_NodePath>` path **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+void **track_set_path** **(** :ref:`int<class_int>` track_idx, :ref:`NodePath<class_NodePath>` path **)**
|
|
|
|
|
|
Sets the path of a track. Paths must be valid scene-tree paths to a node and must be specified starting from the parent node of the node that will reproduce the animation. Tracks that control properties or bones must append their name after the path, separated by ``":"``.
|
|
|
|
|
|
For example, ``"character/skeleton:ankle"`` or ``"character/mesh:transform/local"``.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_track_swap:
|
|
|
|
|
|
-- void **track_swap** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` with_idx **)**
|
|
|
-
|
|
|
-Swaps the track ``track_idx``'s index position with the track ``with_idx``.
|
|
|
-
|
|
|
-----
|
|
|
+.. rst-class:: classref-method
|
|
|
|
|
|
-.. _class_Animation_method_value_track_get_key_indices:
|
|
|
+void **track_swap** **(** :ref:`int<class_int>` track_idx, :ref:`int<class_int>` with_idx **)**
|
|
|
|
|
|
-- :ref:`PackedInt32Array<class_PackedInt32Array>` **value_track_get_key_indices** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time_sec, :ref:`float<class_float>` delta **)** |const|
|
|
|
+Swaps the track ``track_idx``'s index position with the track ``with_idx``.
|
|
|
|
|
|
-Returns all the key indices of a value track, given a position and delta time.
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_value_track_get_update_mode:
|
|
|
|
|
|
-- :ref:`UpdateMode<enum_Animation_UpdateMode>` **value_track_get_update_mode** **(** :ref:`int<class_int>` track_idx **)** |const|
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`UpdateMode<enum_Animation_UpdateMode>` **value_track_get_update_mode** **(** :ref:`int<class_int>` track_idx **)** |const|
|
|
|
|
|
|
Returns the update mode of a value track.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_value_track_interpolate:
|
|
|
|
|
|
-- :ref:`Variant<class_Variant>` **value_track_interpolate** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time_sec **)** |const|
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+:ref:`Variant<class_Variant>` **value_track_interpolate** **(** :ref:`int<class_int>` track_idx, :ref:`float<class_float>` time_sec **)** |const|
|
|
|
|
|
|
Returns the interpolated value at the given time (in seconds). The ``track_idx`` must be the index of a value track.
|
|
|
|
|
|
+.. rst-class:: classref-item-separator
|
|
|
+
|
|
|
----
|
|
|
|
|
|
.. _class_Animation_method_value_track_set_update_mode:
|
|
|
|
|
|
-- void **value_track_set_update_mode** **(** :ref:`int<class_int>` track_idx, :ref:`UpdateMode<enum_Animation_UpdateMode>` mode **)**
|
|
|
+.. rst-class:: classref-method
|
|
|
+
|
|
|
+void **value_track_set_update_mode** **(** :ref:`int<class_int>` track_idx, :ref:`UpdateMode<enum_Animation_UpdateMode>` mode **)**
|
|
|
|
|
|
Sets the update mode (see :ref:`UpdateMode<enum_Animation_UpdateMode>`) of a value track.
|
|
|
|