Added girl gfolfer character model & animations

This commit is contained in:
Rob Kelly 2024-11-09 15:58:53 -07:00
parent a50e51fdac
commit 7453aa3b21
20 changed files with 17431 additions and 17 deletions

BIN
asset_dev/characters/gfolf_girl/gfolf_girl.blend (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

BIN
asset_dev/characters/gfolf_girl/gfolf_girl1.blend (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

BIN
asset_dev/characters/gfolf_girl/gfolf_girl2.blend (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,7 @@
[gd_resource type="StandardMaterial3D" format=3 uid="uid://454kyx6f25le"]
[resource]
resource_name = "Hair"
cull_mode = 2
albedo_color = Color(0.137478, 0.168597, 0.170451, 1)
roughness = 0.5

View File

@ -0,0 +1,6 @@
[gd_resource type="StandardMaterial3D" format=3 uid="uid://83wxcrwiwwwt"]
[resource]
resource_name = "MatteBlack"
cull_mode = 2
albedo_color = Color(0, 0, 0, 1)

View File

@ -0,0 +1,8 @@
[gd_resource type="StandardMaterial3D" format=3 uid="uid://o7ifm0mtjlp6"]
[resource]
resource_name = "Shirt"
cull_mode = 2
albedo_color = Color(0.724308, 0.441148, 0.908673, 1)
subsurf_scatter_enabled = true
subsurf_scatter_strength = 0.05

View File

@ -0,0 +1,8 @@
[gd_resource type="StandardMaterial3D" format=3 uid="uid://cpb7aikdd7o76"]
[resource]
resource_name = "ShirtAccent"
cull_mode = 2
albedo_color = Color(0.818613, 0.876482, 0.906635, 1)
subsurf_scatter_enabled = true
subsurf_scatter_strength = 0.05

View File

@ -0,0 +1,9 @@
[gd_resource type="StandardMaterial3D" format=3 uid="uid://df1mrqejg257l"]
[resource]
resource_name = "Skin"
albedo_color = Color(0.905882, 0.760784, 0.690196, 1)
roughness = 0.892982
subsurf_scatter_enabled = true
subsurf_scatter_strength = 0.2
subsurf_scatter_skin_mode = true

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -31,6 +31,21 @@ animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
_subresources={}
_subresources={
"materials": {
"Doors": {
"use_external/enabled": false,
"use_external/path": "res://assets/models/scenery/city/concrete_building_1/Doors.tres"
},
"LowerMaterial": {
"use_external/enabled": false,
"use_external/path": "res://assets/models/scenery/city/concrete_building_1/LowerMaterial.tres"
},
"UpperMaterial": {
"use_external/enabled": false,
"use_external/path": "res://assets/models/scenery/city/concrete_building_1/UpperMaterial.tres"
}
}
}
gltf/naming_version=1
gltf/embedded_image_handling=1

View File

@ -85,7 +85,12 @@ volumetric_fog_density = 0.005
volumetric_fog_emission = Color(0, 1, 1, 1)
volumetric_fog_length = 32.0
[sub_resource type="CapsuleMesh" id="CapsuleMesh_dk53r"]
[sub_resource type="CameraAttributesPractical" id="CameraAttributesPractical_ypy22"]
dof_blur_far_distance = 200.0
dof_blur_far_transition = 800.0
dof_blur_near_enabled = true
dof_blur_near_distance = 1.0
dof_blur_near_transition = 0.5
[sub_resource type="FastNoiseLite" id="FastNoiseLite_mgjj0"]
fractal_type = 2
@ -129,20 +134,17 @@ assets = SubResource("Terrain3DAssets_eq5uw")
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_k6wwx")
camera_attributes = SubResource("CameraAttributesPractical_ypy22")
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.29404, 0.955793, 0, -0.955793, 0.29404, 0, 0, 0)
[node name="Player" type="MeshInstance3D" parent="."]
transform = Transform3D(-0.480912, 0, -0.876769, 0, 1, 0, 0.876769, 0, -0.480912, 222.404, 5, 265.619)
mesh = SubResource("CapsuleMesh_dk53r")
[node name="WaterTable2" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -2, 0)
mesh = SubResource("PlaneMesh_2ywhk")
[node name="ShotSetup" parent="." instance=ExtResource("8_h44v5")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 218.499, 4.5, 294.341)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 218.499, 4, 294.341)
[node name="Buildings" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 129.404, -9.53674e-07, 309.4)

View File

@ -0,0 +1,18 @@
class_name CharacterController extends Node3D
## Controller class for character animations
@onready var animation_tree: AnimationTree = $AnimationTree
@onready
var animation_state: AnimationNodeStateMachinePlayback = animation_tree["parameters/playback"]
func reset() -> void:
animation_state.start("stand_to_idle")
func start_upswing() -> void:
animation_state.travel("upswing")
func downswing() -> void:
animation_state.travel("downswing")

View File

@ -0,0 +1,93 @@
[gd_scene load_steps=14 format=3 uid="uid://1s3gywmoi20e"]
[ext_resource type="PackedScene" uid="uid://ha6jxf4v5845" path="res://assets/models/characters/gfolf_girl/gfolf_girl2.gltf" id="1_j80rr"]
[ext_resource type="Script" path="res://src/characters/character_controller.gd" id="2_7o84v"]
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_f1ltw"]
animation = &"downswing"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_w2lmp"]
animation = &"idle"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_t5rm5"]
animation = &"stand_to_idle"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_mlacs"]
animation = &"upswing"
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_xk15a"]
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_gtsjq"]
switch_mode = 2
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_apb2k"]
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_h5bcf"]
xfade_time = 0.4
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_ox862"]
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_oblek"]
switch_mode = 2
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_yepp7"]
states/End/position = Vector2(1028, 100)
states/downswing/node = SubResource("AnimationNodeAnimation_f1ltw")
states/downswing/position = Vector2(862, 100)
states/idle/node = SubResource("AnimationNodeAnimation_w2lmp")
states/idle/position = Vector2(540, 100)
states/stand_to_idle/node = SubResource("AnimationNodeAnimation_t5rm5")
states/stand_to_idle/position = Vector2(367, 100)
states/upswing/node = SubResource("AnimationNodeAnimation_mlacs")
states/upswing/position = Vector2(703, 100)
transitions = ["Start", "stand_to_idle", SubResource("AnimationNodeStateMachineTransition_xk15a"), "stand_to_idle", "idle", SubResource("AnimationNodeStateMachineTransition_gtsjq"), "idle", "upswing", SubResource("AnimationNodeStateMachineTransition_apb2k"), "upswing", "idle", SubResource("AnimationNodeStateMachineTransition_h5bcf"), "upswing", "downswing", SubResource("AnimationNodeStateMachineTransition_ox862"), "downswing", "End", SubResource("AnimationNodeStateMachineTransition_oblek")]
[node name="GfolfGirl" instance=ExtResource("1_j80rr")]
script = ExtResource("2_7o84v")
[node name="Armature" parent="." index="0"]
transform = Transform3D(0.2, 0, 0, 0, 0.2, 0, 0, 0, 0.2, 0, 0, 0)
[node name="Skeleton3D" parent="Armature" index="0"]
bones/2/rotation = Quaternion(-0.0810866, 1.18817e-07, -9.66627e-09, 0.996707)
bones/2/scale = Vector3(1, 1, 1)
bones/3/rotation = Quaternion(0.109598, 5.74113e-14, 2.61301e-08, 0.993976)
bones/3/scale = Vector3(1, 1, 1)
bones/4/rotation = Quaternion(-0.378114, -0.327388, -0.582774, 0.640486)
bones/4/scale = Vector3(1, 1, 1)
bones/5/rotation = Quaternion(0.016166, 0.00322388, -0.0373428, 0.999167)
bones/6/rotation = Quaternion(-0.0278617, 0.563825, -0.0134439, 0.825315)
bones/6/scale = Vector3(1, 1, 1)
bones/7/position = Vector3(2.5177, 0.946917, -0.235743)
bones/7/rotation = Quaternion(0.0351418, 0.076921, -0.71429, 0.694721)
bones/8/position = Vector3(0.0273073, -0.885686, -1.18049)
bones/8/scale = Vector3(1, 1, 1)
bones/9/rotation = Quaternion(-0.37636, 0.32557, 0.583804, 0.641506)
bones/10/rotation = Quaternion(0.0161656, -0.00322384, 0.037342, 0.999167)
bones/11/rotation = Quaternion(-0.0277614, -0.56142, 0.0134281, 0.826956)
bones/11/scale = Vector3(1, 1, 1)
bones/12/position = Vector3(-2.5177, 0.946917, -0.235744)
bones/12/rotation = Quaternion(0.0351417, -0.0769212, 0.71429, 0.694721)
bones/12/scale = Vector3(1, 1, 1)
bones/13/position = Vector3(-0.028872, -0.905219, -0.835685)
bones/13/scale = Vector3(1, 1, 1)
bones/14/rotation = Quaternion(-0.0450049, 0.0679843, 0.995348, -0.0513393)
bones/15/rotation = Quaternion(-0.0580143, 0.0014095, -0.0404488, 0.997495)
bones/16/rotation = Quaternion(-0.00817251, -0.0457521, -0.0136595, 0.998826)
bones/17/rotation = Quaternion(0.0450049, 0.0679843, 0.995348, 0.0513393)
bones/18/rotation = Quaternion(-0.0580143, -0.0014095, 0.0404488, 0.997495)
bones/19/rotation = Quaternion(-0.00817251, 0.0457521, 0.0136595, 0.998826)
bones/20/rotation = Quaternion(-0.000314788, 0, 1, 0)
bones/20/scale = Vector3(1, 1, 1)
bones/21/rotation = Quaternion(-0.000222673, 0.707107, 0.707107, 0.000222504)
bones/21/scale = Vector3(1, 1, 1)
bones/22/rotation = Quaternion(0.000314788, 0, 1, 0)
bones/22/scale = Vector3(1, 1, 1)
bones/23/rotation = Quaternion(0.000222673, 0.707107, 0.707107, -0.000222504)
bones/23/scale = Vector3(1, 1, 1)
[node name="AnimationTree" type="AnimationTree" parent="." index="2"]
tree_root = SubResource("AnimationNodeStateMachine_yepp7")
anim_player = NodePath("../AnimationPlayer")

View File

@ -4,6 +4,7 @@ enum Phase {
AIM,
POWER_ADJUST,
CURVE_ADJUST,
DOWNSWING,
SHOT,
FINISHED,
}
@ -17,7 +18,7 @@ const ZOOM_MIN := 1.0
const ZOOM_MAX := 12.0
const ARROW_ACCELERATION := 8.0
const PLAYER_ACCELERATION := 1.0
const PLAYER_ACCELERATION := 2.0
const FREE_CAM_RETURN_TIME := 0.618
const BALL_RETURN_TIME := 0.618
@ -73,6 +74,8 @@ var _returning_free_camera := false
@onready var camera: Camera3D = %Camera
@onready var player_pivot: Node3D = %PlayerPivot
# TODO: genericize for selectable characters
@onready var character: CharacterController = $PlayerPivot/GfolfGirl
@onready var shot_animation: AnimationPlayer = %ShotAnimation
@ -142,6 +145,10 @@ func camera_motion(motion: Vector2) -> void:
)
func finish_downswing() -> void:
phase = Phase.SHOT
func take_shot() -> void:
print("WHACK!")
print("Power: ", power_bar.value)
@ -235,6 +242,8 @@ func _on_phase_change(new_phase: Phase) -> void:
camera.make_current()
power_bar.hide()
curve_bar.hide()
character.reset()
Phase.POWER_ADJUST:
curve_bar.hide()
@ -243,6 +252,11 @@ func _on_phase_change(new_phase: Phase) -> void:
Phase.CURVE_ADJUST:
curve_bar.show()
curve_animation.play("fill")
Phase.DOWNSWING:
power_bar.hide()
curve_bar.hide()
character.downswing()
shot_animation.play("swing_delay") # calls `take_shot`
Phase.SHOT:
power_bar.hide()
curve_bar.hide()
@ -252,6 +266,7 @@ func _on_phase_change(new_phase: Phase) -> void:
if not driving_range:
shot_animation.play("shoot")
arrow_animation.play("hide")
take_shot()
Phase.FINISHED:
power_bar.hide()
@ -329,6 +344,7 @@ func _process(delta: float) -> void:
Phase.POWER_ADJUST:
if Input.is_action_just_pressed("shot_accept"):
# TODO set power gauge parameters if needed
character.start_upswing()
power_animation.play("fill")
if Input.is_action_just_pressed("ui_cancel"):
power_animation.stop()
@ -342,7 +358,7 @@ func _process(delta: float) -> void:
phase = Phase.POWER_ADJUST
if Input.is_action_just_pressed("shot_accept"):
curve_animation.pause()
phase = Phase.SHOT
phase = Phase.DOWNSWING
Phase.SHOT:
# REMOVEME
if Input.is_action_just_pressed("camera_forward"):

