Skip to content

Commit

Permalink
Add markers to Animation
Browse files Browse the repository at this point in the history
  • Loading branch information
chocola-mint committed May 10, 2024
1 parent c4279fe commit 8926c10
Show file tree
Hide file tree
Showing 15 changed files with 1,513 additions and 72 deletions.
56 changes: 56 additions & 0 deletions doc/classes/Animation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@
<link title="Animation documentation index">$DOCS_URL/tutorials/animation/index.html</link>
</tutorials>
<methods>
<method name="add_marker">
<return type="void" />
<param index="0" name="time" type="float" />
<param index="1" name="name" type="StringName" />
<description>
Adds a marker to the Animation.
</description>
</method>
<method name="add_track">
<return type="int" />
<param index="0" name="type" type="int" enum="Animation.TrackType" />
Expand Down Expand Up @@ -271,12 +279,53 @@
Returns the index of the specified track. If the track is not found, return -1.
</description>
</method>
<method name="get_marker_at_time" qualifiers="const">
<return type="StringName" />
<param index="0" name="time" type="float" />
<description>
Returns the name of the marker located at the given time.
</description>
</method>
<method name="get_marker_names" qualifiers="const">
<return type="Array" />
<description>
Returns every marker in the Animation, sorted ascending by time.
</description>
</method>
<method name="get_marker_time">
<return type="float" />
<param index="0" name="name" type="StringName" />
<description>
Returns the given marker's time.
</description>
</method>
<method name="get_next_marker" qualifiers="const">
<return type="StringName" />
<param index="0" name="time" type="float" />
<description>
Returns the closest marker that comes after the given time. If no such marker exists, an empty string is returned.
</description>
</method>
<method name="get_prev_marker" qualifiers="const">
<return type="StringName" />
<param index="0" name="time" type="float" />
<description>
Returns the closest marker that comes before the given time. If no such marker exists, an empty string is returned.
</description>
</method>
<method name="get_track_count" qualifiers="const">
<return type="int" />
<description>
Returns the amount of tracks in the animation.
</description>
</method>
<method name="has_marker" qualifiers="const">
<return type="bool" />
<param index="0" name="name" type="StringName" />
<description>
Returns [code]true[/code] if the Animation contains a marker with the given name.
</description>
</method>
<method name="method_track_get_name" qualifiers="const">
<return type="StringName" />
<param index="0" name="track_idx" type="int" />
Expand Down Expand Up @@ -311,6 +360,13 @@
Returns the interpolated position value at the given time (in seconds). The [param track_idx] must be the index of a 3D position track.
</description>
</method>
<method name="remove_marker">
<return type="void" />
<param index="0" name="name" type="StringName" />
<description>
Removes the marker with the given name from the Animation.
</description>
</method>
<method name="remove_track">
<return type="void" />
<param index="0" name="track_idx" type="int" />
Expand Down
47 changes: 47 additions & 0 deletions doc/classes/AnimationPlayer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,30 @@
Returns the blend time (in seconds) between two animations, referenced by their keys.
</description>
</method>
<method name="get_current_section_end_marker" qualifiers="const">
<return type="StringName" />
<description>
Returns the end marker name of the section currently being played by the AnimationPlayer. If no end marker is specified, an empty string is returned.
</description>
</method>
<method name="get_current_section_end_time" qualifiers="const">
<return type="float" />
<description>
Returns the end time of the section currently being played by the AnimationPlayer. If no end marker is specified, the Animation's length is returned.
</description>
</method>
<method name="get_current_section_start_marker" qualifiers="const">
<return type="StringName" />
<description>
Returns the start marker name of the section currently being played by the AnimationPlayer. If no end marker is specified, an empty string is returned.
</description>
</method>
<method name="get_current_section_start_time" qualifiers="const">
<return type="float" />
<description>
Returns the start time of the section currently being played by the AnimationPlayer. If no start marker is specified, [code]0[/code] is returned.
</description>
</method>
<method name="get_method_call_mode" qualifiers="const" deprecated="Use [member AnimationMixer.callback_mode_method] instead.">
<return type="int" enum="AnimationPlayer.AnimationMethodCallMode" />
<description>
Expand Down Expand Up @@ -110,6 +134,29 @@
This method is a shorthand for [method play] with [code]custom_speed = -1.0[/code] and [code]from_end = true[/code], so see its description for more information.
</description>
</method>
<method name="play_section">
<return type="void" />
<param index="0" name="name" type="StringName" default="&amp;&quot;&quot;" />
<param index="1" name="start_marker" type="StringName" default="&amp;&quot;&quot;" />
<param index="2" name="end_marker" type="StringName" default="&amp;&quot;&quot;" />
<param index="3" name="custom_blend" type="float" default="-1" />
<param index="4" name="custom_speed" type="float" default="1.0" />
<param index="5" name="from_end" type="bool" default="false" />
<description>
Plays the animation with key [param name] and the section starting from [param start_marker] and ending on [param end_marker]. See also [method play], [method get_current_section_start_time], [method get_current_section_end_time].
</description>
</method>
<method name="play_section_backwards">
<return type="void" />
<param index="0" name="name" type="StringName" default="&amp;&quot;&quot;" />
<param index="1" name="start_marker" type="StringName" default="&amp;&quot;&quot;" />
<param index="2" name="end_marker" type="StringName" default="&amp;&quot;&quot;" />
<param index="3" name="custom_blend" type="float" default="-1" />
<description>
Plays the animation with key [param name] and the section starting from [param start_marker] and ending on [param end_marker] in reverse.
This method is a shorthand for [method play_section] with [code]custom_speed = -1.0[/code] and [code]from_end = true[/code], so see its description for more information.
</description>
</method>
<method name="play_with_capture">
<return type="void" />
<param index="0" name="name" type="StringName" default="&amp;&quot;&quot;" />
Expand Down

0 comments on commit 8926c10

Please sign in to comment.