mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2025-12-31 09:49:22 +03:00
This reverts commit 57781dc0bc.
The rename, although in line with what we did in the engine, caused problems with RTD we need to fix (or push for a fix) first.
1562 lines
105 KiB
ReStructuredText
1562 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.0 秒内
|
||
# 向右移动 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.0 秒内
|
||
// 向右移动 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**\ (\ )
|
||
|
||
确定动画播放期间动画时间轴两端的行为。这指示动画是否应该以及应该如何重新启动,也用于动画循环的正确插值。
|
||
|
||
.. 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>`
|
||
|
||
在给定的 ``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>` 一旦在这个 **Animation** 上被调用就会返回 ``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>`
|
||
|
||
返回动画中的所有标记,按时间升序排列。
|
||
|
||
.. 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>`
|
||
|
||
如果 ``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:`track_find_key()<class_Animation_method_track_find_key>` 的结果一致,此处的轨道指根据 :ref:`AnimationMixer.ANIMATION_CALLBACK_MODE_DISCRETE_FORCE_CONTINUOUS<class_AnimationMixer_constant_ANIMATION_CALLBACK_MODE_DISCRETE_FORCE_CONTINUOUS>` 转换的 :ref:`UPDATE_DISCRETE<class_Animation_constant_UPDATE_DISCRETE>` 轨道。
|
||
|
||
.. 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 (无返回值。)`
|