Răsfoiți Sursa

Add a page on the different animation track types

skyace65 5 ani în urmă
părinte
comite
64496774fd

+ 119 - 0
tutorials/animation/animation_track_types.rst

@@ -0,0 +1,119 @@
+.. _doc_animation_track_types:
+
+Animation Track types
+=====================
+
+Overview
+--------
+
+This page goes over the different track types in Godot's animation player
+node.
+
+.. image:: img/track_types.png
+
+This page will assume you have already read :ref:`doc_introduction_2d_animation`,
+or have basic knowledge of animation in Godot. Property tracks will not be
+explained here.
+
+3D Transform Track
+------------------
+
+3D transform tracks have a very specific use. They are used exclusively to
+adjust the location, rotation and scale of a 3D object. This exists because
+adjusting those properties with a property track would be cumbersome.
+
+.. image:: img/3D_transform_track.png
+
+Call Method tracks
+------------------
+
+Call method tracks allow you to use the method of a node while an animation
+is playing. For example deleting a node after a death animation.
+
+To create one click "Add Track" and then "Call Method Track." Then select
+the node whose method you want to call during the animation. To call the
+method right click the timeline and select "Insert Key," this will bring
+up a list of every method in that node.
+
+.. image:: img/node_methods.png
+
+Selecting the key on the timeline will bring up the animation track key
+editor in the inspector. If you expand the "Args" tab you will see a
+list of arguments the method takes that you can edit.
+
+.. image:: img/node_method_args.png
+
+Bezier Curve Track
+------------------
+
+A bezier curve track is a specific type of property track. In a property
+track properties are changed at a consistent rate. Bezier curve tracks
+allow you to change properties according to a bezier curve.
+
+To create one click "Add Track" and then "Bezier Curve Track." Like a
+property track you need to select a node and then a property to animate.
+Create some keys and click the curve icon on the right side of the
+animation player.
+
+.. image:: img/bezier_curve_icon.png
+
+This should open the bezier curve editor. Keys will be represented
+by white diamonds, and the transparent diamonds connected to them are
+manipulators that can be moved to manipulate the shape of the curve.
+
+.. image:: img/bezier_curves.png
+
+In the bottom right of the editor you can select the manipulator mode.
+
+.. image:: img/manipulator_modes.png
+
+-  Free: either manipulator of a key can be moved completely without
+   affecting the position of the other.
+-  Balanced: The position of one manipulator perfectly mirrors the other.
+   But the distance of the manipulator from the key is not mirrored.
+-  Mirror: The position of one manipulator perfectly mirrors the other.
+   Including the distance of the manipulator from the key.
+
+Audio Playback Track
+--------------------
+
+If you want to create an animation with audio you need to use an audio
+playback track. Before you create one your scene must have either a
+AudioStreamPlayer, AudioStreamPlayer2D, or AudioStreamPlayer3D node. When
+creating the track you must select one of those nodes.
+
+If you need to you can create multiple audio tracks using the same node.
+To add an audio file to your audio playback track, find the file you want
+in the file system panel, then drag and drop it onto the audio playback
+track in the animation player. After that you should see the waveform
+of your audio file in the track.
+
+.. image:: img/audio_track.png
+
+To delete an audio file from your audio playback track, select it in the
+track and press your delete key, or right click it and select "Delete
+Key(s)"
+
+Animation Playback Track
+------------------------
+
+Animation playback tracks are used to access the animations of other
+animation player nodes in a scene. For example you may have several
+characters in a scene for a cutscene, and want to use their own animations
+for the cutscene.
+
+To create one select "New Track" and "Animation Playback Track." You then
+need to select the animation player you want to access. If you have a instanced
+scene where the animation player of that scene is not the root node, you need
+to enable "Editable Children" in the scene tree to access that animation player.
+And an animation player cannot access itself.
+
+To play an animation right click the timeline and insert a key. Select the
+key you just created to open animation track key edit in the inspector. From
+there you can select the specific animation you want to paly.
+
+.. image:: img/animation_player_animation.png
+
+If an animation is already playing and you want to stop it early, you can create
+a key and have it set to `[STOP]` under animation. The current animation will then
+stop when it hits that key.

