12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565 |
- :github_url: hide
- .. DO NOT EDIT THIS FILE!!!
- .. Generated automatically from Godot engine sources.
- .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
- .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/Animation.xml.
- .. _class_Animation:
- Animation
- =========
- **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
- Holds data that can be used to animate anything in the engine.
- .. rst-class:: classref-introduction-group
- Description
- -----------
- This resource holds data that can be used to animate anything in the engine. Animations are divided into tracks and each track must be linked to a node. The state of that node can be changed through time, by adding timed keys (events) to the track.
- .. tabs::
- .. code-tab:: gdscript
- # This creates an animation that makes the node "Enemy" move to the right by
- # 100 pixels in 2.0 seconds.
- 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
- // This creates an animation that makes the node "Enemy" move to the right by
- // 100 pixels in 2.0 seconds.
- 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;
- Animations are just data containers, and must be added to nodes such as an :ref:`AnimationPlayer<class_AnimationPlayer>` to be played back. Animation tracks have different types, each with its own set of dedicated methods. Check :ref:`TrackType<enum_Animation_TrackType>` to see available types.
- \ **Note:** For 3D position/rotation/scale, using the dedicated :ref:`TYPE_POSITION_3D<class_Animation_constant_TYPE_POSITION_3D>`, :ref:`TYPE_ROTATION_3D<class_Animation_constant_TYPE_ROTATION_3D>` and :ref:`TYPE_SCALE_3D<class_Animation_constant_TYPE_SCALE_3D>` track types instead of :ref:`TYPE_VALUE<class_Animation_constant_TYPE_VALUE>` is recommended for performance reasons.
- .. rst-class:: classref-introduction-group
- Tutorials
- ---------
- - :doc:`Animation documentation index <../tutorials/animation/index>`
- .. rst-class:: classref-reftable-group
- Properties
- ----------
- .. 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.0333333`` |
- +------------------------------------------+--------------------------------------------------------------------+---------------+
- .. rst-class:: classref-reftable-group
- Methods
- -------
- .. 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
- Enumerations
- ------------
- .. _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``
- Value tracks set values in node properties, but only those which can be interpolated. For 3D position/rotation/scale, using the dedicated :ref:`TYPE_POSITION_3D<class_Animation_constant_TYPE_POSITION_3D>`, :ref:`TYPE_ROTATION_3D<class_Animation_constant_TYPE_ROTATION_3D>` and :ref:`TYPE_SCALE_3D<class_Animation_constant_TYPE_SCALE_3D>` track types instead of :ref:`TYPE_VALUE<class_Animation_constant_TYPE_VALUE>` is recommended for performance reasons.
- .. _class_Animation_constant_TYPE_POSITION_3D:
- .. rst-class:: classref-enumeration-constant
- :ref:`TrackType<enum_Animation_TrackType>` **TYPE_POSITION_3D** = ``1``
- 3D position track (values are stored in :ref:`Vector3<class_Vector3>`\ s).
- .. _class_Animation_constant_TYPE_ROTATION_3D:
- .. rst-class:: classref-enumeration-constant
- :ref:`TrackType<enum_Animation_TrackType>` **TYPE_ROTATION_3D** = ``2``
- 3D rotation track (values are stored in :ref:`Quaternion<class_Quaternion>`\ s).
- .. _class_Animation_constant_TYPE_SCALE_3D:
- .. rst-class:: classref-enumeration-constant
- :ref:`TrackType<enum_Animation_TrackType>` **TYPE_SCALE_3D** = ``3``
- 3D scale track (values are stored in :ref:`Vector3<class_Vector3>`\ s).
- .. _class_Animation_constant_TYPE_BLEND_SHAPE:
- .. rst-class:: classref-enumeration-constant
- :ref:`TrackType<enum_Animation_TrackType>` **TYPE_BLEND_SHAPE** = ``4``
- Blend shape track.
- .. _class_Animation_constant_TYPE_METHOD:
- .. rst-class:: classref-enumeration-constant
- :ref:`TrackType<enum_Animation_TrackType>` **TYPE_METHOD** = ``5``
- Method tracks call functions with given arguments per key.
- .. _class_Animation_constant_TYPE_BEZIER:
- .. rst-class:: classref-enumeration-constant
- :ref:`TrackType<enum_Animation_TrackType>` **TYPE_BEZIER** = ``6``
- Bezier tracks are used to interpolate a value using custom curves. They can also be used to animate sub-properties of vectors and colors (e.g. alpha value of a :ref:`Color<class_Color>`).
- .. _class_Animation_constant_TYPE_AUDIO:
- .. rst-class:: classref-enumeration-constant
- :ref:`TrackType<enum_Animation_TrackType>` **TYPE_AUDIO** = ``7``
- Audio tracks are used to play an audio stream with either type of :ref:`AudioStreamPlayer<class_AudioStreamPlayer>`. The stream can be trimmed and previewed in the animation.
- .. _class_Animation_constant_TYPE_ANIMATION:
- .. rst-class:: classref-enumeration-constant
- :ref:`TrackType<enum_Animation_TrackType>` **TYPE_ANIMATION** = ``8``
- Animation tracks play animations in other :ref:`AnimationPlayer<class_AnimationPlayer>` nodes.
- .. rst-class:: classref-item-separator
- ----
- .. _enum_Animation_InterpolationType:
- .. rst-class:: classref-enumeration
- enum **InterpolationType**: :ref:`๐<enum_Animation_InterpolationType>`
- .. _class_Animation_constant_INTERPOLATION_NEAREST:
- .. rst-class:: classref-enumeration-constant
- :ref:`InterpolationType<enum_Animation_InterpolationType>` **INTERPOLATION_NEAREST** = ``0``
- No interpolation (nearest value).
- .. _class_Animation_constant_INTERPOLATION_LINEAR:
- .. rst-class:: classref-enumeration-constant
- :ref:`InterpolationType<enum_Animation_InterpolationType>` **INTERPOLATION_LINEAR** = ``1``
- Linear interpolation.
- .. _class_Animation_constant_INTERPOLATION_CUBIC:
- .. rst-class:: classref-enumeration-constant
- :ref:`InterpolationType<enum_Animation_InterpolationType>` **INTERPOLATION_CUBIC** = ``2``
- Cubic interpolation. This looks smoother than linear interpolation, but is more expensive to interpolate. Stick to :ref:`INTERPOLATION_LINEAR<class_Animation_constant_INTERPOLATION_LINEAR>` for complex 3D animations imported from external software, even if it requires using a higher animation framerate in return.
- .. _class_Animation_constant_INTERPOLATION_LINEAR_ANGLE:
- .. rst-class:: classref-enumeration-constant
- :ref:`InterpolationType<enum_Animation_InterpolationType>` **INTERPOLATION_LINEAR_ANGLE** = ``3``
- Linear interpolation with shortest path rotation.
- \ **Note:** The result value is always normalized and may not match the key value.
- .. _class_Animation_constant_INTERPOLATION_CUBIC_ANGLE:
- .. rst-class:: classref-enumeration-constant
- :ref:`InterpolationType<enum_Animation_InterpolationType>` **INTERPOLATION_CUBIC_ANGLE** = ``4``
- Cubic interpolation with shortest path rotation.
- \ **Note:** The result value is always normalized and may not match the key value.
- .. rst-class:: classref-item-separator
- ----
- .. _enum_Animation_UpdateMode:
- .. rst-class:: classref-enumeration
- enum **UpdateMode**: :ref:`๐<enum_Animation_UpdateMode>`
- .. _class_Animation_constant_UPDATE_CONTINUOUS:
- .. rst-class:: classref-enumeration-constant
- :ref:`UpdateMode<enum_Animation_UpdateMode>` **UPDATE_CONTINUOUS** = ``0``
- Update between keyframes and hold the value.
- .. _class_Animation_constant_UPDATE_DISCRETE:
- .. rst-class:: classref-enumeration-constant
- :ref:`UpdateMode<enum_Animation_UpdateMode>` **UPDATE_DISCRETE** = ``1``
- Update at the keyframes.
- .. _class_Animation_constant_UPDATE_CAPTURE:
- .. rst-class:: classref-enumeration-constant
- :ref:`UpdateMode<enum_Animation_UpdateMode>` **UPDATE_CAPTURE** = ``2``
- Same as :ref:`UPDATE_CONTINUOUS<class_Animation_constant_UPDATE_CONTINUOUS>` but works as a flag to capture the value of the current object and perform interpolation in some methods. See also :ref:`AnimationMixer.capture()<class_AnimationMixer_method_capture>`, :ref:`AnimationPlayer.playback_auto_capture<class_AnimationPlayer_property_playback_auto_capture>`, and :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``
- At both ends of the animation, the animation will stop playing.
- .. _class_Animation_constant_LOOP_LINEAR:
- .. rst-class:: classref-enumeration-constant
- :ref:`LoopMode<enum_Animation_LoopMode>` **LOOP_LINEAR** = ``1``
- At both ends of the animation, the animation will be repeated without changing the playback direction.
- .. _class_Animation_constant_LOOP_PINGPONG:
- .. rst-class:: classref-enumeration-constant
- :ref:`LoopMode<enum_Animation_LoopMode>` **LOOP_PINGPONG** = ``2``
- Repeats playback and reverse playback at both ends of the animation.
- .. rst-class:: classref-item-separator
- ----
- .. _enum_Animation_LoopedFlag:
- .. rst-class:: classref-enumeration
- enum **LoopedFlag**: :ref:`๐<enum_Animation_LoopedFlag>`
- .. _class_Animation_constant_LOOPED_FLAG_NONE:
- .. rst-class:: classref-enumeration-constant
- :ref:`LoopedFlag<enum_Animation_LoopedFlag>` **LOOPED_FLAG_NONE** = ``0``
- This flag indicates that the animation proceeds without any looping.
- .. _class_Animation_constant_LOOPED_FLAG_END:
- .. rst-class:: classref-enumeration-constant
- :ref:`LoopedFlag<enum_Animation_LoopedFlag>` **LOOPED_FLAG_END** = ``1``
- This flag indicates that the animation has reached the end of the animation and just after loop processed.
- .. _class_Animation_constant_LOOPED_FLAG_START:
- .. rst-class:: classref-enumeration-constant
- :ref:`LoopedFlag<enum_Animation_LoopedFlag>` **LOOPED_FLAG_START** = ``2``
- This flag indicates that the animation has reached the start of the animation and just after loop processed.
- .. rst-class:: classref-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``
- Finds the nearest time key.
- .. _class_Animation_constant_FIND_MODE_APPROX:
- .. rst-class:: classref-enumeration-constant
- :ref:`FindMode<enum_Animation_FindMode>` **FIND_MODE_APPROX** = ``1``
- Finds only the key with approximating the time.
- .. _class_Animation_constant_FIND_MODE_EXACT:
- .. rst-class:: classref-enumeration-constant
- :ref:`FindMode<enum_Animation_FindMode>` **FIND_MODE_EXACT** = ``2``
- Finds only the key with matching the time.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Property Descriptions
- ---------------------
- .. _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**\ (\ )
- Returns ``true`` if the capture track is included. This is a cached readonly value for performance.
- .. 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**\ (\ )
- The total length of the animation (in seconds).
- \ **Note:** Length is not delimited by the last key, as this one may be before or after the end to ensure correct interpolation and looping.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_property_loop_mode:
- .. rst-class:: classref-property
- :ref:`LoopMode<enum_Animation_LoopMode>` **loop_mode** = ``0`` :ref:`๐<class_Animation_property_loop_mode>`
- .. rst-class:: classref-property-setget
- - |void| **set_loop_mode**\ (\ value\: :ref:`LoopMode<enum_Animation_LoopMode>`\ )
- - :ref:`LoopMode<enum_Animation_LoopMode>` **get_loop_mode**\ (\ )
- Determines the behavior of both ends of the animation timeline during animation playback. This is used for correct interpolation of animation cycles, and for hinting the player that it must restart the animation.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_property_step:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **step** = ``0.0333333`` :ref:`๐<class_Animation_property_step>`
- .. rst-class:: classref-property-setget
- - |void| **set_step**\ (\ value\: :ref:`float<class_float>`\ )
- - :ref:`float<class_float>` **get_step**\ (\ )
- The animation step value.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Method Descriptions
- -------------------
- .. _class_Animation_method_add_marker:
- .. rst-class:: classref-method
- |void| **add_marker**\ (\ name\: :ref:`StringName<class_StringName>`, time\: :ref:`float<class_float>`\ ) :ref:`๐<class_Animation_method_add_marker>`
- Adds a marker to this Animation.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_add_track:
- .. rst-class:: classref-method
- :ref:`int<class_int>` **add_track**\ (\ type\: :ref:`TrackType<enum_Animation_TrackType>`, at_position\: :ref:`int<class_int>` = -1\ ) :ref:`๐<class_Animation_method_add_track>`
- Adds a track to the Animation.
- .. 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>`
- Returns the animation name at the key identified by ``key_idx``. The ``track_idx`` must be the index of an Animation Track.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_animation_track_insert_key:
- .. 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>`
- Inserts a key with value ``animation`` at the given ``time`` (in seconds). The ``track_idx`` must be the index of an Animation Track.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_animation_track_set_key_animation:
- .. 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>`
- Sets the key identified by ``key_idx`` to value ``animation``. The ``track_idx`` must be the index of an Animation Track.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_audio_track_get_key_end_offset:
- .. 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>`
- Returns the end offset of the key identified by ``key_idx``. The ``track_idx`` must be the index of an Audio Track.
- End offset is the number of seconds cut off at the ending of the audio stream.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_audio_track_get_key_start_offset:
- .. 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>`
- Returns the start offset of the key identified by ``key_idx``. The ``track_idx`` must be the index of an Audio Track.
- Start offset is the number of seconds cut off at the beginning of the audio stream.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_audio_track_get_key_stream:
- .. 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>`
- Returns the audio stream of the key identified by ``key_idx``. The ``track_idx`` must be the index of an Audio Track.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_audio_track_insert_key:
- .. 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>`
- Inserts an Audio Track key at the given ``time`` in seconds. The ``track_idx`` must be the index of an Audio Track.
- \ ``stream`` is the :ref:`AudioStream<class_AudioStream>` resource to play. ``start_offset`` is the number of seconds cut off at the beginning of the audio stream, while ``end_offset`` is at the ending.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_audio_track_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>`
- Returns ``true`` if the track at ``track_idx`` will be blended with other animations.
- .. 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>`
- Sets the end offset of the key identified by ``key_idx`` to value ``offset``. The ``track_idx`` must be the index of an Audio Track.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_audio_track_set_key_start_offset:
- .. 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>`
- Sets the start offset of the key identified by ``key_idx`` to value ``offset``. The ``track_idx`` must be the index of an Audio Track.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_audio_track_set_key_stream:
- .. 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>`
- Sets the stream of the key identified by ``key_idx`` to value ``stream``. The ``track_idx`` must be the index of an Audio Track.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_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>`
- Sets whether the track will be blended with other animations. If ``true``, the audio playback volume changes depending on the blend value.
- .. 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>`
- Returns the in handle of the key identified by ``key_idx``. The ``track_idx`` must be the index of a Bezier Track.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_bezier_track_get_key_out_handle:
- .. 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>`
- Returns the out handle of the key identified by ``key_idx``. The ``track_idx`` must be the index of a Bezier Track.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_bezier_track_get_key_value:
- .. 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>`
- Returns the value of the key identified by ``key_idx``. The ``track_idx`` must be the index of a Bezier Track.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_bezier_track_insert_key:
- .. 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>`
- Inserts a Bezier Track key at the given ``time`` in seconds. The ``track_idx`` must be the index of a Bezier Track.
- \ ``in_handle`` is the left-side weight of the added Bezier curve point, ``out_handle`` is the right-side one, while ``value`` is the actual value at this point.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_bezier_track_interpolate:
- .. 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>`
- Returns the interpolated value at the given ``time`` (in seconds). The ``track_idx`` must be the index of a Bezier Track.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_bezier_track_set_key_in_handle:
- .. 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>`
- Sets the in handle of the key identified by ``key_idx`` to value ``in_handle``. The ``track_idx`` must be the index of a Bezier Track.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_bezier_track_set_key_out_handle:
- .. 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>`
- Sets the out handle of the key identified by ``key_idx`` to value ``out_handle``. The ``track_idx`` must be the index of a Bezier Track.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_bezier_track_set_key_value:
- .. 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>`
- Sets the value of the key identified by ``key_idx`` to the given value. The ``track_idx`` must be the index of a Bezier Track.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_blend_shape_track_insert_key:
- .. 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>`
- Inserts a key in a given blend shape track. Returns the key index.
- .. 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>`
- Returns the interpolated blend shape value at the given time (in seconds). The ``track_idx`` must be the index of a blend shape track.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_clear:
- .. rst-class:: classref-method
- |void| **clear**\ (\ ) :ref:`๐<class_Animation_method_clear>`
- Clear the animation (clear all tracks and reset all).
- .. 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>`
- Compress the animation and all its tracks in-place. This will make :ref:`track_is_compressed()<class_Animation_method_track_is_compressed>` return ``true`` once called on this **Animation**. Compressed tracks require less memory to be played, and are designed to be used for complex 3D animations (such as cutscenes) imported from external 3D software. Compression is lossy, but the difference is usually not noticeable in real world conditions.
- \ **Note:** Compressed tracks have various limitations (such as not being editable from the editor), so only use compressed animations if you actually need them.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_copy_track:
- .. 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>`
- Adds a new track to ``to_animation`` that is a copy of the given track from this 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>`
- Returns the index of the specified track. If the track is not found, return -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>`
- Returns the name of the marker located at the given 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>`
- Returns the given marker's 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>`
- Returns every marker in this Animation, sorted ascending by time.
- .. 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>`
- Returns the given marker's 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>`
- Returns the closest marker that comes after the given time. If no such marker exists, an empty string is returned.
- .. 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>`
- Returns the closest marker that comes before the given time. If no such marker exists, an empty string is returned.
- .. 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>`
- Returns the amount of tracks in the animation.
- .. 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>`
- Returns ``true`` if this Animation contains a marker with the given name.
- .. 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>`
- Returns the method name of a method track.
- .. 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>`
- Returns the arguments values to be called on a method track for a given key in a given track.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_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>`
- Optimize the animation and all its tracks in-place. This will preserve only as many keys as are necessary to keep the animation within the specified bounds.
- .. 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>`
- Inserts a key in a given 3D position track. Returns the key index.
- .. 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>`
- Returns the interpolated position value at the given time (in seconds). The ``track_idx`` must be the index of a 3D position track.
- .. 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>`
- Removes the marker with the given name from this Animation.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_remove_track:
- .. rst-class:: classref-method
- |void| **remove_track**\ (\ track_idx\: :ref:`int<class_int>`\ ) :ref:`๐<class_Animation_method_remove_track>`
- Removes a track by specifying the track index.
- .. 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>`
- Inserts a key in a given 3D rotation track. Returns the key index.
- .. 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>`
- Returns the interpolated rotation value at the given time (in seconds). The ``track_idx`` must be the index of a 3D rotation track.
- .. 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>`
- Inserts a key in a given 3D scale track. Returns the key index.
- .. 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>`
- Returns the interpolated scale value at the given time (in seconds). The ``track_idx`` must be the index of a 3D scale track.
- .. 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>`
- Sets the given marker's 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>`
- Finds the key index by time in a given track. Optionally, only find it if the approx/exact time is given.
- If ``limit`` is ``true``, it does not return keys outside the animation range.
- If ``backward`` is ``true``, the direction is reversed in methods that rely on one directional processing.
- For example, in case ``find_mode`` is :ref:`FIND_MODE_NEAREST<class_Animation_constant_FIND_MODE_NEAREST>`, if there is no key in the current position just after seeked, the first key found is retrieved by searching before the position, but if ``backward`` is ``true``, the first key found is retrieved after the position.
- .. 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>`
- Returns ``true`` if the track at ``track_idx`` wraps the interpolation loop. New tracks wrap the interpolation loop by default.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_track_get_interpolation_type:
- .. 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>`
- Returns the interpolation type of a given track.
- .. 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>`
- Returns the number of keys in a given track.
- .. 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>`
- Returns the time at which the key is located.
- .. 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>`
- Returns the transition curve (easing) for a specific key (see the built-in math function :ref:`@GlobalScope.ease()<class_@GlobalScope_method_ease>`).
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_track_get_key_value:
- .. 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>`
- Returns the value of a given key in a given track.
- .. 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>`
- Gets the path of a track. For more information on the path format, see :ref:`track_set_path()<class_Animation_method_track_set_path>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_track_get_type:
- .. 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>`
- Gets the type of a track.
- .. 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>`
- Inserts a generic key in a given track. Returns the key index.
- .. 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>`
- Returns ``true`` if the track is compressed, ``false`` otherwise. See also :ref:`compress()<class_Animation_method_compress>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_track_is_enabled:
- .. 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>`
- Returns ``true`` if the track at index ``track_idx`` is enabled.
- .. 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>`
- Returns ``true`` if the given track is imported. Else, return ``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>`
- Moves a track 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>`
- Changes the index position of track ``track_idx`` to the one defined in ``to_idx``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_track_move_up:
- .. rst-class:: classref-method
- |void| **track_move_up**\ (\ track_idx\: :ref:`int<class_int>`\ ) :ref:`๐<class_Animation_method_track_move_up>`
- Moves a track 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>`
- Removes a key by index in a given track.
- .. 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>`
- Removes a key at ``time`` in a given track.
- .. 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>`
- Enables/disables the given track. Tracks are enabled by default.
- .. 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>`
- Sets the given track as imported or not.
- .. 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>`
- If ``true``, the track at ``track_idx`` wraps the interpolation loop.
- .. 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>`
- Sets the interpolation type of a given track.
- .. 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>`
- Sets the time of an existing key.
- .. 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>`
- Sets the transition curve (easing) for a specific key (see the built-in math function :ref:`@GlobalScope.ease()<class_@GlobalScope_method_ease>`).
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_track_set_key_value:
- .. 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>`
- Sets the value of an existing key.
- .. 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>`
- Sets the path of a track. Paths must be valid scene-tree paths to a node and must be specified starting from the :ref:`AnimationMixer.root_node<class_AnimationMixer_property_root_node>` that will reproduce the animation. Tracks that control properties or bones must append their name after the path, separated by ``":"``.
- For example, ``"character/skeleton:ankle"`` or ``"character/mesh:transform/local"``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_track_swap:
- .. 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>`
- Swaps the track ``track_idx``'s index position with the track ``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>`
- Returns the update mode of a value track.
- .. 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>`
- Returns the interpolated value at the given time (in seconds). The ``track_idx`` must be the index of a value track.
- A ``backward`` mainly affects the direction of key retrieval of the track with :ref:`UPDATE_DISCRETE<class_Animation_constant_UPDATE_DISCRETE>` converted by :ref:`AnimationMixer.ANIMATION_CALLBACK_MODE_DISCRETE_FORCE_CONTINUOUS<class_AnimationMixer_constant_ANIMATION_CALLBACK_MODE_DISCRETE_FORCE_CONTINUOUS>` to match the result with :ref:`track_find_key()<class_Animation_method_track_find_key>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Animation_method_value_track_set_update_mode:
- .. rst-class:: classref-method
- |void| **value_track_set_update_mode**\ (\ track_idx\: :ref:`int<class_int>`, mode\: :ref:`UpdateMode<enum_Animation_UpdateMode>`\ ) :ref:`๐<class_Animation_method_value_track_set_update_mode>`
- Sets the update mode (see :ref:`UpdateMode<enum_Animation_UpdateMode>`) of a value track.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
- .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
- .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
- .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
- .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
- .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
- .. |void| replace:: :abbr:`void (No return value.)`
|