View File

@ -1,8 +1,9 @@
[gd_scene load_steps=24 format=3 uid="uid://cy7t2tc4y3b4"]
[gd_scene load_steps=25 format=3 uid="uid://cy7t2tc4y3b4"]
[ext_resource type="Script" path="res://src/player/shot_setup/shot_setup.gd" id="1_r6ei4"]
[ext_resource type="PackedScene" uid="uid://dfttci386ohip" path="res://src/player/physics_ball/physics_ball.tscn" id="2_1i5j5"]
[ext_resource type="PackedScene" uid="uid://c2k88ns0h5ie1" path="res://src/ui/arrow.tscn" id="2_s70wl"]
[ext_resource type="PackedScene" uid="uid://1s3gywmoi20e" path="res://src/characters/gfolf_girl/gfolf_girl.tscn" id="3_e4aur"]
[ext_resource type="PackedScene" uid="uid://445qd7m4qe2j" path="res://src/player/shot_setup/club_selector/club_selector.tscn" id="4_56ape"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_lnol1"]
@ -14,8 +15,6 @@ top_radius = 0.02
bottom_radius = 0.02
height = 1.0
[sub_resource type="CapsuleMesh" id="CapsuleMesh_5uovl"]
[sub_resource type="Animation" id="Animation_ug2a7"]
length = 0.001
tracks/0/type = "value"
@ -177,10 +176,30 @@ tracks/2/keys = {
}]
}
[sub_resource type="Animation" id="Animation_u8k07"]
resource_name = "swing_delay"
length = 0.2
step = 0.01
tracks/0/type = "method"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("%Direction/..")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0.18),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"finish_downswing"
}]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_u78hq"]
_data = {
"RESET": SubResource("Animation_oks0y"),
"shoot": SubResource("Animation_e65hh")
"shoot": SubResource("Animation_e65hh"),
"swing_delay": SubResource("Animation_u8k07")
}
[sub_resource type="Animation" id="Animation_3xds6"]
@ -408,10 +427,8 @@ skeleton = NodePath("../..")
[node name="PlayerPivot" type="Node3D" parent="."]
unique_name_in_owner = true
[node name="PlayerRef" type="MeshInstance3D" parent="PlayerPivot"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.212, 1, 0)
mesh = SubResource("CapsuleMesh_5uovl")
skeleton = NodePath("../..")
[node name="GfolfGirl" parent="PlayerPivot" instance=ExtResource("3_e4aur")]
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -0.5, 0, 0)
[node name="Direction" type="Node3D" parent="."]
unique_name_in_owner = true