grape man animation controller

This commit is contained in:
Spencer Killen 2023-08-19 01:31:24 -06:00
parent 253fca1070
commit 048c233514
Signed by: sjkillen
GPG Key ID: F307025B65C860BA
16 changed files with 9229 additions and 6 deletions

Binary file not shown.

Binary file not shown.

12
godot/.gitignore vendored
View File

@ -1,8 +1,8 @@
# Godot 4+ specific ignores # Godot 4+ specific ignores
.godot/ .godot/
*.bend1 *.blend1
*.bend2 *.blend2
*.bend3 *.blend3
*.bend4 *.blend4
*.bend5 *.blend5
*.bend6 *.blend6

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

45
godot/Models/grape_man.gd Normal file
View File

@ -0,0 +1,45 @@
extends Node3D
var upper_body_animation: AnimationPlayer
var full_body_animation: AnimationPlayer
signal anim_check_grab(position: Vector3)
var pickup_animation_in_progress = false
signal pickup_animation_finished
func _ready():
upper_body_animation = $AnimationPlayer.duplicate()
add_child(upper_body_animation)
full_body_animation = $AnimationPlayer
full_body_animation.play("Idle")
upper_body_animation.play("UpperBodyIdle")
func hold():
if pickup_animation_in_progress:
await pickup_animation_finished
upper_body_animation.play("UpperBodyHolding")
func pickup():
pickup_animation_in_progress = true
full_body_animation.play("Pickup")
await full_body_animation.animation_finished
full_body_animation.play("Idle")
upper_body_animation.play("UpperBodyIdle")
pickup_animation_in_progress = false
emit_signal("pickup_animation_finished")
func idle():
full_body_animation.play("Idle")
func drop():
full_body_animation.play("Idle")
upper_body_animation.play("UpperBodyIdle")
func walk():
full_body_animation.play("Walk")
func animation_key_grab():
emit_signal("anim_check_grab", $GrabPointLocation.global_transform)

BIN
godot/Models/grape_man.glb (Stored with Git LFS) Normal file

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,24 @@
[gd_scene load_steps=3 format=3 uid="uid://bgoo1lbt28na"]
[ext_resource type="PackedScene" uid="uid://bhanbx2dyhv2d" path="res://Models/grape_man.glb" id="1_fh5yr"]
[ext_resource type="Script" path="res://Models/grape_man.gd" id="2_ksje8"]
[node name="grape_man" instance=ExtResource("1_fh5yr")]
script = ExtResource("2_ksje8")
[node name="Skeleton3D" parent="rig" index="0"]
bones/0/rotation = Quaternion(0.0912427, 0, 0, 0.995829)
bones/1/rotation = Quaternion(-0.0891896, 1.18734e-07, -1.06322e-08, 0.996015)
bones/2/rotation = Quaternion(0.0133933, -1.19199e-07, 1.5966e-09, 0.99991)
bones/3/rotation = Quaternion(-0.00997737, 0.100365, -0.694951, 0.711948)
bones/4/rotation = Quaternion(0.0907207, -0.104937, 0.0616428, 0.988412)
bones/4/scale = Vector3(1, 1, 1)
bones/5/rotation = Quaternion(-0.00997737, -0.100365, 0.694951, 0.711948)
bones/6/rotation = Quaternion(0.0907207, 0.104937, -0.0616428, 0.988412)
bones/6/scale = Vector3(1, 1, 1)
bones/7/rotation = Quaternion(0.0142813, -6.34259e-18, -4.44044e-16, 0.999898)
bones/10/rotation = Quaternion(0.105246, 0.0039338, -0.0113526, 0.994374)
bones/15/rotation = Quaternion(0.105246, -0.0039338, 0.0113526, 0.994374)
[node name="GrabPointLocation" type="Node3D" parent="." index="2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1.29365)

BIN
godot/Models/grape_man_grape_man.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,36 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ce7qteyplgh7d"
path.s3tc="res://.godot/imported/grape_man_grape_man.png-2e5aad214d556f9249cd2523505b0b56.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={}
[deps]
source_file="res://Models/grape_man_grape_man.png"
dest_files=["res://.godot/imported/grape_man_grape_man.png-2e5aad214d556f9249cd2523505b0b56.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

View File

@ -0,0 +1,22 @@
extends Node3D
func _on_pickup_pressed():
$grape_man.pickup()
func _on_drop_pressed():
$grape_man.drop()
func _on_idle_pressed():
$grape_man.idle()
func _on_walk_pressed():
$grape_man.walk()
func _on_hold_pressed():
$grape_man.hold()

View File

@ -0,0 +1,60 @@
[gd_scene load_steps=3 format=3 uid="uid://bqnre1721kev2"]
[ext_resource type="PackedScene" uid="uid://bgoo1lbt28na" path="res://Models/grape_man.tscn" id="1_3cekm"]
[ext_resource type="Script" path="res://tests/test_grape_man_animation.gd" id="1_uhk63"]
[node name="test_grape_man_animation" type="Node3D"]
script = ExtResource("1_uhk63")
[node name="grape_man" parent="." instance=ExtResource("1_3cekm")]
[node name="CanvasLayer" type="CanvasLayer" parent="."]
[node name="Control" type="Control" parent="CanvasLayer"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/Control"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 11.0
offset_top = 15.0
offset_right = -768.0
offset_bottom = 15.0
grow_horizontal = 2
grow_vertical = 2
[node name="Pickup" type="Button" parent="CanvasLayer/Control/VBoxContainer"]
layout_mode = 2
text = "Pickup"
[node name="Hold" type="Button" parent="CanvasLayer/Control/VBoxContainer"]
layout_mode = 2
text = "Hold"
[node name="Drop" type="Button" parent="CanvasLayer/Control/VBoxContainer"]
layout_mode = 2
text = "Drop"
[node name="Idle" type="Button" parent="CanvasLayer/Control/VBoxContainer"]
layout_mode = 2
text = "Idle"
[node name="Walk" type="Button" parent="CanvasLayer/Control/VBoxContainer"]
layout_mode = 2
text = "Walk"
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(0.551151, 0, 0.834406, 0, 1, 0, -0.834406, 0, 0.551151, 10.2206, 6.04514, 5.32455)
[connection signal="pressed" from="CanvasLayer/Control/VBoxContainer/Pickup" to="." method="_on_pickup_pressed"]
[connection signal="pressed" from="CanvasLayer/Control/VBoxContainer/Hold" to="." method="_on_hold_pressed"]
[connection signal="pressed" from="CanvasLayer/Control/VBoxContainer/Drop" to="." method="_on_drop_pressed"]
[connection signal="pressed" from="CanvasLayer/Control/VBoxContainer/Idle" to="." method="_on_idle_pressed"]
[connection signal="pressed" from="CanvasLayer/Control/VBoxContainer/Walk" to="." method="_on_walk_pressed"]