From 9e7ec78c6b23327cd9744d702dfcf001e299c117 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Mon, 24 Oct 2022 16:33:11 +0200 Subject: Document the Animation class --- doc/classes/Animation.xml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'doc/classes') diff --git a/doc/classes/Animation.xml b/doc/classes/Animation.xml index df0fb11ac7..008296713d 100644 --- a/doc/classes/Animation.xml +++ b/doc/classes/Animation.xml @@ -26,6 +26,7 @@ [/csharp] [/codeblocks] Animations are just data containers, and must be added to nodes such as an [AnimationPlayer] to be played back. Animation tracks have different types, each with its own set of dedicated methods. Check [enum TrackType] to see available types. + [b]Note:[/b] For 3D position/rotation/scale, using the dedicated [constant TYPE_POSITION_3D], [constant TYPE_ROTATION_3D] and [constant TYPE_SCALE_3D] track types instead of [constant TYPE_VALUE] is recommended for performance reasons. $DOCS_URL/tutorials/animation/index.html @@ -209,6 +210,7 @@ + Inserts a key in a given blend shape track. Returns the key index. @@ -223,6 +225,8 @@ + Compress the animation and all its tracks in-place. This will make [method track_is_compressed] return [code]true[/code] 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. + [b]Note:[/b] Compressed tracks have various limitations (such as not being editable from the editor), so only use compressed animations if you actually need them. @@ -278,6 +282,7 @@ + Inserts a key in a given 3D position track. Returns the key index. @@ -293,6 +298,7 @@ + Inserts a key in a given 3D rotation track. Returns the key index. @@ -301,6 +307,7 @@ + Inserts a key in a given 3D scale track. Returns the key index. @@ -385,6 +392,7 @@ + Returns [code]true[/code] if the track is compressed, [code]false[/code] otherwise. See also [method compress]. @@ -569,15 +577,19 @@ - Value tracks set values in node properties, but only those which can be Interpolated. + Value tracks set values in node properties, but only those which can be interpolated. For 3D position/rotation/scale, using the dedicated [constant TYPE_POSITION_3D], [constant TYPE_ROTATION_3D] and [constant TYPE_SCALE_3D] track types instead of [constant TYPE_VALUE] is recommended for performance reasons. + 3D position track (values are stored in [Vector3]s). + 3D rotation track (values are stored in [Quaternion]s). + 3D scale track (values are stored in [Vector3]s). + Blend shape track. Method tracks call functions with given arguments per key. @@ -598,7 +610,7 @@ Linear interpolation. - Cubic interpolation. + Cubic interpolation. This looks smoother than linear interpolation, but is more expensive to interpolate. Stick to [constant INTERPOLATION_LINEAR] for complex 3D animations imported from external software, even if it requires using a higher animation framerate in return. Linear interpolation with shortest path rotation. -- cgit v1.2.3