BIN
tutorials/animation/img/3D_transform_track.png


BIN
tutorials/animation/img/animation_add_call_method_track.png


BIN
tutorials/animation/img/animation_add_track.png


BIN
tutorials/animation/img/animation_call_method_keyframe.png


BIN
tutorials/animation/img/animation_method_options.png


BIN
tutorials/animation/img/animation_player_animation.png


BIN
tutorials/animation/img/animation_select_audiostreamplayer.png


BIN
tutorials/animation/img/audio_track.png


BIN
tutorials/animation/img/bezier_curve_icon.png


BIN
tutorials/animation/img/bezier_curves.png


BIN
tutorials/animation/img/manipulator_modes.png


BIN
tutorials/animation/img/node_method_args.png


BIN
tutorials/animation/img/node_methods.png


BIN
tutorials/animation/img/track_types.png


+ 1 - 0
tutorials/animation/index.rst

@@ -6,6 +6,7 @@ Animation
    :name: toc-learn-features-animation
 
    introduction
+   animation_track_types
    cutout_animation
    2d_skeletons
    animation_tree

+ 0 - 60
tutorials/animation/introduction.rst

@@ -308,65 +308,5 @@ the property values when it reaches this keyframe.
 You usually tweak your animations this way, when the movement doesn't
 "look right".
 
-Advanced: Call Method tracks
-----------------------------
-
-Godot's animation engine doesn't stop here. If you're already
-comfortable with Godot's scripting language
-:ref:`doc_gdscript` and :doc:`/classes/index` you
-know that each node type is a class and has a bunch of callable
-methods.
-
-For example, the :ref:`class_AudioStreamPlayer` node type has a
-method to play an audio stream.
-
-Wouldn't it be great to use a method at a specific keyframe in an
-animation? This is where "Call Method Tracks" come in handy. These tracks
-reference a node again, this time without a reference to a property.
-Instead, a keyframe holds the name and arguments of a method, that
-Godot should call when it reaches this keyframe.
-
-To demonstrate, we're going to use a call method track to play audio at a
-specific keyframe. Normally to play audio you should use an audio track,
-but for the sake of demonstrating methods we're going to do it this way.
-
-Add a :ref:`class_AudioStreamPlayer` to the Scene Tree and setup a
-stream using an audio file you put in your project.
-
-Click on "Add track" (|Add track|) on the animation panel's track
-controls.
-
-Select "Add Call Method Track" from the list of possible track types.
-
-.. figure:: img/animation_add_call_method_track.png
-   :alt: Add Call Method Track
-
-   Add Call Method Track
-
-Select the :ref:`class_AudioStreamPlayer` node in the selection
-window. Godot adds the track with the reference to the node.
-
-.. figure:: img/animation_select_audiostreamplayer.png
-   :alt: Select AudioStreamPlayer
-
-   Select AudioStreamPlayer
-
-Right click the timeline where Godot should play the sample and
-click the "Insert Key" option. This will bring up a list of methods
-that can be called for the AudioStreamPlayer node. Select the first
-one.
-
-.. image:: img/animation_method_options.png
-
-When Godot reaches the keyframe, Godot calls the
-:ref:`class_AudioStreamPlayer` node's "play" function and the stream
-plays.
-
-You can change its position by dragging it on the timeline, you can also
-click on the keyframe and use the keyframe settings in the inspector.
-
-.. image:: img/animation_call_method_keyframe.png
-
 .. |Play from beginning| image:: img/animation_play_from_beginning.png
 .. |Add Animation| image:: img/animation_add.png
-.. |Add track| image:: img/animation_add_track.png