mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2025-12-31 09:49:22 +03:00
1560 lines
105 KiB
ReStructuredText
1560 lines
105 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" 的節點在 2 秒內向右移動 100 像素。
|
|
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" 的節點在 2 秒內向右移動 100 像素。
|
|
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``
|
|
|
|
3D 位置軌道(值儲存在 :ref:`Vector3<class_Vector3>` 中)。
|
|
|
|
.. _class_Animation_constant_TYPE_ROTATION_3D:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`TrackType<enum_Animation_TrackType>` **TYPE_ROTATION_3D** = ``2``
|
|
|
|
3D 旋轉軌道(值儲存在 :ref:`Quaternion<class_Quaternion>` 中)。
|
|
|
|
.. _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>` 的 Alpha 值)。
|
|
|
|
.. _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``
|
|
|
|
三次插值。較線性插值平滑但計算成本更高;對於自外部軟體匯入之複雜 3D 動畫,即便需提高影格率,也建議維持使用 :ref:`INTERPOLATION_LINEAR<class_Animation_constant_INTERPOLATION_LINEAR>`\ 。
|
|
|
|
.. _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**\ (\ )
|
|
|
|
Determines the behavior of both ends of the animation timeline during animation playback. This indicates whether and how the animation should be restarted, and is also used to correctly interpolate animation cycles.
|
|
|
|
.. 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>`
|
|
|
|
將標記新增到此 Animation。
|
|
|
|
.. 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>`
|
|
|
|
在指定 ``time``\ (秒)插入鍵,鍵值為 ``animation``\ 。\ ``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>`
|
|
|
|
若 ``track_idx`` 的軌道會與其他動畫混合則回傳 ``true``\ 。
|
|
|
|
.. 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>`
|
|
|
|
在指定的混合形狀軌道插入關鍵影格,並回傳其索引。
|
|
|
|
.. 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``\ 。壓縮軌道可降低播放時的記憶體用量,主要用於外部 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>`
|
|
|
|
依時間排序後,回傳此 Animation 內所有標記。
|
|
|
|
.. 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>`
|
|
|
|
若此 Animation 含有指定名稱的標記則回傳 ``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>`
|
|
|
|
從此 Animation 中移除具有指定名稱的標記。
|
|
|
|
.. 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>`
|
|
|
|
若 ``track_idx`` 處的軌道會環繞插值迴圈則返回 ``true``\ 。新建軌道預設皆會環繞插值迴圈。
|
|
|
|
.. 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>`
|
|
|
|
取得軌道的路徑。關於路徑格式的詳細資料,請參閱 :ref:`track_set_path()<class_Animation_method_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>`
|
|
|
|
若索引 ``track_idx`` 的軌道已啟用則返回 ``true``\ 。
|
|
|
|
.. 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`` 必須是值軌道的索引。
|
|
|
|
\ ``backward`` 主要影響將 :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 (無回傳值。)`
|