Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

AnimationNodeAnimation

繼承: AnimationRootNode < AnimationNode < Resource < RefCounted < Object

AnimationNodeBlendTree 的輸入動畫節點。

說明

可加入 AnimationNodeBlendTree 的資源。僅透過 animation 作為單一輸出埠,供其他 AnimationNode 進行動畫混合之輸入使用。

教學

屬性

bool

advance_on_start

false

StringName

animation

&""

LoopMode

loop_mode

PlayMode

play_mode

0

float

start_offset

bool

stretch_time_scale

float

timeline_length

bool

use_custom_timeline

false


列舉

enum PlayMode: 🔗

PlayMode PLAY_MODE_FORWARD = 0

正向播放動畫。

PlayMode PLAY_MODE_BACKWARD = 1

反向播放動畫。


屬性說明

bool advance_on_start = false 🔗

  • void set_advance_on_start(value: bool)

  • bool is_advance_on_start()

若為 true,當收到自開頭播放動畫的請求時,第一幀僅進行處理但不渲染,播放將自下一幀開始。

另請參閱 AnimationPlayer.play() 的注意事項。


StringName animation = &"" 🔗

要輸出的動畫,必須是 AnimationTree.anim_player 所提供的動畫之一。


LoopMode loop_mode 🔗

use_custom_timelinetrue 時,會以此值覆寫原始 Animation 資源的迴圈設定。

注意:Animation.loop_mode 未設為循環,則 Animation.track_set_interpolation_loop_wrap() 不會生效。若行為不如預期,建議複製該 Animation 資源並調整其迴圈設定。


PlayMode play_mode = 0 🔗

決定動畫的播放方向。


float start_offset 🔗

  • void set_start_offset(value: float)

  • float get_start_offset()

use_custom_timelinetrue 時,可偏移動畫的起始位置。

這對於在 3D 行走動畫中調整先踏出的腳十分有用。


bool stretch_time_scale 🔗

  • void set_stretch_time_scale(value: bool)

  • bool is_stretching_time_scale()

若為 true,會縮放時間,使 timeline_length 所設定的長度成為一個循環。

這有助於對齊走路與跑步動畫的週期。

若為 false,則使用原始動畫長度。若你啟用 loop_mode 迴圈,動畫將於 timeline_length 內循環。


float timeline_length 🔗

  • void set_timeline_length(value: float)

  • float get_timeline_length()

The length of the custom timeline.

If stretch_time_scale is true, scales the animation to this length.


bool use_custom_timeline = false 🔗

  • void set_use_custom_timeline(value: bool)

  • bool is_using_custom_timeline()

若為 true,此 AnimationNode 會輸出以調整部分參數後的 Animation 資源。