diff --git a/spine-godot/example/assets/spineboy/spinebody-data-res.tres b/spine-godot/example/assets/spineboy/spinebody-data-res.tres index 5ba572eda..a6566b79c 100644 --- a/spine-godot/example/assets/spineboy/spinebody-data-res.tres +++ b/spine-godot/example/assets/spineboy/spinebody-data-res.tres @@ -16,5 +16,4 @@ mix = 0.2 [resource] atlas_res = ExtResource( 1 ) skeleton_file_res = ExtResource( 2 ) -default_mix = 0.2 animation_mixes = [ SubResource( 1 ), SubResource( 2 ) ] diff --git a/spine-godot/example/examples/08-animation-player/animation-player.gd b/spine-godot/example/examples/08-animation-player/animation-player.gd index eb6a971ba..7eaba318c 100644 --- a/spine-godot/example/examples/08-animation-player/animation-player.gd +++ b/spine-godot/example/examples/08-animation-player/animation-player.gd @@ -3,4 +3,8 @@ extends Node2D onready var player = $AnimationPlayer func _ready(): - player.play("walk-run-die") + pass + +func _process(_delta): + if Input.is_action_just_pressed("ui_accept"): + player.play("walk-run-die") diff --git a/spine-godot/example/examples/08-animation-player/animation-player.tscn b/spine-godot/example/examples/08-animation-player/animation-player.tscn index ee8cf067d..148a1d702 100644 --- a/spine-godot/example/examples/08-animation-player/animation-player.tscn +++ b/spine-godot/example/examples/08-animation-player/animation-player.tscn @@ -1,10 +1,10 @@ -[gd_scene load_steps=40 format=2] +[gd_scene load_steps=64 format=2] [ext_resource path="res://assets/spineboy/spinebody-data-res.tres" type="SpineSkeletonDataResource" id=1] [ext_resource path="res://examples/08-animation-player/animation-player.gd" type="Script" id=2] [ext_resource path="res://assets/raptor/raprot-data.tres" type="SpineSkeletonDataResource" id=3] -[sub_resource type="Animation" id=26] +[sub_resource type="Animation" id=84] resource_name = "RESET" length = 0.5 loop = true @@ -20,8 +20,20 @@ tracks/0/keys = { "update": 0, "values": [ "" ] } +tracks/1/type = "value" +tracks/1/path = NodePath(".:loop") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ false ] +} -[sub_resource type="Animation" id=27] +[sub_resource type="Animation" id=85] resource_name = "aim" length = 0.5 tracks/0/type = "value" @@ -37,31 +49,19 @@ tracks/0/keys = { "values": [ "aim" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 0.5 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 0.5 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ false ] } -[sub_resource type="Animation" id=28] +[sub_resource type="Animation" id=86] resource_name = "aim_looped" length = 0.5 loop = true @@ -78,31 +78,19 @@ tracks/0/keys = { "values": [ "aim" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 0.5 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 0.5 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ true ] } -[sub_resource type="Animation" id=29] +[sub_resource type="Animation" id=87] resource_name = "death" length = 4.9333 tracks/0/type = "value" @@ -118,31 +106,19 @@ tracks/0/keys = { "values": [ "death" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 4.9333 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 4.9333 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ false ] } -[sub_resource type="Animation" id=30] +[sub_resource type="Animation" id=88] resource_name = "death_looped" length = 4.9333 loop = true @@ -159,31 +135,19 @@ tracks/0/keys = { "values": [ "death" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 4.9333 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 4.9333 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ true ] } -[sub_resource type="Animation" id=31] +[sub_resource type="Animation" id=89] resource_name = "hoverboard" tracks/0/type = "value" tracks/0/path = NodePath(".:animation_name") @@ -198,31 +162,19 @@ tracks/0/keys = { "values": [ "hoverboard" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 1 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 1.0 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ false ] } -[sub_resource type="Animation" id=32] +[sub_resource type="Animation" id=90] resource_name = "hoverboard_looped" loop = true tracks/0/type = "value" @@ -238,31 +190,19 @@ tracks/0/keys = { "values": [ "hoverboard" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 1 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 1.0 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ true ] } -[sub_resource type="Animation" id=33] +[sub_resource type="Animation" id=91] resource_name = "idle" length = 1.6667 tracks/0/type = "value" @@ -278,31 +218,19 @@ tracks/0/keys = { "values": [ "idle" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 1.6667 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 1.6667 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ false ] } -[sub_resource type="Animation" id=34] +[sub_resource type="Animation" id=92] resource_name = "idle-turn" length = 0.2667 tracks/0/type = "value" @@ -318,31 +246,19 @@ tracks/0/keys = { "values": [ "idle-turn" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 0.2667 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 0.2667 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ false ] } -[sub_resource type="Animation" id=35] +[sub_resource type="Animation" id=93] resource_name = "idle-turn_looped" length = 0.2667 loop = true @@ -359,31 +275,19 @@ tracks/0/keys = { "values": [ "idle-turn" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 0.2667 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 0.2667 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ true ] } -[sub_resource type="Animation" id=36] +[sub_resource type="Animation" id=94] resource_name = "idle_looped" length = 1.6667 loop = true @@ -400,31 +304,19 @@ tracks/0/keys = { "values": [ "idle" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 1.6667 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 1.6667 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ true ] } -[sub_resource type="Animation" id=37] +[sub_resource type="Animation" id=95] resource_name = "jump" length = 1.3333 tracks/0/type = "value" @@ -440,31 +332,19 @@ tracks/0/keys = { "values": [ "jump" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 1.3333 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 1.3333 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ false ] } -[sub_resource type="Animation" id=38] +[sub_resource type="Animation" id=96] resource_name = "jump_looped" length = 1.3333 loop = true @@ -481,31 +361,19 @@ tracks/0/keys = { "values": [ "jump" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 1.3333 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 1.3333 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ true ] } -[sub_resource type="Animation" id=39] +[sub_resource type="Animation" id=97] resource_name = "portal" length = 3.1667 tracks/0/type = "value" @@ -521,31 +389,19 @@ tracks/0/keys = { "values": [ "portal" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 3.1667 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 3.1667 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ false ] } -[sub_resource type="Animation" id=40] +[sub_resource type="Animation" id=98] resource_name = "portal_looped" length = 3.1667 loop = true @@ -562,31 +418,19 @@ tracks/0/keys = { "values": [ "portal" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 3.1667 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 3.1667 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ true ] } -[sub_resource type="Animation" id=41] +[sub_resource type="Animation" id=99] resource_name = "run" length = 0.6667 tracks/0/type = "value" @@ -602,31 +446,19 @@ tracks/0/keys = { "values": [ "run" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 0.6667 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 0.6667 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ false ] } -[sub_resource type="Animation" id=42] +[sub_resource type="Animation" id=100] resource_name = "run-to-idle" length = 0.2667 tracks/0/type = "value" @@ -642,31 +474,19 @@ tracks/0/keys = { "values": [ "run-to-idle" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 0.2667 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 0.2667 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ false ] } -[sub_resource type="Animation" id=43] +[sub_resource type="Animation" id=101] resource_name = "run-to-idle_looped" length = 0.2667 loop = true @@ -683,31 +503,19 @@ tracks/0/keys = { "values": [ "run-to-idle" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 0.2667 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 0.2667 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ true ] } -[sub_resource type="Animation" id=44] +[sub_resource type="Animation" id=102] resource_name = "run_looped" length = 0.6667 loop = true @@ -724,31 +532,19 @@ tracks/0/keys = { "values": [ "run" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 0.6667 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 0.6667 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ true ] } -[sub_resource type="Animation" id=45] +[sub_resource type="Animation" id=103] resource_name = "shoot" length = 0.6333 tracks/0/type = "value" @@ -764,31 +560,19 @@ tracks/0/keys = { "values": [ "shoot" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 0.6333 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 0.6333 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ false ] } -[sub_resource type="Animation" id=46] +[sub_resource type="Animation" id=104] resource_name = "shoot_looped" length = 0.6333 loop = true @@ -805,31 +589,19 @@ tracks/0/keys = { "values": [ "shoot" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 0.6333 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 0.6333 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ true ] } -[sub_resource type="Animation" id=47] +[sub_resource type="Animation" id=105] resource_name = "walk" tracks/0/type = "value" tracks/0/path = NodePath(".:animation_name") @@ -844,31 +616,19 @@ tracks/0/keys = { "values": [ "walk" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 1 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 1.0 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ false ] } -[sub_resource type="Animation" id=48] +[sub_resource type="Animation" id=106] resource_name = "walk_looped" loop = true tracks/0/type = "value" @@ -884,31 +644,19 @@ tracks/0/keys = { "values": [ "walk" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 1 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 1.0 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ true ] } -[sub_resource type="Animation" id=49] +[sub_resource type="Animation" id=107] resource_name = "RESET" length = 0.5 loop = true @@ -924,8 +672,672 @@ tracks/0/keys = { "update": 0, "values": [ "" ] } +tracks/1/type = "value" +tracks/1/path = NodePath(".:loop") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ false ] +} -[sub_resource type="Animation" id=50] +[sub_resource type="Animation" id=108] +resource_name = "aim" +length = 0.5 +tracks/0/type = "value" +tracks/0/path = NodePath(".:animation_name") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ "aim" ] +} +tracks/1/type = "value" +tracks/1/path = NodePath(".:loop") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ false ] +} + +[sub_resource type="Animation" id=109] +resource_name = "aim_looped" +length = 0.5 +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath(".:animation_name") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ "aim" ] +} +tracks/1/type = "value" +tracks/1/path = NodePath(".:loop") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ true ] +} + +[sub_resource type="Animation" id=110] +resource_name = "death" +length = 4.9333 +tracks/0/type = "value" +tracks/0/path = NodePath(".:animation_name") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ "death" ] +} +tracks/1/type = "value" +tracks/1/path = NodePath(".:loop") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ false ] +} + +[sub_resource type="Animation" id=111] +resource_name = "death_looped" +length = 4.9333 +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath(".:animation_name") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ "death" ] +} +tracks/1/type = "value" +tracks/1/path = NodePath(".:loop") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ true ] +} + +[sub_resource type="Animation" id=112] +resource_name = "hoverboard" +tracks/0/type = "value" +tracks/0/path = NodePath(".:animation_name") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ "hoverboard" ] +} +tracks/1/type = "value" +tracks/1/path = NodePath(".:loop") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ false ] +} + +[sub_resource type="Animation" id=113] +resource_name = "hoverboard_looped" +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath(".:animation_name") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ "hoverboard" ] +} +tracks/1/type = "value" +tracks/1/path = NodePath(".:loop") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ true ] +} + +[sub_resource type="Animation" id=114] +resource_name = "idle" +length = 1.6667 +tracks/0/type = "value" +tracks/0/path = NodePath(".:animation_name") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ "idle" ] +} +tracks/1/type = "value" +tracks/1/path = NodePath(".:loop") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ false ] +} + +[sub_resource type="Animation" id=115] +resource_name = "idle-turn" +length = 0.2667 +tracks/0/type = "value" +tracks/0/path = NodePath(".:animation_name") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ "idle-turn" ] +} +tracks/1/type = "value" +tracks/1/path = NodePath(".:loop") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ false ] +} + +[sub_resource type="Animation" id=116] +resource_name = "idle-turn_looped" +length = 0.2667 +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath(".:animation_name") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ "idle-turn" ] +} +tracks/1/type = "value" +tracks/1/path = NodePath(".:loop") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ true ] +} + +[sub_resource type="Animation" id=117] +resource_name = "idle_looped" +length = 1.6667 +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath(".:animation_name") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ "idle" ] +} +tracks/1/type = "value" +tracks/1/path = NodePath(".:loop") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ true ] +} + +[sub_resource type="Animation" id=118] +resource_name = "jump" +length = 1.3333 +tracks/0/type = "value" +tracks/0/path = NodePath(".:animation_name") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ "jump" ] +} +tracks/1/type = "value" +tracks/1/path = NodePath(".:loop") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ false ] +} + +[sub_resource type="Animation" id=119] +resource_name = "jump_looped" +length = 1.3333 +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath(".:animation_name") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ "jump" ] +} +tracks/1/type = "value" +tracks/1/path = NodePath(".:loop") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ true ] +} + +[sub_resource type="Animation" id=120] +resource_name = "portal" +length = 3.1667 +tracks/0/type = "value" +tracks/0/path = NodePath(".:animation_name") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ "portal" ] +} +tracks/1/type = "value" +tracks/1/path = NodePath(".:loop") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ false ] +} + +[sub_resource type="Animation" id=121] +resource_name = "portal_looped" +length = 3.1667 +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath(".:animation_name") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ "portal" ] +} +tracks/1/type = "value" +tracks/1/path = NodePath(".:loop") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ true ] +} + +[sub_resource type="Animation" id=122] +resource_name = "run" +length = 0.6667 +tracks/0/type = "value" +tracks/0/path = NodePath(".:animation_name") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ "run" ] +} +tracks/1/type = "value" +tracks/1/path = NodePath(".:loop") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ false ] +} + +[sub_resource type="Animation" id=123] +resource_name = "run-to-idle" +length = 0.2667 +tracks/0/type = "value" +tracks/0/path = NodePath(".:animation_name") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ "run-to-idle" ] +} +tracks/1/type = "value" +tracks/1/path = NodePath(".:loop") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ false ] +} + +[sub_resource type="Animation" id=124] +resource_name = "run-to-idle_looped" +length = 0.2667 +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath(".:animation_name") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ "run-to-idle" ] +} +tracks/1/type = "value" +tracks/1/path = NodePath(".:loop") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ true ] +} + +[sub_resource type="Animation" id=125] +resource_name = "run_looped" +length = 0.6667 +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath(".:animation_name") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ "run" ] +} +tracks/1/type = "value" +tracks/1/path = NodePath(".:loop") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ true ] +} + +[sub_resource type="Animation" id=126] +resource_name = "shoot" +length = 0.6333 +tracks/0/type = "value" +tracks/0/path = NodePath(".:animation_name") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ "shoot" ] +} +tracks/1/type = "value" +tracks/1/path = NodePath(".:loop") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ false ] +} + +[sub_resource type="Animation" id=127] +resource_name = "shoot_looped" +length = 0.6333 +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath(".:animation_name") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ "shoot" ] +} +tracks/1/type = "value" +tracks/1/path = NodePath(".:loop") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ true ] +} + +[sub_resource type="Animation" id=128] +resource_name = "walk" +tracks/0/type = "value" +tracks/0/path = NodePath(".:animation_name") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ "walk" ] +} +tracks/1/type = "value" +tracks/1/path = NodePath(".:loop") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ false ] +} + +[sub_resource type="Animation" id=129] +resource_name = "walk_looped" +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath(".:animation_name") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ "walk" ] +} +tracks/1/type = "value" +tracks/1/path = NodePath(".:loop") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ true ] +} + +[sub_resource type="Animation" id=130] +resource_name = "RESET" +length = 0.5 +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath(".:animation_name") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ "" ] +} +tracks/1/type = "value" +tracks/1/path = NodePath(".:loop") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ false ] +} + +[sub_resource type="Animation" id=131] resource_name = "gun-grab" length = 0.666667 tracks/0/type = "value" @@ -941,31 +1353,19 @@ tracks/0/keys = { "values": [ "gun-grab" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 0.666667 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 0.666667 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ false ] } -[sub_resource type="Animation" id=51] +[sub_resource type="Animation" id=132] resource_name = "gun-grab_looped" length = 0.666667 loop = true @@ -982,31 +1382,19 @@ tracks/0/keys = { "values": [ "gun-grab" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 0.666667 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 0.666667 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ true ] } -[sub_resource type="Animation" id=52] +[sub_resource type="Animation" id=133] resource_name = "gun-holster" length = 0.666667 tracks/0/type = "value" @@ -1022,31 +1410,19 @@ tracks/0/keys = { "values": [ "gun-holster" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 0.666667 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 0.666667 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ false ] } -[sub_resource type="Animation" id=53] +[sub_resource type="Animation" id=134] resource_name = "gun-holster_looped" length = 0.666667 loop = true @@ -1063,31 +1439,19 @@ tracks/0/keys = { "values": [ "gun-holster" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 0.666667 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 0.666667 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ true ] } -[sub_resource type="Animation" id=54] +[sub_resource type="Animation" id=135] resource_name = "jump" length = 1.53333 tracks/0/type = "value" @@ -1103,31 +1467,19 @@ tracks/0/keys = { "values": [ "jump" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 1.53333 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 1.53333 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ false ] } -[sub_resource type="Animation" id=55] +[sub_resource type="Animation" id=136] resource_name = "jump_looped" length = 1.53333 loop = true @@ -1144,31 +1496,19 @@ tracks/0/keys = { "values": [ "jump" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 1.53333 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 1.53333 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ true ] } -[sub_resource type="Animation" id=56] +[sub_resource type="Animation" id=137] resource_name = "roar" length = 2.13333 tracks/0/type = "value" @@ -1184,31 +1524,19 @@ tracks/0/keys = { "values": [ "roar" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 2.13333 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 2.13333 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ false ] } -[sub_resource type="Animation" id=57] +[sub_resource type="Animation" id=138] resource_name = "roar_looped" length = 2.13333 loop = true @@ -1225,31 +1553,19 @@ tracks/0/keys = { "values": [ "roar" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 2.13333 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 2.13333 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ true ] } -[sub_resource type="Animation" id=58] +[sub_resource type="Animation" id=139] resource_name = "walk" length = 1.26667 tracks/0/type = "value" @@ -1265,31 +1581,19 @@ tracks/0/keys = { "values": [ "walk" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 1.26667 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 1.26667 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, "values": [ false ] } -[sub_resource type="Animation" id=59] +[sub_resource type="Animation" id=140] resource_name = "walk_looped" length = 1.26667 loop = true @@ -1306,24 +1610,12 @@ tracks/0/keys = { "values": [ "walk" ] } tracks/1/type = "value" -tracks/1/path = NodePath(".:animation_time") +tracks/1/path = NodePath(".:loop") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 1.26667 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ 0, 1.26667 ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:loop") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, @@ -1334,7 +1626,7 @@ tracks/2/keys = { length = 10.0 loop = true tracks/0/type = "value" -tracks/0/path = NodePath("Raptor:position") +tracks/0/path = NodePath("Spineboy:position") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/imported = false @@ -1343,12 +1635,100 @@ tracks/0/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, +"values": [ Vector2( 72.0001, 520 ) ] +} +tracks/1/type = "value" +tracks/1/path = NodePath("Raptor:position") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, "values": [ Vector2( 1284, 540 ) ] } +tracks/2/type = "value" +tracks/2/path = NodePath("Spineboy/SpineAnimationTrack:mix_duration") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ -1.0 ] +} +tracks/3/type = "value" +tracks/3/path = NodePath("Spineboy/SpineAnimationTrack:reverse") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ false ] +} +tracks/4/type = "value" +tracks/4/path = NodePath("Raptor/SpineAnimationTrack:mix_duration") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ -1.0 ] +} +tracks/5/type = "value" +tracks/5/path = NodePath("Spineboy/SpineAnimationTrack:time_scale") +tracks/5/interp = 1 +tracks/5/loop_wrap = true +tracks/5/imported = false +tracks/5/enabled = true +tracks/5/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ 0.5 ] +} + +[sub_resource type="Animation" id=83] +resource_name = "reverse-additive-timescale" +length = 2.0 +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath("Spineboy/SpineAnimationTrack:reverse") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ true ] +} +tracks/1/type = "animation" +tracks/1/path = NodePath("Spineboy/SpineAnimationTrack/Spineboy Track 0") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"clips": PoolStringArray( "walk_looped" ), +"times": PoolRealArray( 0 ) +} [sub_resource type="Animation" id=1] resource_name = "walk-run-die" -length = 10.5 +length = 10.0 +loop = true step = 0.02 tracks/0/type = "value" tracks/0/path = NodePath("Spineboy:position") @@ -1357,13 +1737,13 @@ tracks/0/loop_wrap = true tracks/0/imported = false tracks/0/enabled = true tracks/0/keys = { -"times": PoolRealArray( 0, 4, 9.94 ), +"times": PoolRealArray( 0, 4, 10 ), "transitions": PoolRealArray( 1, 1, 1 ), "update": 0, "values": [ Vector2( 72.0001, 520 ), Vector2( 500, 520 ), Vector2( 500, 520 ) ] } tracks/1/type = "animation" -tracks/1/path = NodePath("Spineboy/SpineAnimationTrack/Track 0") +tracks/1/path = NodePath("Spineboy/SpineAnimationTrack/Spineboy Track 0") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false @@ -1373,66 +1753,119 @@ tracks/1/keys = { "times": PoolRealArray( 0, 4, 4.34 ) } tracks/2/type = "value" -tracks/2/path = NodePath("Raptor:position") +tracks/2/path = NodePath("Spineboy/SpineAnimationTrack2:mix_duration") tracks/2/interp = 1 tracks/2/loop_wrap = true tracks/2/imported = false tracks/2/enabled = true tracks/2/keys = { -"times": PoolRealArray( 0, 2.02, 3.7, 10 ), -"transitions": PoolRealArray( 1, 1, 1, 1 ), -"update": 0, -"values": [ Vector2( 1284, 540 ), Vector2( 1284, 540 ), Vector2( 800, 540 ), Vector2( 800, 540 ) ] +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ 0.1 ] } tracks/3/type = "animation" -tracks/3/path = NodePath("Raptor/SpineAnimationTrack/Raptor Track 0") +tracks/3/path = NodePath("Spineboy/SpineAnimationTrack2/Spineboy Track 1") tracks/3/interp = 1 tracks/3/loop_wrap = true tracks/3/imported = false tracks/3/enabled = true tracks/3/keys = { -"clips": PoolStringArray( "walk_looped", "roar_looped" ), -"times": PoolRealArray( 0.46, 3.7 ) +"clips": PoolStringArray( "-- Empty --", "aim", "-- Empty --" ), +"times": PoolRealArray( 0.14, 2.5, 3.94 ) +} +tracks/4/type = "value" +tracks/4/path = NodePath("Raptor:position") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/keys = { +"times": PoolRealArray( 0, 2.02, 3.7, 10 ), +"transitions": PoolRealArray( 1, 1, 1, 1 ), +"update": 0, +"values": [ Vector2( 1284, 540 ), Vector2( 1284, 540 ), Vector2( 800, 540 ), Vector2( 800, 540 ) ] +} +tracks/5/type = "animation" +tracks/5/path = NodePath("Raptor/SpineAnimationTrack/Raptor Track 0") +tracks/5/interp = 1 +tracks/5/loop_wrap = true +tracks/5/imported = false +tracks/5/enabled = true +tracks/5/keys = { +"clips": PoolStringArray( "walk_looped", "roar_looped", "-- Empty --" ), +"times": PoolRealArray( 0.46, 3.7, 9.64 ) } [node name="Node2D" type="Node2D"] script = ExtResource( 2 ) [node name="Spineboy" type="SpineSprite" parent="."] -position = Vector2( 161.88, 520 ) +position = Vector2( 72.0001, 520 ) scale = Vector2( 0.323942, 0.323942 ) skeleton_data_res = ExtResource( 1 ) [node name="SpineAnimationTrack" type="SpineAnimationTrack" parent="Spineboy"] track_index = 0 -loop = true -animation_time = 0.84 +time_scale = 0.5 +debug = true -[node name="Track 0" type="AnimationPlayer" parent="Spineboy/SpineAnimationTrack"] -"anims/-- Empty --" = SubResource( 26 ) -anims/RESET = SubResource( 26 ) -anims/aim = SubResource( 27 ) -anims/aim_looped = SubResource( 28 ) -anims/death = SubResource( 29 ) -anims/death_looped = SubResource( 30 ) -anims/hoverboard = SubResource( 31 ) -anims/hoverboard_looped = SubResource( 32 ) -anims/idle = SubResource( 33 ) -anims/idle-turn = SubResource( 34 ) -anims/idle-turn_looped = SubResource( 35 ) -anims/idle_looped = SubResource( 36 ) -anims/jump = SubResource( 37 ) -anims/jump_looped = SubResource( 38 ) -anims/portal = SubResource( 39 ) -anims/portal_looped = SubResource( 40 ) -anims/run = SubResource( 41 ) -anims/run-to-idle = SubResource( 42 ) -anims/run-to-idle_looped = SubResource( 43 ) -anims/run_looped = SubResource( 44 ) -anims/shoot = SubResource( 45 ) -anims/shoot_looped = SubResource( 46 ) -anims/walk = SubResource( 47 ) -anims/walk_looped = SubResource( 48 ) +[node name="Spineboy Track 0" type="AnimationPlayer" parent="Spineboy/SpineAnimationTrack"] +"anims/-- Empty --" = SubResource( 84 ) +anims/RESET = SubResource( 84 ) +anims/aim = SubResource( 85 ) +anims/aim_looped = SubResource( 86 ) +anims/death = SubResource( 87 ) +anims/death_looped = SubResource( 88 ) +anims/hoverboard = SubResource( 89 ) +anims/hoverboard_looped = SubResource( 90 ) +anims/idle = SubResource( 91 ) +anims/idle-turn = SubResource( 92 ) +anims/idle-turn_looped = SubResource( 93 ) +anims/idle_looped = SubResource( 94 ) +anims/jump = SubResource( 95 ) +anims/jump_looped = SubResource( 96 ) +anims/portal = SubResource( 97 ) +anims/portal_looped = SubResource( 98 ) +anims/run = SubResource( 99 ) +anims/run-to-idle = SubResource( 100 ) +anims/run-to-idle_looped = SubResource( 101 ) +anims/run_looped = SubResource( 102 ) +anims/shoot = SubResource( 103 ) +anims/shoot_looped = SubResource( 104 ) +anims/walk = SubResource( 105 ) +anims/walk_looped = SubResource( 106 ) + +[node name="SpineAnimationTrack2" type="SpineAnimationTrack" parent="Spineboy"] +track_index = 1 +mix_duration = 0.1 +debug = true + +[node name="Spineboy Track 1" type="AnimationPlayer" parent="Spineboy/SpineAnimationTrack2"] +"anims/-- Empty --" = SubResource( 107 ) +anims/RESET = SubResource( 107 ) +anims/aim = SubResource( 108 ) +anims/aim_looped = SubResource( 109 ) +anims/death = SubResource( 110 ) +anims/death_looped = SubResource( 111 ) +anims/hoverboard = SubResource( 112 ) +anims/hoverboard_looped = SubResource( 113 ) +anims/idle = SubResource( 114 ) +anims/idle-turn = SubResource( 115 ) +anims/idle-turn_looped = SubResource( 116 ) +anims/idle_looped = SubResource( 117 ) +anims/jump = SubResource( 118 ) +anims/jump_looped = SubResource( 119 ) +anims/portal = SubResource( 120 ) +anims/portal_looped = SubResource( 121 ) +anims/run = SubResource( 122 ) +anims/run-to-idle = SubResource( 123 ) +anims/run-to-idle_looped = SubResource( 124 ) +anims/run_looped = SubResource( 125 ) +anims/shoot = SubResource( 126 ) +anims/shoot_looped = SubResource( 127 ) +anims/walk = SubResource( 128 ) +anims/walk_looped = SubResource( 129 ) [node name="Raptor" type="SpineSprite" parent="."] position = Vector2( 1284, 540 ) @@ -1441,24 +1874,22 @@ skeleton_data_res = ExtResource( 3 ) [node name="SpineAnimationTrack" type="SpineAnimationTrack" parent="Raptor"] track_index = 0 -loop = true -animation_time = 0.38 [node name="Raptor Track 0" type="AnimationPlayer" parent="Raptor/SpineAnimationTrack"] -"anims/-- Empty --" = SubResource( 49 ) -anims/RESET = SubResource( 49 ) -anims/gun-grab = SubResource( 50 ) -anims/gun-grab_looped = SubResource( 51 ) -anims/gun-holster = SubResource( 52 ) -anims/gun-holster_looped = SubResource( 53 ) -anims/jump = SubResource( 54 ) -anims/jump_looped = SubResource( 55 ) -anims/roar = SubResource( 56 ) -anims/roar_looped = SubResource( 57 ) -anims/walk = SubResource( 58 ) -anims/walk_looped = SubResource( 59 ) +"anims/-- Empty --" = SubResource( 130 ) +anims/RESET = SubResource( 130 ) +anims/gun-grab = SubResource( 131 ) +anims/gun-grab_looped = SubResource( 132 ) +anims/gun-holster = SubResource( 133 ) +anims/gun-holster_looped = SubResource( 134 ) +anims/jump = SubResource( 135 ) +anims/jump_looped = SubResource( 136 ) +anims/roar = SubResource( 137 ) +anims/roar_looped = SubResource( 138 ) +anims/walk = SubResource( 139 ) +anims/walk_looped = SubResource( 140 ) [node name="AnimationPlayer" type="AnimationPlayer" parent="."] -reset_on_save = false anims/RESET = SubResource( 25 ) +anims/reverse-additive-timescale = SubResource( 83 ) anims/walk-run-die = SubResource( 1 ) diff --git a/spine-godot/example/project.godot b/spine-godot/example/project.godot index 53b5ec3b8..6011be217 100644 --- a/spine-godot/example/project.godot +++ b/spine-godot/example/project.godot @@ -31,5 +31,4 @@ vram_compression/import_etc2=false batching/parameters/max_join_item_commands=100 batching/parameters/batch_buffer_size=65535 batching/parameters/item_reordering_lookahead=100 -batching/debug/diagnose_frame=true environment/default_environment="res://default_env.tres" diff --git a/spine-godot/spine_godot/SpineAnimationTrack.cpp b/spine-godot/spine_godot/SpineAnimationTrack.cpp index fcab9c760..2f6682c23 100644 --- a/spine-godot/spine_godot/SpineAnimationTrack.cpp +++ b/spine-godot/spine_godot/SpineAnimationTrack.cpp @@ -8,46 +8,75 @@ #endif void SpineAnimationTrack::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_track_index", "track_index"), &SpineAnimationTrack::set_track_index); - ClassDB::bind_method(D_METHOD("get_track_index"), &SpineAnimationTrack::get_track_index); ClassDB::bind_method(D_METHOD("set_animation_name", "animation_name"), &SpineAnimationTrack::set_animation_name); ClassDB::bind_method(D_METHOD("get_animation_name"), &SpineAnimationTrack::get_animation_name); ClassDB::bind_method(D_METHOD("set_loop", "loop"), &SpineAnimationTrack::set_loop); ClassDB::bind_method(D_METHOD("get_loop"), &SpineAnimationTrack::get_loop); - ClassDB::bind_method(D_METHOD("set_animation_time", "time"), &SpineAnimationTrack::set_animation_time); - ClassDB::bind_method(D_METHOD("get_animation_time"), &SpineAnimationTrack::get_animation_time); + + ClassDB::bind_method(D_METHOD("set_track_index", "track_index"), &SpineAnimationTrack::set_track_index); + ClassDB::bind_method(D_METHOD("get_track_index"), &SpineAnimationTrack::get_track_index); + ClassDB::bind_method(D_METHOD("set_mix_duration", "mix_duration"), &SpineAnimationTrack::set_mix_duration); + ClassDB::bind_method(D_METHOD("get_mix_duration"), &SpineAnimationTrack::get_mix_duration); + ClassDB::bind_method(D_METHOD("set_hold_previous", "hold_previous"), &SpineAnimationTrack::set_hold_previous); + ClassDB::bind_method(D_METHOD("get_hold_previous"), &SpineAnimationTrack::get_hold_previous); + ClassDB::bind_method(D_METHOD("set_reverse", "reverse"), &SpineAnimationTrack::set_reverse); + ClassDB::bind_method(D_METHOD("get_reverse"), &SpineAnimationTrack::get_reverse); + ClassDB::bind_method(D_METHOD("set_shortest_rotation", "shortest_rotation"), &SpineAnimationTrack::set_shortest_rotation); + ClassDB::bind_method(D_METHOD("get_shortest_rotation"), &SpineAnimationTrack::get_shortest_rotation); + ClassDB::bind_method(D_METHOD("set_time_scale", "time_scale"), &SpineAnimationTrack::set_time_scale); + ClassDB::bind_method(D_METHOD("get_time_scale"), &SpineAnimationTrack::get_time_scale); + ClassDB::bind_method(D_METHOD("set_alpha", "alpha"), &SpineAnimationTrack::set_alpha); + ClassDB::bind_method(D_METHOD("get_alpha"), &SpineAnimationTrack::get_alpha); + ClassDB::bind_method(D_METHOD("set_attachment_threshold", "attachment_threshold"), &SpineAnimationTrack::set_attachment_threshold); + ClassDB::bind_method(D_METHOD("get_attachment_threshold"), &SpineAnimationTrack::get_attachment_threshold); + ClassDB::bind_method(D_METHOD("set_draw_order_threshold", "draw_order_threshold"), &SpineAnimationTrack::set_draw_order_threshold); + ClassDB::bind_method(D_METHOD("get_draw_order_threshold"), &SpineAnimationTrack::get_draw_order_threshold); + ClassDB::bind_method(D_METHOD("set_mix_blend", "mix_blend"), &SpineAnimationTrack::set_mix_blend); + ClassDB::bind_method(D_METHOD("get_mix_blend"), &SpineAnimationTrack::get_mix_blend); + ClassDB::bind_method(D_METHOD("set_debug", "debug"), &SpineAnimationTrack::set_debug); + ClassDB::bind_method(D_METHOD("get_debug"), &SpineAnimationTrack::get_debug); + ClassDB::bind_method(D_METHOD("update_animation_state", "spine_sprite"), &SpineAnimationTrack::update_animation_state); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "animation_name", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_NOEDITOR), "set_animation_name", "get_animation_name"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "loop", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_INTERNAL | PROPERTY_USAGE_NOEDITOR), "set_loop", "get_loop"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "track_index", PROPERTY_HINT_RANGE, "0,256,0"), "set_track_index", "get_track_index"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "animation_name"), "set_animation_name", "get_animation_name"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "loop"), "set_loop", "get_loop"); -#if VERSION_MAJOR > 3 - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "animation_time"), "set_animation_time", "get_animation_time"); -#else - ADD_PROPERTY(PropertyInfo(Variant::REAL, "animation_time"), "set_animation_time", "get_animation_time"); -#endif + ADD_PROPERTY(PropertyInfo(VARIANT_FLOAT, "mix_duration"), "set_mix_duration", "get_mix_duration"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "hold_previous"), "set_hold_previous", "get_hold_previous"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "reverse"), "set_reverse", "get_reverse"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "shortest_rotation"), "set_shortest_rotation", "get_shortest_rotation"); + ADD_PROPERTY(PropertyInfo(Variant::VARIANT_FLOAT, "time_scale"), "set_time_scale", "get_time_scale"); + ADD_PROPERTY(PropertyInfo(Variant::VARIANT_FLOAT, "alpha"), "set_alpha", "get_alpha"); + ADD_PROPERTY(PropertyInfo(Variant::VARIANT_FLOAT, "attachment_threshold"), "set_attachment_threshold", "get_attachment_threshold"); + ADD_PROPERTY(PropertyInfo(Variant::VARIANT_FLOAT, "draw_order_threshold"), "set_draw_order_threshold", "get_draw_order_threshold"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "mix_blend", PROPERTY_HINT_ENUM, "Setup,First,Replace,Add"), "set_mix_blend", "get_mix_blend"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "debug"), "set_debug", "get_debug"); } -SpineAnimationTrack::SpineAnimationTrack(): track_index(-1), loop(false), animation_time(0), sprite(nullptr) { -} - -void SpineAnimationTrack::set_track_index(int _track_index) { - track_index = _track_index; -} - -int SpineAnimationTrack::get_track_index() { - return track_index; +SpineAnimationTrack::SpineAnimationTrack(): + loop(false), + track_index(-1), + mix_duration(-1), + hold_previous(false), + reverse(false), + shortest_rotation(false), + time_scale(1), + alpha(1), + attachment_threshold(0), + draw_order_threshold(0), + mix_blend(SpineConstant::MixBlend_Replace), + debug(false), + sprite(nullptr), + animation_player(nullptr) { } void SpineAnimationTrack::_notification(int what) { switch(what) { case NOTIFICATION_PARENTED: { sprite = Object::cast_to(get_parent()); - if (sprite) { + if (sprite) sprite->connect("before_animation_state_update", this, "update_animation_state"); - } else { - WARN_PRINT("SpineAnimationTrack parent is not a SpineSprite."); - } NOTIFY_PROPERTY_LIST_CHANGED(); break; } @@ -56,9 +85,8 @@ void SpineAnimationTrack::_notification(int what) { break; } case NOTIFICATION_UNPARENTED: { - if (sprite) { + if (sprite) sprite->disconnect("before_animation_state_update", this, "update_animation_state"); - } break; } default: @@ -75,7 +103,7 @@ void SpineAnimationTrack::setup_animation_player() { if (track_index < 0) { int highest_track_number = -1; for (int i = 0; i < sprite->get_child_count(); i++) { - auto other_track = Object::cast_to(sprite->get_child(i)); + auto other_track = cast_to(sprite->get_child(i)); if (other_track) { if (other_track->track_index > highest_track_number) highest_track_number = other_track->track_index; @@ -86,9 +114,9 @@ void SpineAnimationTrack::setup_animation_player() { // Find the animation player under the track and reset its animation. Create a new one // if there isn't one already. - AnimationPlayer *animation_player = nullptr; + animation_player = nullptr; for (int i = 0; i < get_child_count(); i++) { - animation_player = Object::cast_to(get_child(i)); + animation_player = cast_to(get_child(i)); if (animation_player) { break; } @@ -96,26 +124,27 @@ void SpineAnimationTrack::setup_animation_player() { if (!animation_player) { animation_player = memnew(AnimationPlayer); - animation_player->set_name(String("Track ") + String::num_int64(track_index)); + animation_player->set_name(String("{0} Track {1}").format(varray(sprite->get_name(), String::num_int64(track_index)))); add_child(animation_player); animation_player->set_owner(sprite->get_owner()); } else { List animation_names; animation_player->get_animation_list(&animation_names); - for (int i = 0; i < animation_name.size(); i++) { + for (int i = 0; i < animation_names.size(); i++) { animation_player->remove_animation(animation_names[i]); } } auto skeleton_data = sprite->get_skeleton_data_res()->get_skeleton_data(); auto &animations = skeleton_data->getAnimations(); - for (int i = 0; i < animations.size(); i++) { + for (int i = 0; i < (int)animations.size(); i++) { auto &animation = animations[i]; Ref animation_ref = create_animation(animation, false); animation_player->add_animation(animation_ref->get_name(), animation_ref); Ref animation_looped_ref = create_animation(animation, true); animation_player->add_animation(animation_looped_ref->get_name(), animation_looped_ref); } + Ref reset_animation_ref; INSTANTIATE(reset_animation_ref); reset_animation_ref->set_name("RESET"); @@ -124,10 +153,11 @@ void SpineAnimationTrack::setup_animation_player() { reset_animation_ref->add_track(Animation::TYPE_VALUE); reset_animation_ref->track_set_path(0, NodePath(".:animation_name")); reset_animation_ref->track_insert_key(0, 0, ""); + reset_animation_ref->add_track(Animation::TYPE_VALUE); + reset_animation_ref->track_set_path(1, NodePath(".:loop")); + reset_animation_ref->track_insert_key(1, 0, false); animation_player->add_animation(reset_animation_ref->get_name(), reset_animation_ref); animation_player->add_animation("-- Empty --", reset_animation_ref); - - this->animation_player = animation_player; } Ref SpineAnimationTrack::create_animation(spine::Animation *animation, bool loop) { @@ -145,13 +175,8 @@ Ref SpineAnimationTrack::create_animation(spine::Animation *animation animation_ref->track_insert_key(0, 0, animation->getName().buffer()); animation_ref->add_track(Animation::TYPE_VALUE); - animation_ref->track_set_path(1, NodePath(".:animation_time")); - animation_ref->track_insert_key(1, 0, 0); - animation_ref->track_insert_key(1, duration, duration); - - animation_ref->add_track(Animation::TYPE_VALUE); - animation_ref->track_set_path(2, NodePath(".:loop")); - animation_ref->track_insert_key(2, 0, !loop); + animation_ref->track_set_path(1, NodePath(".:loop")); + animation_ref->track_insert_key(1, 0, !loop); return animation_ref; } @@ -169,37 +194,125 @@ void SpineAnimationTrack::update_animation_state(const Variant &variant_sprite) if (Engine::get_singleton()->is_editor_hint()) { #ifdef TOOLS_ENABLED - // When the animation dock is no longer visible, reset the skeleton. - if (!AnimationPlayerEditor::singleton->is_visible_in_tree()) { + // When the animation dock is no longer visible or we aren't being + // keyed in the current animation, bail. + auto player_editor = AnimationPlayerEditor::singleton; + if (!player_editor->is_visible_in_tree()) { skeleton->setToSetupPose(); animation_state->clearTracks(); animation_state->setTimeScale(1); return; } -#endif - if (track_index == 0) skeleton->setToSetupPose(); - animation_state->setTimeScale(0); - animation_state->clearTrack(track_index); - if (!EMPTY(animation_name)) { - auto entry = animation_state->setAnimation(track_index, SPINE_STRING(animation_name), loop); - entry->setMixDuration(0); - entry->setTrackTime(animation_time); + // Check if the player is actually editing an animation for which there is a track + // for us. + Ref edited_animation = player_editor->get_track_editor()->get_current_animation(); + if (!edited_animation.is_valid()) { + skeleton->setToSetupPose(); + animation_state->clearTracks(); + animation_state->setTimeScale(1); + return; } - } else { - auto current_entry = animation_state->getCurrent(track_index); - if (current_entry) { - if (animation_name != current_entry->getAnimation()->getName().buffer() || current_entry->getLoop() != loop) { - if (!EMPTY(animation_name)) - animation_state->setAnimation(track_index, SPINE_STRING(animation_name), loop); - else - animation_state->setEmptyAnimation(track_index, 0); + + int found_track_index = -1; + auto scene_path = EditorNode::get_singleton()->get_edited_scene()->get_path(); + auto animation_player_path = scene_path.rel_path_to(animation_player->get_path()); + for (int i = 0; i < edited_animation->get_track_count(); i++) { + auto path = edited_animation->track_get_path(i); + auto node = Node::get_node_or_null(path); + if (path == animation_player_path) { + found_track_index = i; + break; + } + } + + // if we are track 0, set the skeleton to the setup pose + // and the animation state time scale to 0, as we are + // setting track times manually. Also, kill anything + // currently in the track. + if (track_index == 0) { + skeleton->setToSetupPose(); + animation_state->setTimeScale(0); + } + animation_state->clearTrack(track_index); + if (found_track_index == -1) return; + + // If no animation is set, we are done. + if (EMPTY(animation_name)) return; + + // If there's no keys on the timeline for this track, we are done. + if (edited_animation->track_get_key_count(found_track_index) == 0) return; + + // Find the key in the track that matches the editor's playback position + auto playback_position = player_editor->get_player()->get_current_animation_position(); + int key_index = -1; + for (int i = 0; i < edited_animation->track_get_key_count(found_track_index); i++) { + float key_time = edited_animation->track_get_key_time(found_track_index, i); + if (key_time <= playback_position) { + key_index = i; + } else { + // epsilon compare key and playback time, as playback time is imprecise + if (fabs(key_time - playback_position) < edited_animation->get_step()) { + key_index = i; + } + break; + } + } + + // No key found? bail. + if (key_index == -1) return; + + // Get the animation from our player for the key + float key_time = edited_animation->track_get_key_time(found_track_index, key_index); + String key_value = edited_animation->track_get_key_value(found_track_index, key_index); + Ref keyed_animation = animation_player->get_animation(key_value); + if (!keyed_animation.is_valid()) return; + + // Calculate the track time and setup the track entry based on the currently keyed + // properties. + float track_time = (playback_position - key_time) * time_scale; + if (track_time < 0) track_time = 0; + auto entry = animation_state->setAnimation(track_index, SPINE_STRING(animation_name), loop); + entry->setMixDuration(0); + entry->setTrackTime(track_time); + + entry->setHoldPrevious(hold_previous); + entry->setReverse(reverse); + entry->setShortestRotation(shortest_rotation); + entry->setAlpha(alpha); + entry->setAttachmentThreshold(attachment_threshold); + entry->setDrawOrderThreshold(draw_order_threshold); + entry->setMixBlend((spine::MixBlend)mix_blend); +#endif + } else { + if (animation_player->is_playing()) { + auto current_entry = animation_state->getCurrent(track_index); + bool should_set_mix = mix_duration >= 0; + bool should_set_animation = !current_entry || (animation_name != current_entry->getAnimation()->getName().buffer() || current_entry->getLoop() != loop); + + if (should_set_animation) { + if (!EMPTY(animation_name)) { + auto entry = animation_state->setAnimation(track_index, SPINE_STRING(animation_name), loop); + if (should_set_mix) entry->setMixDuration(mix_duration); + + entry->setHoldPrevious(hold_previous); + entry->setReverse(reverse); + entry->setShortestRotation(shortest_rotation); + entry->setTimeScale(time_scale); + entry->setAlpha(alpha); + entry->setAttachmentThreshold(attachment_threshold); + entry->setDrawOrderThreshold(draw_order_threshold); + entry->setMixBlend((spine::MixBlend)mix_blend); + + if (debug) print_line(String("Setting animation {0} with mix_duration {1} on track {2} on {3}").format(varray(animation_name, mix_duration, track_index, sprite->get_name())).utf8().ptr()); + } else { + if (!current_entry || (String("") != current_entry->getAnimation()->getName().buffer())) { + auto entry = animation_state->setEmptyAnimation(track_index, should_set_mix ? mix_duration : 0); + entry->setTrackEnd(FLT_MAX); + if (debug) print_line(String("Setting empty animation with mix_duration {0} on track {1} on {2}").format(varray(mix_duration, track_index, sprite->get_name())).utf8().ptr()); + } + } } - } else { - if (!EMPTY(animation_name)) - animation_state->setAnimation(track_index, SPINE_STRING(animation_name), loop); - else - animation_state->setEmptyAnimation(track_index, 0); } } } @@ -220,10 +333,90 @@ bool SpineAnimationTrack::get_loop() { return loop; } -void SpineAnimationTrack::set_animation_time(float _animation_time) { - animation_time = _animation_time; +void SpineAnimationTrack::set_track_index(int _track_index) { + track_index = _track_index; } -float SpineAnimationTrack::get_animation_time() { - return animation_time; +int SpineAnimationTrack::get_track_index() { + return track_index; +} + +void SpineAnimationTrack::set_mix_duration(float _mix_duration) { + mix_duration = _mix_duration; +} + +float SpineAnimationTrack::get_mix_duration() { + return mix_duration; +} + +void SpineAnimationTrack::set_hold_previous(bool _hold_previous) { + hold_previous = _hold_previous; +} + +bool SpineAnimationTrack::get_hold_previous() { + return hold_previous; +} + +void SpineAnimationTrack::set_reverse(bool _reverse) { + reverse = _reverse; +} + +bool SpineAnimationTrack::get_reverse() { + return reverse; +} + +void SpineAnimationTrack::set_shortest_rotation(bool _shortest_rotation) { + shortest_rotation = _shortest_rotation; +} + +bool SpineAnimationTrack::get_shortest_rotation() { + return shortest_rotation; +} + +void SpineAnimationTrack::set_time_scale(float _time_scale) { + time_scale = _time_scale; +} + +float SpineAnimationTrack::get_time_scale() { + return time_scale; +} + +void SpineAnimationTrack::set_alpha(float _alpha) { + alpha = _alpha; +} + +float SpineAnimationTrack::get_alpha() { + return alpha; +} + +void SpineAnimationTrack::set_attachment_threshold(bool _attachment_threshold) { + attachment_threshold = _attachment_threshold; +} + +float SpineAnimationTrack::get_attachment_threshold() { + return attachment_threshold; +} + +void SpineAnimationTrack::set_draw_order_threshold(bool _draw_order_threshold) { + draw_order_threshold = _draw_order_threshold; +} + +float SpineAnimationTrack::get_draw_order_threshold() { + return draw_order_threshold; +} + +void SpineAnimationTrack::set_mix_blend(SpineConstant::MixBlend _blend) { + mix_blend = _blend; +} + +SpineConstant::MixBlend SpineAnimationTrack::get_mix_blend() { + return mix_blend; +} + +void SpineAnimationTrack::set_debug(bool _debug) { + debug = _debug; +} + +bool SpineAnimationTrack::get_debug() { + return debug; } diff --git a/spine-godot/spine_godot/SpineAnimationTrack.h b/spine-godot/spine_godot/SpineAnimationTrack.h index 45a233ee1..b98efd338 100644 --- a/spine-godot/spine_godot/SpineAnimationTrack.h +++ b/spine-godot/spine_godot/SpineAnimationTrack.h @@ -30,7 +30,6 @@ #ifndef GODOT_SPINEANIMATIONTRACK_H #define GODOT_SPINEANIMATIONTRACK_H -#include "SpineCommon.h" #include "SpineSprite.h" #include "scene/animation/animation_player.h" #include "scene/resources/animation.h" @@ -38,34 +37,96 @@ class SpineAnimationTrack : public Node { GDCLASS(SpineAnimationTrack, Node) protected: - int track_index; + // These are not exposed in the inspector, see SpineAnimationTrackInspectorPlugin. + // Instead, they are are keyed by the animations created in setup_animation_player + // and primarily used for animation player editor support like scrubbing. String animation_name; - String last_animation_name; bool loop; - float animation_time; + + // These can be set by the user. + int track_index; + float mix_duration; + bool hold_previous; + bool reverse; + bool shortest_rotation; + float time_scale; + float alpha; + float attachment_threshold; + float draw_order_threshold; + SpineConstant::MixBlend mix_blend; + bool debug; + SpineSprite *sprite; AnimationPlayer *animation_player; static void _bind_methods(); + void _notification(int what); + void setup_animation_player(); - Ref create_animation(spine::Animation *animation, bool loop); - void _on_before_world_transforms_change(const Variant& _sprite); + + static Ref create_animation(spine::Animation *animation, bool loop); + void update_animation_state(const Variant &variant_sprite); + public: SpineAnimationTrack(); - - void set_track_index(int _track_index); - int get_track_index(); void set_animation_name(const String& _animation_name); + String get_animation_name(); + void set_animation_time (float _animation_time); + + float get_animation_time(); + void set_loop(bool _loop); + bool get_loop(); - void set_animation_time (float _animation_time); - float get_animation_time(); + void set_track_index(int _track_index); + + int get_track_index(); + + void set_mix_duration(float _mix_duration); + + float get_mix_duration(); + + void set_hold_previous(bool _hold_previous); + + bool get_hold_previous(); + + void set_reverse(bool _reverse); + + bool get_reverse(); + + void set_shortest_rotation(bool _shortest_rotation); + + bool get_shortest_rotation(); + + void set_time_scale(float _time_scale); + + float get_time_scale(); + + void set_alpha(float _alpha); + + float get_alpha(); + + void set_attachment_threshold(bool _attachment_threshold); + + float get_attachment_threshold(); + + void set_draw_order_threshold(bool _draw_order_threshold); + + float get_draw_order_threshold(); + + void set_mix_blend(SpineConstant::MixBlend _blend); + + SpineConstant::MixBlend get_mix_blend(); + + void set_debug(bool _debug); + + bool get_debug(); }; #endif diff --git a/spine-godot/spine_godot/SpineCommon.h b/spine-godot/spine_godot/SpineCommon.h index 62bfdac81..8a9a9c9f2 100644 --- a/spine-godot/spine_godot/SpineCommon.h +++ b/spine-godot/spine_godot/SpineCommon.h @@ -39,6 +39,7 @@ #define EMPTY_PTR(x) ((x)->is_empty()) #define INSTANTIATE(x) (x).instantiate() #define NOTIFY_PROPERTY_LIST_CHANGED() notify_property_list_changed() +#define VARIANT_FLOAT Variant::FLOAT #else #include "core/object.h" #include "core/reference.h" @@ -48,6 +49,7 @@ #define EMPTY_PTR(x) ((x)->empty()) #define INSTANTIATE(x) (x).instance() #define NOTIFY_PROPERTY_LIST_CHANGED() property_list_changed_notify() +#define VARIANT_FLOAT Variant::REAL #endif #define SPINE_CHECK(obj, ret) \