mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-04 10:09:56 +03:00
1562 lines
117 KiB
ReStructuredText
1562 lines
117 KiB
ReStructuredText
:github_url: hide
|
||
|
||
.. _class_Animation:
|
||
|
||
Animation
|
||
=========
|
||
|
||
**Наследует:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
|
||
|
||
Содержит данные, которые можно использовать для анимации чего угодно в движке.
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
Описание
|
||
----------------
|
||
|
||
Этот ресурс содержит данные, которые можно использовать для анимации чего угодно в движке. Анимации делятся на треки, и каждый трек должен быть связан с узлом. Состояние этого узла можно изменять с течением времени, добавляя к треку временные ключи (события).
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
# Это создает анимацию, которая заставляет узел «Enemy» двигаться вправо
|
||
# 100 пикселей за 2,0 секунды.
|
||
var animation = Animation.new()
|
||
var track_index = animation.add_track(Animation.TYPE_VALUE)
|
||
animation.track_set_path(track_index, "Enemy:position:x")
|
||
animation.track_insert_key(track_index, 0.0, 0)
|
||
animation.track_insert_key(track_index, 2.0, 100)
|
||
animation.length = 2.0
|
||
|
||
.. code-tab:: csharp
|
||
|
||
// Это создает анимацию, которая заставляет узел «Enemy» двигаться вправо
|
||
// 100 пикселей за 2,0 секунды.
|
||
var animation = new Animation();
|
||
int trackIndex = animation.AddTrack(Animation.TrackType.Value);
|
||
animation.TrackSetPath(trackIndex, "Enemy:position:x");
|
||
animation.TrackInsertKey(trackIndex, 0.0f, 0);
|
||
animation.TrackInsertKey(trackIndex, 2.0f, 100);
|
||
animation.Length = 2.0f;
|
||
|
||
|
||
|
||
Анимации — это всего лишь контейнеры данных, и их необходимо добавлять к узлам, таким как :ref:`AnimationPlayer<class_AnimationPlayer>`, чтобы воспроизводить их. Треки анимации имеют разные типы, каждый со своим собственным набором выделенных методов. Проверьте :ref:`TrackType<enum_Animation_TrackType>`, чтобы увидеть доступные типы.
|
||
|
||
\ **Примечание:** Для 3D-положения/вращения/масштаба рекомендуется использовать выделенные типы дорожек :ref:`TYPE_POSITION_3D<class_Animation_constant_TYPE_POSITION_3D>`, :ref:`TYPE_ROTATION_3D<class_Animation_constant_TYPE_ROTATION_3D>` и :ref:`TYPE_SCALE_3D<class_Animation_constant_TYPE_SCALE_3D>` вместо :ref:`TYPE_VALUE<class_Animation_constant_TYPE_VALUE>` из соображений производительности.
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
Обучающие материалы
|
||
--------------------------------------
|
||
|
||
- :doc:`Индекс документации по анимации <../tutorials/animation/index>`
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
Свойства
|
||
----------------
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+------------------------------------------+--------------------------------------------------------------------+-----------------+
|
||
| :ref:`bool<class_bool>` | :ref:`capture_included<class_Animation_property_capture_included>` | ``false`` |
|
||
+------------------------------------------+--------------------------------------------------------------------+-----------------+
|
||
| :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.033333335`` |
|
||
+------------------------------------------+--------------------------------------------------------------------+-----------------+
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
Методы
|
||
------------
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`add_marker<class_Animation_method_add_marker>`\ (\ name\: :ref:`StringName<class_StringName>`, time\: :ref:`float<class_float>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`add_track<class_Animation_method_add_track>`\ (\ type\: :ref:`TrackType<enum_Animation_TrackType>`, at_position\: :ref:`int<class_int>` = -1\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`StringName<class_StringName>` | :ref:`animation_track_get_key_animation<class_Animation_method_animation_track_get_key_animation>`\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`animation_track_insert_key<class_Animation_method_animation_track_insert_key>`\ (\ track_idx\: :ref:`int<class_int>`, time\: :ref:`float<class_float>`, animation\: :ref:`StringName<class_StringName>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`animation_track_set_key_animation<class_Animation_method_animation_track_set_key_animation>`\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`, animation\: :ref:`StringName<class_StringName>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`audio_track_get_key_end_offset<class_Animation_method_audio_track_get_key_end_offset>`\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`audio_track_get_key_start_offset<class_Animation_method_audio_track_get_key_start_offset>`\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Resource<class_Resource>` | :ref:`audio_track_get_key_stream<class_Animation_method_audio_track_get_key_stream>`\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`audio_track_insert_key<class_Animation_method_audio_track_insert_key>`\ (\ track_idx\: :ref:`int<class_int>`, time\: :ref:`float<class_float>`, stream\: :ref:`Resource<class_Resource>`, start_offset\: :ref:`float<class_float>` = 0, end_offset\: :ref:`float<class_float>` = 0\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`audio_track_is_use_blend<class_Animation_method_audio_track_is_use_blend>`\ (\ track_idx\: :ref:`int<class_int>`\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`audio_track_set_key_end_offset<class_Animation_method_audio_track_set_key_end_offset>`\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`, offset\: :ref:`float<class_float>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`audio_track_set_key_start_offset<class_Animation_method_audio_track_set_key_start_offset>`\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`, offset\: :ref:`float<class_float>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`audio_track_set_key_stream<class_Animation_method_audio_track_set_key_stream>`\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`, stream\: :ref:`Resource<class_Resource>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`audio_track_set_use_blend<class_Animation_method_audio_track_set_use_blend>`\ (\ track_idx\: :ref:`int<class_int>`, enable\: :ref:`bool<class_bool>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Vector2<class_Vector2>` | :ref:`bezier_track_get_key_in_handle<class_Animation_method_bezier_track_get_key_in_handle>`\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Vector2<class_Vector2>` | :ref:`bezier_track_get_key_out_handle<class_Animation_method_bezier_track_get_key_out_handle>`\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`bezier_track_get_key_value<class_Animation_method_bezier_track_get_key_value>`\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`bezier_track_insert_key<class_Animation_method_bezier_track_insert_key>`\ (\ track_idx\: :ref:`int<class_int>`, time\: :ref:`float<class_float>`, value\: :ref:`float<class_float>`, in_handle\: :ref:`Vector2<class_Vector2>` = Vector2(0, 0), out_handle\: :ref:`Vector2<class_Vector2>` = Vector2(0, 0)\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`bezier_track_interpolate<class_Animation_method_bezier_track_interpolate>`\ (\ track_idx\: :ref:`int<class_int>`, time\: :ref:`float<class_float>`\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`bezier_track_set_key_in_handle<class_Animation_method_bezier_track_set_key_in_handle>`\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`, in_handle\: :ref:`Vector2<class_Vector2>`, balanced_value_time_ratio\: :ref:`float<class_float>` = 1.0\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`bezier_track_set_key_out_handle<class_Animation_method_bezier_track_set_key_out_handle>`\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`, out_handle\: :ref:`Vector2<class_Vector2>`, balanced_value_time_ratio\: :ref:`float<class_float>` = 1.0\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`bezier_track_set_key_value<class_Animation_method_bezier_track_set_key_value>`\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`, value\: :ref:`float<class_float>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`blend_shape_track_insert_key<class_Animation_method_blend_shape_track_insert_key>`\ (\ track_idx\: :ref:`int<class_int>`, time\: :ref:`float<class_float>`, amount\: :ref:`float<class_float>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`blend_shape_track_interpolate<class_Animation_method_blend_shape_track_interpolate>`\ (\ track_idx\: :ref:`int<class_int>`, time_sec\: :ref:`float<class_float>`, backward\: :ref:`bool<class_bool>` = false\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`clear<class_Animation_method_clear>`\ (\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`compress<class_Animation_method_compress>`\ (\ page_size\: :ref:`int<class_int>` = 8192, fps\: :ref:`int<class_int>` = 120, split_tolerance\: :ref:`float<class_float>` = 4.0\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`copy_track<class_Animation_method_copy_track>`\ (\ track_idx\: :ref:`int<class_int>`, to_animation\: :ref:`Animation<class_Animation>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`find_track<class_Animation_method_find_track>`\ (\ path\: :ref:`NodePath<class_NodePath>`, type\: :ref:`TrackType<enum_Animation_TrackType>`\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`StringName<class_StringName>` | :ref:`get_marker_at_time<class_Animation_method_get_marker_at_time>`\ (\ time\: :ref:`float<class_float>`\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Color<class_Color>` | :ref:`get_marker_color<class_Animation_method_get_marker_color>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_marker_names<class_Animation_method_get_marker_names>`\ (\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`get_marker_time<class_Animation_method_get_marker_time>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`StringName<class_StringName>` | :ref:`get_next_marker<class_Animation_method_get_next_marker>`\ (\ time\: :ref:`float<class_float>`\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`StringName<class_StringName>` | :ref:`get_prev_marker<class_Animation_method_get_prev_marker>`\ (\ time\: :ref:`float<class_float>`\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`get_track_count<class_Animation_method_get_track_count>`\ (\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`has_marker<class_Animation_method_has_marker>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`StringName<class_StringName>` | :ref:`method_track_get_name<class_Animation_method_method_track_get_name>`\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Array<class_Array>` | :ref:`method_track_get_params<class_Animation_method_method_track_get_params>`\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`optimize<class_Animation_method_optimize>`\ (\ allowed_velocity_err\: :ref:`float<class_float>` = 0.01, allowed_angular_err\: :ref:`float<class_float>` = 0.01, precision\: :ref:`int<class_int>` = 3\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`position_track_insert_key<class_Animation_method_position_track_insert_key>`\ (\ track_idx\: :ref:`int<class_int>`, time\: :ref:`float<class_float>`, position\: :ref:`Vector3<class_Vector3>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Vector3<class_Vector3>` | :ref:`position_track_interpolate<class_Animation_method_position_track_interpolate>`\ (\ track_idx\: :ref:`int<class_int>`, time_sec\: :ref:`float<class_float>`, backward\: :ref:`bool<class_bool>` = false\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`remove_marker<class_Animation_method_remove_marker>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`remove_track<class_Animation_method_remove_track>`\ (\ track_idx\: :ref:`int<class_int>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`rotation_track_insert_key<class_Animation_method_rotation_track_insert_key>`\ (\ track_idx\: :ref:`int<class_int>`, time\: :ref:`float<class_float>`, rotation\: :ref:`Quaternion<class_Quaternion>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Quaternion<class_Quaternion>` | :ref:`rotation_track_interpolate<class_Animation_method_rotation_track_interpolate>`\ (\ track_idx\: :ref:`int<class_int>`, time_sec\: :ref:`float<class_float>`, backward\: :ref:`bool<class_bool>` = false\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`scale_track_insert_key<class_Animation_method_scale_track_insert_key>`\ (\ track_idx\: :ref:`int<class_int>`, time\: :ref:`float<class_float>`, scale\: :ref:`Vector3<class_Vector3>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Vector3<class_Vector3>` | :ref:`scale_track_interpolate<class_Animation_method_scale_track_interpolate>`\ (\ track_idx\: :ref:`int<class_int>`, time_sec\: :ref:`float<class_float>`, backward\: :ref:`bool<class_bool>` = false\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_marker_color<class_Animation_method_set_marker_color>`\ (\ name\: :ref:`StringName<class_StringName>`, color\: :ref:`Color<class_Color>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`track_find_key<class_Animation_method_track_find_key>`\ (\ track_idx\: :ref:`int<class_int>`, time\: :ref:`float<class_float>`, find_mode\: :ref:`FindMode<enum_Animation_FindMode>` = 0, limit\: :ref:`bool<class_bool>` = false, backward\: :ref:`bool<class_bool>` = false\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`track_get_interpolation_loop_wrap<class_Animation_method_track_get_interpolation_loop_wrap>`\ (\ track_idx\: :ref:`int<class_int>`\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`InterpolationType<enum_Animation_InterpolationType>` | :ref:`track_get_interpolation_type<class_Animation_method_track_get_interpolation_type>`\ (\ track_idx\: :ref:`int<class_int>`\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`track_get_key_count<class_Animation_method_track_get_key_count>`\ (\ track_idx\: :ref:`int<class_int>`\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`track_get_key_time<class_Animation_method_track_get_key_time>`\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`track_get_key_transition<class_Animation_method_track_get_key_transition>`\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Variant<class_Variant>` | :ref:`track_get_key_value<class_Animation_method_track_get_key_value>`\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`NodePath<class_NodePath>` | :ref:`track_get_path<class_Animation_method_track_get_path>`\ (\ track_idx\: :ref:`int<class_int>`\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`TrackType<enum_Animation_TrackType>` | :ref:`track_get_type<class_Animation_method_track_get_type>`\ (\ track_idx\: :ref:`int<class_int>`\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`int<class_int>` | :ref:`track_insert_key<class_Animation_method_track_insert_key>`\ (\ track_idx\: :ref:`int<class_int>`, time\: :ref:`float<class_float>`, key\: :ref:`Variant<class_Variant>`, transition\: :ref:`float<class_float>` = 1\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`track_is_compressed<class_Animation_method_track_is_compressed>`\ (\ track_idx\: :ref:`int<class_int>`\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`track_is_enabled<class_Animation_method_track_is_enabled>`\ (\ track_idx\: :ref:`int<class_int>`\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`track_is_imported<class_Animation_method_track_is_imported>`\ (\ track_idx\: :ref:`int<class_int>`\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`track_move_down<class_Animation_method_track_move_down>`\ (\ track_idx\: :ref:`int<class_int>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`track_move_to<class_Animation_method_track_move_to>`\ (\ track_idx\: :ref:`int<class_int>`, to_idx\: :ref:`int<class_int>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`track_move_up<class_Animation_method_track_move_up>`\ (\ track_idx\: :ref:`int<class_int>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`track_remove_key<class_Animation_method_track_remove_key>`\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`track_remove_key_at_time<class_Animation_method_track_remove_key_at_time>`\ (\ track_idx\: :ref:`int<class_int>`, time\: :ref:`float<class_float>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`track_set_enabled<class_Animation_method_track_set_enabled>`\ (\ track_idx\: :ref:`int<class_int>`, enabled\: :ref:`bool<class_bool>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`track_set_imported<class_Animation_method_track_set_imported>`\ (\ track_idx\: :ref:`int<class_int>`, imported\: :ref:`bool<class_bool>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`track_set_interpolation_loop_wrap<class_Animation_method_track_set_interpolation_loop_wrap>`\ (\ track_idx\: :ref:`int<class_int>`, interpolation\: :ref:`bool<class_bool>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`track_set_interpolation_type<class_Animation_method_track_set_interpolation_type>`\ (\ track_idx\: :ref:`int<class_int>`, interpolation\: :ref:`InterpolationType<enum_Animation_InterpolationType>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`track_set_key_time<class_Animation_method_track_set_key_time>`\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`, time\: :ref:`float<class_float>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`track_set_key_transition<class_Animation_method_track_set_key_transition>`\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`, transition\: :ref:`float<class_float>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`track_set_key_value<class_Animation_method_track_set_key_value>`\ (\ track_idx\: :ref:`int<class_int>`, key\: :ref:`int<class_int>`, value\: :ref:`Variant<class_Variant>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`track_set_path<class_Animation_method_track_set_path>`\ (\ track_idx\: :ref:`int<class_int>`, path\: :ref:`NodePath<class_NodePath>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`track_swap<class_Animation_method_track_swap>`\ (\ track_idx\: :ref:`int<class_int>`, with_idx\: :ref:`int<class_int>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`UpdateMode<enum_Animation_UpdateMode>` | :ref:`value_track_get_update_mode<class_Animation_method_value_track_get_update_mode>`\ (\ track_idx\: :ref:`int<class_int>`\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Variant<class_Variant>` | :ref:`value_track_interpolate<class_Animation_method_value_track_interpolate>`\ (\ track_idx\: :ref:`int<class_int>`, time_sec\: :ref:`float<class_float>`, backward\: :ref:`bool<class_bool>` = false\ ) |const| |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`value_track_set_update_mode<class_Animation_method_value_track_set_update_mode>`\ (\ track_idx\: :ref:`int<class_int>`, mode\: :ref:`UpdateMode<enum_Animation_UpdateMode>`\ ) |
|
||
+------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
Перечисления
|
||
------------------------
|
||
|
||
.. _enum_Animation_TrackType:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **TrackType**: :ref:`🔗<enum_Animation_TrackType>`
|
||
|
||
.. _class_Animation_constant_TYPE_VALUE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`TrackType<enum_Animation_TrackType>` **TYPE_VALUE** = ``0``
|
||
|
||
Значение отслеживает заданные значения в свойствах узла, но только те, которые можно интерполировать. Для 3D-позиции/вращения/масштаба рекомендуется использовать выделенных дорожек треков :ref:`TYPE_POSITION_3D<class_Animation_constant_TYPE_POSITION_3D>`, :ref:`TYPE_ROTATION_3D<class_Animation_constant_TYPE_ROTATION_3D>` и :ref:`TYPE_SCALE_3D<class_Animation_constant_TYPE_SCALE_3D>` вместо :ref:`TYPE_VALUE<class_Animation_constant_TYPE_VALUE>` по соображениям производительности.
|
||
|
||
.. _class_Animation_constant_TYPE_POSITION_3D:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`TrackType<enum_Animation_TrackType>` **TYPE_POSITION_3D** = ``1``
|
||
|
||
Трехмерная дорожка положения (значения хранятся в :ref:`Vector3<class_Vector3>`).
|
||
|
||
.. _class_Animation_constant_TYPE_ROTATION_3D:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`TrackType<enum_Animation_TrackType>` **TYPE_ROTATION_3D** = ``2``
|
||
|
||
Трехмерная дорожка вращения (значения хранятся в :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-масштаба (значения хранятся в :ref:`Vector3<class_Vector3>`).
|
||
|
||
.. _class_Animation_constant_TYPE_BLEND_SHAPE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`TrackType<enum_Animation_TrackType>` **TYPE_BLEND_SHAPE** = ``4``
|
||
|
||
Орбита смешанной формы.
|
||
|
||
.. _class_Animation_constant_TYPE_METHOD:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`TrackType<enum_Animation_TrackType>` **TYPE_METHOD** = ``5``
|
||
|
||
Метод отслеживает вызовы функций с заданными аргументами для каждого ключа.
|
||
|
||
.. _class_Animation_constant_TYPE_BEZIER:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`TrackType<enum_Animation_TrackType>` **TYPE_BEZIER** = ``6``
|
||
|
||
Дорожки Безье используются для интерполяции значения с использованием пользовательских кривых. Их также можно использовать для анимации подсвойств векторов и цветов (например, альфа-значение :ref:`Color<class_Color>`).
|
||
|
||
.. _class_Animation_constant_TYPE_AUDIO:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`TrackType<enum_Animation_TrackType>` **TYPE_AUDIO** = ``7``
|
||
|
||
Аудиодорожки используются для воспроизведения аудиопотока с любым типом :ref:`AudioStreamPlayer<class_AudioStreamPlayer>`. Поток можно обрезать и предварительно просмотреть в анимации.
|
||
|
||
.. _class_Animation_constant_TYPE_ANIMATION:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`TrackType<enum_Animation_TrackType>` **TYPE_ANIMATION** = ``8``
|
||
|
||
Анимационные дорожки воспроизводят анимацию в других узлах :ref:`AnimationPlayer<class_AnimationPlayer>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_Animation_InterpolationType:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **InterpolationType**: :ref:`🔗<enum_Animation_InterpolationType>`
|
||
|
||
.. _class_Animation_constant_INTERPOLATION_NEAREST:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`InterpolationType<enum_Animation_InterpolationType>` **INTERPOLATION_NEAREST** = ``0``
|
||
|
||
Без интерполяции (ближайшее значение).
|
||
|
||
.. _class_Animation_constant_INTERPOLATION_LINEAR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`InterpolationType<enum_Animation_InterpolationType>` **INTERPOLATION_LINEAR** = ``1``
|
||
|
||
Линейная интерполяция.
|
||
|
||
.. _class_Animation_constant_INTERPOLATION_CUBIC:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`InterpolationType<enum_Animation_InterpolationType>` **INTERPOLATION_CUBIC** = ``2``
|
||
|
||
Кубическая интерполяция. Выглядит более гладко, чем линейная интерполяция, но интерполяция более затратна. Придерживайтесь :ref:`INTERPOLATION_LINEAR<class_Animation_constant_INTERPOLATION_LINEAR>` для сложных 3D-анимаций, импортированных из внешнего программного обеспечения, даже если это требует использования более высокой частоты кадров анимации взамен.
|
||
|
||
.. _class_Animation_constant_INTERPOLATION_LINEAR_ANGLE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`InterpolationType<enum_Animation_InterpolationType>` **INTERPOLATION_LINEAR_ANGLE** = ``3``
|
||
|
||
Линейная интерполяция с вращением по кратчайшему пути.
|
||
|
||
\ **Примечание:** Значение результата всегда нормализовано и может не совпадать со значением ключа.
|
||
|
||
.. _class_Animation_constant_INTERPOLATION_CUBIC_ANGLE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`InterpolationType<enum_Animation_InterpolationType>` **INTERPOLATION_CUBIC_ANGLE** = ``4``
|
||
|
||
Кубическая интерполяция с вращением по кратчайшему пути.
|
||
|
||
\ **Примечание:** Значение результата всегда нормализовано и может не совпадать со значением ключа.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_Animation_UpdateMode:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **UpdateMode**: :ref:`🔗<enum_Animation_UpdateMode>`
|
||
|
||
.. _class_Animation_constant_UPDATE_CONTINUOUS:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`UpdateMode<enum_Animation_UpdateMode>` **UPDATE_CONTINUOUS** = ``0``
|
||
|
||
Обновляйте между ключевыми кадрами и сохраняйте значение.
|
||
|
||
.. _class_Animation_constant_UPDATE_DISCRETE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`UpdateMode<enum_Animation_UpdateMode>` **UPDATE_DISCRETE** = ``1``
|
||
|
||
Обновление на ключевых кадрах.
|
||
|
||
.. _class_Animation_constant_UPDATE_CAPTURE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`UpdateMode<enum_Animation_UpdateMode>` **UPDATE_CAPTURE** = ``2``
|
||
|
||
То же, что и :ref:`UPDATE_CONTINUOUS<class_Animation_constant_UPDATE_CONTINUOUS>`, но работает как флаг для захвата значения текущего объекта и выполнения интерполяции в некоторых методах. См. также :ref:`AnimationMixer.capture()<class_AnimationMixer_method_capture>`, :ref:`AnimationPlayer.playback_auto_capture<class_AnimationPlayer_property_playback_auto_capture>` и :ref:`AnimationPlayer.play_with_capture()<class_AnimationPlayer_method_play_with_capture>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_Animation_LoopMode:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **LoopMode**: :ref:`🔗<enum_Animation_LoopMode>`
|
||
|
||
.. _class_Animation_constant_LOOP_NONE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`LoopMode<enum_Animation_LoopMode>` **LOOP_NONE** = ``0``
|
||
|
||
В обоих случаях воспроизведение анимации остановится.
|
||
|
||
.. _class_Animation_constant_LOOP_LINEAR:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`LoopMode<enum_Animation_LoopMode>` **LOOP_LINEAR** = ``1``
|
||
|
||
В обоих концах анимации она будет повторяться без изменения направления воспроизведения.
|
||
|
||
.. _class_Animation_constant_LOOP_PINGPONG:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`LoopMode<enum_Animation_LoopMode>` **LOOP_PINGPONG** = ``2``
|
||
|
||
Повторяет воспроизведение и обратное воспроизведение в обоих концах анимации.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_Animation_LoopedFlag:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **LoopedFlag**: :ref:`🔗<enum_Animation_LoopedFlag>`
|
||
|
||
.. _class_Animation_constant_LOOPED_FLAG_NONE:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`LoopedFlag<enum_Animation_LoopedFlag>` **LOOPED_FLAG_NONE** = ``0``
|
||
|
||
Этот флаг указывает, что анимация выполняется без зацикливания.
|
||
|
||
.. _class_Animation_constant_LOOPED_FLAG_END:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`LoopedFlag<enum_Animation_LoopedFlag>` **LOOPED_FLAG_END** = ``1``
|
||
|
||
Этот флаг указывает на то, что анимация достигла конца и сразу после обработки цикла.
|
||
|
||
.. _class_Animation_constant_LOOPED_FLAG_START:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`LoopedFlag<enum_Animation_LoopedFlag>` **LOOPED_FLAG_START** = ``2``
|
||
|
||
Этот флаг указывает на то, что анимация достигла начала анимации и сразу после обработки цикла.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _enum_Animation_FindMode:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **FindMode**: :ref:`🔗<enum_Animation_FindMode>`
|
||
|
||
.. _class_Animation_constant_FIND_MODE_NEAREST:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`FindMode<enum_Animation_FindMode>` **FIND_MODE_NEAREST** = ``0``
|
||
|
||
Находит ближайший временной ключ.
|
||
|
||
.. _class_Animation_constant_FIND_MODE_APPROX:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`FindMode<enum_Animation_FindMode>` **FIND_MODE_APPROX** = ``1``
|
||
|
||
Находит только ключ с приблизительным временем.
|
||
|
||
.. _class_Animation_constant_FIND_MODE_EXACT:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`FindMode<enum_Animation_FindMode>` **FIND_MODE_EXACT** = ``2``
|
||
|
||
Находит только ключ с соответствующим временем.
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
Описания свойств
|
||
--------------------------------
|
||
|
||
.. _class_Animation_property_capture_included:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **capture_included** = ``false`` :ref:`🔗<class_Animation_property_capture_included>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- :ref:`bool<class_bool>` **is_capture_included**\ (\ )
|
||
|
||
Возвращает ``true``, если трек захвата включен. Это кэшированное значение только для чтения для производительности.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_property_length:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`float<class_float>` **length** = ``1.0`` :ref:`🔗<class_Animation_property_length>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_length**\ (\ value\: :ref:`float<class_float>`\ )
|
||
- :ref:`float<class_float>` **get_length**\ (\ )
|
||
|
||
Общая длина анимации (в секундах).
|
||
|
||
\ **Замечание:** Длина не ограничена последним ключом, так как он может находиться до или после конца для обеспечения корректной интерполяции и зацикливания.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_property_loop_mode:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`LoopMode<enum_Animation_LoopMode>` **loop_mode** = ``0`` :ref:`🔗<class_Animation_property_loop_mode>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_loop_mode**\ (\ value\: :ref:`LoopMode<enum_Animation_LoopMode>`\ )
|
||
- :ref:`LoopMode<enum_Animation_LoopMode>` **get_loop_mode**\ (\ )
|
||
|
||
Определяет поведение обоих концов временной шкалы анимации во время её воспроизведения. Это указывает, следует ли перезапускать анимацию и как это сделать, а также используется для корректной интерполяции циклов анимации.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_property_step:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`float<class_float>` **step** = ``0.033333335`` :ref:`🔗<class_Animation_property_step>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_step**\ (\ value\: :ref:`float<class_float>`\ )
|
||
- :ref:`float<class_float>` **get_step**\ (\ )
|
||
|
||
Значение шага анимации.
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
Описания метода
|
||
------------------------------
|
||
|
||
.. _class_Animation_method_add_marker:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **add_marker**\ (\ name\: :ref:`StringName<class_StringName>`, time\: :ref:`float<class_float>`\ ) :ref:`🔗<class_Animation_method_add_marker>`
|
||
|
||
Добавляет маркер к этой анимации.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_add_track:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **add_track**\ (\ type\: :ref:`TrackType<enum_Animation_TrackType>`, at_position\: :ref:`int<class_int>` = -1\ ) :ref:`🔗<class_Animation_method_add_track>`
|
||
|
||
Добавляет дорожку в анимацию.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_animation_track_get_key_animation:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`StringName<class_StringName>` **animation_track_get_key_animation**\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Animation_method_animation_track_get_key_animation>`
|
||
|
||
Возвращает имя анимации по ключу, идентифицированному ``key_idx``. ``track_idx`` должен быть индексом дорожки анимации.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_animation_track_insert_key:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **animation_track_insert_key**\ (\ track_idx\: :ref:`int<class_int>`, time\: :ref:`float<class_float>`, animation\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Animation_method_animation_track_insert_key>`
|
||
|
||
Вставляет ключ со значением ``animation`` в указанное ``time`` (в секундах). ``track_idx`` должен быть индексом анимационной дорожки.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_animation_track_set_key_animation:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **animation_track_set_key_animation**\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`, animation\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Animation_method_animation_track_set_key_animation>`
|
||
|
||
Устанавливает ключ, идентифицированный ``key_idx``, в значение ``animation``. ``track_idx`` должен быть индексом анимационной дорожки.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_audio_track_get_key_end_offset:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **audio_track_get_key_end_offset**\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Animation_method_audio_track_get_key_end_offset>`
|
||
|
||
Возвращает конечное смещение ключа, идентифицированного ``key_idx``. ``track_idx`` должен быть индексом аудиодорожки.
|
||
|
||
Конечное смещение — это количество секунд, обрезанных в конце аудиопотока.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_audio_track_get_key_start_offset:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **audio_track_get_key_start_offset**\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Animation_method_audio_track_get_key_start_offset>`
|
||
|
||
Возвращает начальное смещение ключа, идентифицированного ``key_idx``. ``track_idx`` должен быть индексом аудиодорожки.
|
||
|
||
Начальное смещение — это количество секунд, отрезанных в начале аудиопотока.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_audio_track_get_key_stream:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Resource<class_Resource>` **audio_track_get_key_stream**\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Animation_method_audio_track_get_key_stream>`
|
||
|
||
Возвращает аудиопоток ключа, идентифицированного ``key_idx``. ``track_idx`` должен быть индексом аудиодорожки.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_audio_track_insert_key:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **audio_track_insert_key**\ (\ track_idx\: :ref:`int<class_int>`, time\: :ref:`float<class_float>`, stream\: :ref:`Resource<class_Resource>`, start_offset\: :ref:`float<class_float>` = 0, end_offset\: :ref:`float<class_float>` = 0\ ) :ref:`🔗<class_Animation_method_audio_track_insert_key>`
|
||
|
||
Вставляет ключ аудиодорожки в указанное ``time`` в секундах. ``track_idx`` должен быть индексом аудиодорожки.
|
||
|
||
\ ``stream`` — ресурс :ref:`AudioStream<class_AudioStream>` для воспроизведения. ``start_offset`` — количество секунд, обрезанных в начале аудиопотока, а ``end_offset`` — в конце.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_audio_track_is_use_blend:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **audio_track_is_use_blend**\ (\ track_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Animation_method_audio_track_is_use_blend>`
|
||
|
||
Возвращает ``true``, если трек в ``track_idx`` будет смешан с другими анимациями.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_audio_track_set_key_end_offset:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **audio_track_set_key_end_offset**\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`, offset\: :ref:`float<class_float>`\ ) :ref:`🔗<class_Animation_method_audio_track_set_key_end_offset>`
|
||
|
||
Устанавливает конечное смещение ключа, идентифицированного ``key_idx``, на значение ``offset``. ``track_idx`` должен быть индексом аудиодорожки.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_audio_track_set_key_start_offset:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **audio_track_set_key_start_offset**\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`, offset\: :ref:`float<class_float>`\ ) :ref:`🔗<class_Animation_method_audio_track_set_key_start_offset>`
|
||
|
||
Устанавливает начальное смещение ключа, идентифицированного ``key_idx``, на значение ``offset``. ``track_idx`` должен быть индексом аудиодорожки.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_audio_track_set_key_stream:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **audio_track_set_key_stream**\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`, stream\: :ref:`Resource<class_Resource>`\ ) :ref:`🔗<class_Animation_method_audio_track_set_key_stream>`
|
||
|
||
Устанавливает поток ключа, идентифицированного ``key_idx``, на значение ``stream``. ``track_idx`` должен быть индексом аудиодорожки.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_audio_track_set_use_blend:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **audio_track_set_use_blend**\ (\ track_idx\: :ref:`int<class_int>`, enable\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_Animation_method_audio_track_set_use_blend>`
|
||
|
||
Устанавливает, будет ли трек смешиваться с другими анимациями. Если ``true``, громкость воспроизведения звука меняется в зависимости от значения смешивания.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_bezier_track_get_key_in_handle:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Vector2<class_Vector2>` **bezier_track_get_key_in_handle**\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Animation_method_bezier_track_get_key_in_handle>`
|
||
|
||
Возвращает дескриптор ключа, идентифицированного ``key_idx``. ``track_idx`` должен быть индексом дорожки Безье.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_bezier_track_get_key_out_handle:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Vector2<class_Vector2>` **bezier_track_get_key_out_handle**\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Animation_method_bezier_track_get_key_out_handle>`
|
||
|
||
Возвращает выходной дескриптор ключа, идентифицированного ``key_idx``. ``track_idx`` должен быть индексом дорожки Безье.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_bezier_track_get_key_value:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **bezier_track_get_key_value**\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Animation_method_bezier_track_get_key_value>`
|
||
|
||
Возвращает значение ключа, идентифицированного ``key_idx``. ``track_idx`` должен быть индексом дорожки Безье.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_bezier_track_insert_key:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **bezier_track_insert_key**\ (\ track_idx\: :ref:`int<class_int>`, time\: :ref:`float<class_float>`, value\: :ref:`float<class_float>`, in_handle\: :ref:`Vector2<class_Vector2>` = Vector2(0, 0), out_handle\: :ref:`Vector2<class_Vector2>` = Vector2(0, 0)\ ) :ref:`🔗<class_Animation_method_bezier_track_insert_key>`
|
||
|
||
Вставляет ключ дорожки Безье в указанное ``time`` в секундах. ``track_idx`` должен быть индексом дорожки Безье.
|
||
|
||
\ ``in_handle`` — вес левой стороны добавленной точки кривой Безье, ``out_handle`` — вес правой стороны, а ``value`` — фактическое значение в этой точке.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_bezier_track_interpolate:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **bezier_track_interpolate**\ (\ track_idx\: :ref:`int<class_int>`, time\: :ref:`float<class_float>`\ ) |const| :ref:`🔗<class_Animation_method_bezier_track_interpolate>`
|
||
|
||
Возвращает интерполированное значение в указанном ``time`` (в секундах). ``track_idx`` должен быть индексом дорожки Безье.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_bezier_track_set_key_in_handle:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **bezier_track_set_key_in_handle**\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`, in_handle\: :ref:`Vector2<class_Vector2>`, balanced_value_time_ratio\: :ref:`float<class_float>` = 1.0\ ) :ref:`🔗<class_Animation_method_bezier_track_set_key_in_handle>`
|
||
|
||
Устанавливает входной дескриптор ключа, идентифицированного ``key_idx``, на значение ``in_handle``. ``track_idx`` должен быть индексом дорожки Безье.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_bezier_track_set_key_out_handle:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **bezier_track_set_key_out_handle**\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`, out_handle\: :ref:`Vector2<class_Vector2>`, balanced_value_time_ratio\: :ref:`float<class_float>` = 1.0\ ) :ref:`🔗<class_Animation_method_bezier_track_set_key_out_handle>`
|
||
|
||
Устанавливает выходной дескриптор ключа, идентифицированного ``key_idx``, на значение ``out_handle``. ``track_idx`` должен быть индексом дорожки Безье.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_bezier_track_set_key_value:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **bezier_track_set_key_value**\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`, value\: :ref:`float<class_float>`\ ) :ref:`🔗<class_Animation_method_bezier_track_set_key_value>`
|
||
|
||
Устанавливает значение ключа, идентифицированного ``key_idx``, на заданное значение. ``track_idx`` должен быть индексом дорожки Безье.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_blend_shape_track_insert_key:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **blend_shape_track_insert_key**\ (\ track_idx\: :ref:`int<class_int>`, time\: :ref:`float<class_float>`, amount\: :ref:`float<class_float>`\ ) :ref:`🔗<class_Animation_method_blend_shape_track_insert_key>`
|
||
|
||
Вставляет ключ в заданную дорожку blend shape. Возвращает индекс ключа.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_blend_shape_track_interpolate:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **blend_shape_track_interpolate**\ (\ track_idx\: :ref:`int<class_int>`, time_sec\: :ref:`float<class_float>`, backward\: :ref:`bool<class_bool>` = false\ ) |const| :ref:`🔗<class_Animation_method_blend_shape_track_interpolate>`
|
||
|
||
Возвращает интерполированное значение формы смешивания в указанное время (в секундах). ``track_idx`` должен быть индексом трека формы смешивания.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_clear:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **clear**\ (\ ) :ref:`🔗<class_Animation_method_clear>`
|
||
|
||
Очистить анимацию (удалить все дорожки и сбросить всё).
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_compress:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **compress**\ (\ page_size\: :ref:`int<class_int>` = 8192, fps\: :ref:`int<class_int>` = 120, split_tolerance\: :ref:`float<class_float>` = 4.0\ ) :ref:`🔗<class_Animation_method_compress>`
|
||
|
||
Сжать анимацию и все ее дорожки на месте. Это заставит :ref:`track_is_compressed()<class_Animation_method_track_is_compressed>` возвращать ``true`` после вызова этой **Animation**. Сжатые дорожки требуют меньше памяти для воспроизведения и предназначены для использования в сложных 3D-анимациях (например, катсценах), импортированных из внешнего 3D-программного обеспечения. Сжатие происходит с потерями, но разница обычно не заметна в реальных условиях.
|
||
|
||
\ **Примечание:** Сжатые дорожки имеют различные ограничения (например, невозможность редактирования в редакторе), поэтому используйте сжатые анимации только в том случае, если они вам действительно нужны.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_copy_track:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **copy_track**\ (\ track_idx\: :ref:`int<class_int>`, to_animation\: :ref:`Animation<class_Animation>`\ ) :ref:`🔗<class_Animation_method_copy_track>`
|
||
|
||
Добавляет новый трек в ``to_animation``, который является копией указанного трека из этой анимации.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_find_track:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **find_track**\ (\ path\: :ref:`NodePath<class_NodePath>`, type\: :ref:`TrackType<enum_Animation_TrackType>`\ ) |const| :ref:`🔗<class_Animation_method_find_track>`
|
||
|
||
Возвращает индекс указанной дорожки. Если дорожка не найдена, возвращает -1.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_get_marker_at_time:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`StringName<class_StringName>` **get_marker_at_time**\ (\ time\: :ref:`float<class_float>`\ ) |const| :ref:`🔗<class_Animation_method_get_marker_at_time>`
|
||
|
||
Возвращает имя маркера, расположенного в указанное время.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_get_marker_color:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Color<class_Color>` **get_marker_color**\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Animation_method_get_marker_color>`
|
||
|
||
Возвращает цвет указанного маркера.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_get_marker_names:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`PackedStringArray<class_PackedStringArray>` **get_marker_names**\ (\ ) |const| :ref:`🔗<class_Animation_method_get_marker_names>`
|
||
|
||
Возвращает все маркеры в этой анимации, отсортированные по возрастанию времени.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_get_marker_time:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **get_marker_time**\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Animation_method_get_marker_time>`
|
||
|
||
Возвращает время указанного маркера.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_get_next_marker:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`StringName<class_StringName>` **get_next_marker**\ (\ time\: :ref:`float<class_float>`\ ) |const| :ref:`🔗<class_Animation_method_get_next_marker>`
|
||
|
||
Возвращает ближайший маркер, который следует после указанного времени. Если такого маркера не существует, возвращается пустая строка.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_get_prev_marker:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`StringName<class_StringName>` **get_prev_marker**\ (\ time\: :ref:`float<class_float>`\ ) |const| :ref:`🔗<class_Animation_method_get_prev_marker>`
|
||
|
||
Возвращает ближайший маркер, который предшествует указанному времени. Если такого маркера не существует, возвращается пустая строка.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_get_track_count:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **get_track_count**\ (\ ) |const| :ref:`🔗<class_Animation_method_get_track_count>`
|
||
|
||
Возвращает количество дорожек в анимации.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_has_marker:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **has_marker**\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_Animation_method_has_marker>`
|
||
|
||
Возвращает ``true``, если эта анимация содержит маркер с указанным именем.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_method_track_get_name:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`StringName<class_StringName>` **method_track_get_name**\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Animation_method_method_track_get_name>`
|
||
|
||
Возвращает имя метода для дорожки методов.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_method_track_get_params:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Array<class_Array>` **method_track_get_params**\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Animation_method_method_track_get_params>`
|
||
|
||
Возвращает значения аргументов, которые необходимо вызвать в дорожке метода для заданного ключа в заданной дорожке.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_optimize:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **optimize**\ (\ allowed_velocity_err\: :ref:`float<class_float>` = 0.01, allowed_angular_err\: :ref:`float<class_float>` = 0.01, precision\: :ref:`int<class_int>` = 3\ ) :ref:`🔗<class_Animation_method_optimize>`
|
||
|
||
Оптимизируйте анимацию и все ее дорожки на месте. Это сохранит только столько ключей, сколько необходимо для удержания анимации в указанных границах.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_position_track_insert_key:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **position_track_insert_key**\ (\ track_idx\: :ref:`int<class_int>`, time\: :ref:`float<class_float>`, position\: :ref:`Vector3<class_Vector3>`\ ) :ref:`🔗<class_Animation_method_position_track_insert_key>`
|
||
|
||
Вставляет ключ в заданную 3D-трек позиции. Возвращает индекс ключа.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_position_track_interpolate:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Vector3<class_Vector3>` **position_track_interpolate**\ (\ track_idx\: :ref:`int<class_int>`, time_sec\: :ref:`float<class_float>`, backward\: :ref:`bool<class_bool>` = false\ ) |const| :ref:`🔗<class_Animation_method_position_track_interpolate>`
|
||
|
||
Возвращает интерполированное значение позиции в указанное время (в секундах). ``track_idx`` должен быть индексом 3D-трека позиции.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_remove_marker:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **remove_marker**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_Animation_method_remove_marker>`
|
||
|
||
Удаляет маркер с указанным именем из этой анимации.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_remove_track:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **remove_track**\ (\ track_idx\: :ref:`int<class_int>`\ ) :ref:`🔗<class_Animation_method_remove_track>`
|
||
|
||
Удаляет дорожку, указав индекс дорожки.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_rotation_track_insert_key:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **rotation_track_insert_key**\ (\ track_idx\: :ref:`int<class_int>`, time\: :ref:`float<class_float>`, rotation\: :ref:`Quaternion<class_Quaternion>`\ ) :ref:`🔗<class_Animation_method_rotation_track_insert_key>`
|
||
|
||
Вставляет ключ в заданную 3D-дорожку вращения. Возвращает индекс ключа.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_rotation_track_interpolate:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Quaternion<class_Quaternion>` **rotation_track_interpolate**\ (\ track_idx\: :ref:`int<class_int>`, time_sec\: :ref:`float<class_float>`, backward\: :ref:`bool<class_bool>` = false\ ) |const| :ref:`🔗<class_Animation_method_rotation_track_interpolate>`
|
||
|
||
Возвращает интерполированное значение вращения в указанное время (в секундах). ``track_idx`` должен быть индексом 3D-трека вращения.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_scale_track_insert_key:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **scale_track_insert_key**\ (\ track_idx\: :ref:`int<class_int>`, time\: :ref:`float<class_float>`, scale\: :ref:`Vector3<class_Vector3>`\ ) :ref:`🔗<class_Animation_method_scale_track_insert_key>`
|
||
|
||
Вставляет ключ в заданную 3D-шкалу трека. Возвращает индекс ключа.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_scale_track_interpolate:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Vector3<class_Vector3>` **scale_track_interpolate**\ (\ track_idx\: :ref:`int<class_int>`, time_sec\: :ref:`float<class_float>`, backward\: :ref:`bool<class_bool>` = false\ ) |const| :ref:`🔗<class_Animation_method_scale_track_interpolate>`
|
||
|
||
Возвращает интерполированное значение масштаба в указанное время (в секундах). ``track_idx`` должен быть индексом 3D-масштабной дорожки.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_set_marker_color:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_marker_color**\ (\ name\: :ref:`StringName<class_StringName>`, color\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_Animation_method_set_marker_color>`
|
||
|
||
Устанавливает цвет указанного маркера.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_track_find_key:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **track_find_key**\ (\ track_idx\: :ref:`int<class_int>`, time\: :ref:`float<class_float>`, find_mode\: :ref:`FindMode<enum_Animation_FindMode>` = 0, limit\: :ref:`bool<class_bool>` = false, backward\: :ref:`bool<class_bool>` = false\ ) |const| :ref:`🔗<class_Animation_method_track_find_key>`
|
||
|
||
Находит индекс ключа по времени в заданном треке. При желании находит его только в том случае, если указано приблизительное/точное время.
|
||
|
||
Если ``limit`` равно ``true``, он не возвращает ключи за пределами диапазона анимации.
|
||
|
||
Если ``backward`` равно ``true``, направление меняется на противоположное в методах, которые полагаются на однонаправленную обработку.
|
||
|
||
Например, в случае, если ``find_mode`` равно :ref:`FIND_MODE_NEAREST<class_Animation_constant_FIND_MODE_NEAREST>`, если в текущей позиции сразу после искомого нет ключа, первый найденный ключ извлекается путем поиска перед позицией, но если ``backward`` равно ``true``, первый найденный ключ извлекается после позиции.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_track_get_interpolation_loop_wrap:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **track_get_interpolation_loop_wrap**\ (\ track_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Animation_method_track_get_interpolation_loop_wrap>`
|
||
|
||
Возвращает ``true``, если дорожка в ``track_idx`` оборачивает цикл интерполяции. Новые дорожки оборачивают цикл интерполяции по умолчанию.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_track_get_interpolation_type:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`InterpolationType<enum_Animation_InterpolationType>` **track_get_interpolation_type**\ (\ track_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Animation_method_track_get_interpolation_type>`
|
||
|
||
Возвращает тип интерполяции данной дорожки.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_track_get_key_count:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **track_get_key_count**\ (\ track_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Animation_method_track_get_key_count>`
|
||
|
||
Возвращает количество ключей в заданной дорожке.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_track_get_key_time:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **track_get_key_time**\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Animation_method_track_get_key_time>`
|
||
|
||
Возвращает время, в котором расположен ключ.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_track_get_key_transition:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`float<class_float>` **track_get_key_transition**\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Animation_method_track_get_key_transition>`
|
||
|
||
Возвращает кривую перехода (плавность) для определенной клавиши (см. встроенную математическую функцию :ref:`@GlobalScope.ease()<class_@GlobalScope_method_ease>`).
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_track_get_key_value:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Variant<class_Variant>` **track_get_key_value**\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Animation_method_track_get_key_value>`
|
||
|
||
Возвращает значение заданной клавиши в заданной дорожке.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_track_get_path:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`NodePath<class_NodePath>` **track_get_path**\ (\ track_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Animation_method_track_get_path>`
|
||
|
||
Получает путь к дорожке. Для получения дополнительной информации о формате пути см. `` метод track_set_path``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_track_get_type:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`TrackType<enum_Animation_TrackType>` **track_get_type**\ (\ track_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Animation_method_track_get_type>`
|
||
|
||
Получает тип дорожки.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_track_insert_key:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`int<class_int>` **track_insert_key**\ (\ track_idx\: :ref:`int<class_int>`, time\: :ref:`float<class_float>`, key\: :ref:`Variant<class_Variant>`, transition\: :ref:`float<class_float>` = 1\ ) :ref:`🔗<class_Animation_method_track_insert_key>`
|
||
|
||
Вставляет общий ключ в указанный трек. Возвращает индекс ключа.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_track_is_compressed:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **track_is_compressed**\ (\ track_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Animation_method_track_is_compressed>`
|
||
|
||
Возвращает ``true``, если трек сжат, ``false`` в противном случае. См. также :ref:`compress()<class_Animation_method_compress>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_track_is_enabled:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **track_is_enabled**\ (\ track_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Animation_method_track_is_enabled>`
|
||
|
||
Возвращает ``true``, если трек с индексом ``track_idx`` включен.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_track_is_imported:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **track_is_imported**\ (\ track_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Animation_method_track_is_imported>`
|
||
|
||
Возвращает ``true``, если указанная дорожка импортирована. В противном случае возвращает ``false``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_track_move_down:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **track_move_down**\ (\ track_idx\: :ref:`int<class_int>`\ ) :ref:`🔗<class_Animation_method_track_move_down>`
|
||
|
||
Перемещает дорожку вниз.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_track_move_to:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **track_move_to**\ (\ track_idx\: :ref:`int<class_int>`, to_idx\: :ref:`int<class_int>`\ ) :ref:`🔗<class_Animation_method_track_move_to>`
|
||
|
||
Изменяет индексную позицию дорожки ``track_idx`` на ту, которая определена в ``to_idx``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_track_move_up:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **track_move_up**\ (\ track_idx\: :ref:`int<class_int>`\ ) :ref:`🔗<class_Animation_method_track_move_up>`
|
||
|
||
Перемещает дорожку вверх.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_track_remove_key:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **track_remove_key**\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`\ ) :ref:`🔗<class_Animation_method_track_remove_key>`
|
||
|
||
Удаляет ключ по индексу из данной дорожки.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_track_remove_key_at_time:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **track_remove_key_at_time**\ (\ track_idx\: :ref:`int<class_int>`, time\: :ref:`float<class_float>`\ ) :ref:`🔗<class_Animation_method_track_remove_key_at_time>`
|
||
|
||
Удаляет ключ в ``time`` в указанном треке.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_track_set_enabled:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **track_set_enabled**\ (\ track_idx\: :ref:`int<class_int>`, enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_Animation_method_track_set_enabled>`
|
||
|
||
Включает/отключает данную дорожку. По умолчанию дорожки включены.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_track_set_imported:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **track_set_imported**\ (\ track_idx\: :ref:`int<class_int>`, imported\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_Animation_method_track_set_imported>`
|
||
|
||
Устанавливает, импортирован ли данная дорожка.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_track_set_interpolation_loop_wrap:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **track_set_interpolation_loop_wrap**\ (\ track_idx\: :ref:`int<class_int>`, interpolation\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_Animation_method_track_set_interpolation_loop_wrap>`
|
||
|
||
Если ``true``, дорожка с ``track_idx`` завершает цикл интерполяции.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_track_set_interpolation_type:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **track_set_interpolation_type**\ (\ track_idx\: :ref:`int<class_int>`, interpolation\: :ref:`InterpolationType<enum_Animation_InterpolationType>`\ ) :ref:`🔗<class_Animation_method_track_set_interpolation_type>`
|
||
|
||
Устанавливает тип интерполяции заданного трека.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_track_set_key_time:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **track_set_key_time**\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`, time\: :ref:`float<class_float>`\ ) :ref:`🔗<class_Animation_method_track_set_key_time>`
|
||
|
||
Устанавливает время существующего ключа.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_track_set_key_transition:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **track_set_key_transition**\ (\ track_idx\: :ref:`int<class_int>`, key_idx\: :ref:`int<class_int>`, transition\: :ref:`float<class_float>`\ ) :ref:`🔗<class_Animation_method_track_set_key_transition>`
|
||
|
||
Устанавливает кривую перехода (плавность) для определенной клавиши (см. встроенную математическую функцию :ref:`@GlobalScope.ease()<class_@GlobalScope_method_ease>`).
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_track_set_key_value:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **track_set_key_value**\ (\ track_idx\: :ref:`int<class_int>`, key\: :ref:`int<class_int>`, value\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_Animation_method_track_set_key_value>`
|
||
|
||
Устанавливает значение существующего ключа.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_track_set_path:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **track_set_path**\ (\ track_idx\: :ref:`int<class_int>`, path\: :ref:`NodePath<class_NodePath>`\ ) :ref:`🔗<class_Animation_method_track_set_path>`
|
||
|
||
Устанавливает путь дорожки. Пути должны быть допустимыми путями дерева сцены к узлу и должны быть указаны, начиная с :ref:`AnimationMixer.root_node<class_AnimationMixer_property_root_node>`, который будет воспроизводить анимацию. Дорожки, которые управляют свойствами или костями, должны добавлять свое имя после пути, разделенного ``":"``.
|
||
|
||
Например, ``"character/skeleton:ankle"`` или ``"character/mesh:transform/local"``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_track_swap:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **track_swap**\ (\ track_idx\: :ref:`int<class_int>`, with_idx\: :ref:`int<class_int>`\ ) :ref:`🔗<class_Animation_method_track_swap>`
|
||
|
||
Меняет индексную позицию дорожки ``track_idx`` на дорожку ``with_idx``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_value_track_get_update_mode:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`UpdateMode<enum_Animation_UpdateMode>` **value_track_get_update_mode**\ (\ track_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_Animation_method_value_track_get_update_mode>`
|
||
|
||
Возвращает режим обновления дорожки значений.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_value_track_interpolate:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Variant<class_Variant>` **value_track_interpolate**\ (\ track_idx\: :ref:`int<class_int>`, time_sec\: :ref:`float<class_float>`, backward\: :ref:`bool<class_bool>` = false\ ) |const| :ref:`🔗<class_Animation_method_value_track_interpolate>`
|
||
|
||
Возвращает интерполированное значение в указанное время (в секундах). ``track_idx`` должен быть индексом значения track.
|
||
|
||
\ ``backward`` в основном влияет на направление извлечения ключа track с :ref:`UPDATE_DISCRETE<class_Animation_constant_UPDATE_DISCRETE>`, преобразованным :ref:`AnimationMixer.ANIMATION_CALLBACK_MODE_DISCRETE_FORCE_CONTINUOUS<class_AnimationMixer_constant_ANIMATION_CALLBACK_MODE_DISCRETE_FORCE_CONTINUOUS>` для соответствия результату с :ref:`track_find_key()<class_Animation_method_track_find_key>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Animation_method_value_track_set_update_mode:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **value_track_set_update_mode**\ (\ track_idx\: :ref:`int<class_int>`, mode\: :ref:`UpdateMode<enum_Animation_UpdateMode>`\ ) :ref:`🔗<class_Animation_method_value_track_set_update_mode>`
|
||
|
||
Устанавливает режим обновления дорожки значений.
|
||
|
||
.. |virtual| replace:: :abbr:`virtual (Этот метод обычно должен быть переопределен пользователем, чтобы иметь какой-либо эффект.)`
|
||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||
.. |const| replace:: :abbr:`const (Этот метод не имеет побочных эффектов. Он не изменяет ни одну из переменных-членов экземпляра.)`
|
||
.. |vararg| replace:: :abbr:`vararg (Этот метод принимает любое количество аргументов после описанных здесь.)`
|
||
.. |constructor| replace:: :abbr:`constructor (Этот метод используется для создания типа.)`
|
||
.. |static| replace:: :abbr:`static (Этот метод не нуждается в вызове экземпляра, поэтому его можно вызвать напрямую, используя имя класса.)`
|
||
.. |operator| replace:: :abbr:`operator (Этот метод описывает допустимый оператор для использования с этим типом в качестве левого операнда.)`
|
||
.. |bitfield| replace:: :abbr:`BitField (Это значение является целым числом, составленным как битовая маска следующих флагов.)`
|
||
.. |void| replace:: :abbr:`void (Нет возвращаемого значения.)`
|