Move the character's armature into a new native godot scene, and switched to inheriting from that.

This commit is contained in:
Relintai 2022-02-12 00:07:12 +01:00
parent 43987d8406
commit 62391b0178
4 changed files with 175 additions and 15 deletions

View File

@ -1,4 +1,4 @@
extends Spatial
extends Node
# Declare member variables here. Examples:

View File

@ -16,20 +16,22 @@ nodes/root_name="Scene Root"
nodes/root_scale=1.0
nodes/custom_script=""
nodes/storage=0
nodes/use_legacy_names=true
materials/location=1
materials/storage=1
materials/keep_on_reimport=true
meshes/compress=true
meshes/ensure_tangents=true
meshes/storage=0
meshes/octahedral_compression=false
meshes/compress=0
meshes/ensure_tangents=false
meshes/storage=2
meshes/light_baking=0
meshes/lightmap_texel_size=0.1
skins/use_named_skins=true
external_files/store_in_subdir=false
animation/import=true
animation/import=false
animation/fps=30.0
animation/filter_script=""
animation/storage=2
animation/storage=0
animation/keep_custom_tracks=false
animation/optimizer/enabled=false
animation/optimizer/max_linear_error=0.05

View File

@ -0,0 +1,158 @@
[gd_scene load_steps=2 format=2]
[sub_resource type="Animation" id=1]
length = 0.001
[node name="Spatial" type="Spatial"]
[node name="Armature" type="Spatial" parent="."]
[node name="Skeleton" type="Skeleton" parent="Armature"]
bones/0/name = "root"
bones/0/parent = -1
bones/0/rest = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -3.23883e-05, 0, 0.000216131 )
bones/0/enabled = true
bones/0/bound_children = [ ]
bones/1/name = "pelvis"
bones/1/parent = 0
bones/1/rest = Transform( 1, 0, 0, 0, 1, 4.71856e-07, 0, -4.71856e-07, 1, 3.23883e-05, 0.782716, -0.000216131 )
bones/1/enabled = true
bones/1/bound_children = [ ]
bones/2/name = "left_thigh"
bones/2/parent = 1
bones/2/rest = Transform( 0.996998, 0.0649781, 0.0406091, 0.0643847, -0.997801, 0.0156598, 0.0415346, -0.0129989, -0.999055, 0.0729343, 0.0192029, -0.000776013 )
bones/2/enabled = true
bones/2/bound_children = [ ]
bones/3/name = "left_calf"
bones/3/parent = 2
bones/3/rest = Transform( 0.999849, -0.0130837, -0.0109005, 0.01274, 0.999445, -0.031012, 0.0113, 0.0308689, 0.999458, 1.03173e-08, 0.340143, 9.31323e-10 )
bones/3/enabled = true
bones/3/bound_children = [ ]
bones/4/name = "left_foot"
bones/4/parent = 3
bones/4/rest = Transform( 0.998077, -0.0537376, -0.030894, 0.0409662, 0.197821, 0.979382, -0.0465181, -0.978764, 0.199642, -3.31784e-09, 0.408901, -2.32831e-10 )
bones/4/enabled = true
bones/4/bound_children = [ ]
bones/5/name = "right_thigh"
bones/5/parent = 1
bones/5/rest = Transform( 0.997453, -0.0652037, -0.0272067, -0.0648281, -0.997793, 0.0143577, -0.0280815, -0.012558, -0.999525, -0.0729235, 0.0192009, -0.000789025 )
bones/5/enabled = true
bones/5/bound_children = [ ]
bones/6/name = "right_calf"
bones/6/parent = 5
bones/6/rest = Transform( 0.999861, 0.0129564, 0.0103765, -0.012619, 0.999421, -0.0319279, -0.010784, 0.0317928, 0.999436, -8.10542e-09, 0.33995, 2.32831e-10 )
bones/6/enabled = true
bones/6/bound_children = [ ]
bones/7/name = "right_foot"
bones/7/parent = 6
bones/7/rest = Transform( 0.994718, -0.0661249, 0.0785048, -0.0637523, 0.2014, 0.977432, -0.0804435, -0.977274, 0.196121, 1.2049e-08, 0.409101, 1.28057e-09 )
bones/7/enabled = true
bones/7/bound_children = [ ]
bones/8/name = "spine"
bones/8/parent = 1
bones/8/rest = Transform( 0.999745, 0.00659991, -0.0215977, -0.0062164, 0.999823, 0.0177762, 0.0217112, -0.0176374, 0.999609, 0, 0.0497445, 0 )
bones/8/enabled = true
bones/8/bound_children = [ ]
bones/9/name = "spine_1"
bones/9/parent = 8
bones/9/rest = Transform( 0.999745, -0.00614339, 0.0217319, 0.00659991, 0.999758, -0.0209976, -0.0215977, 0.0211357, 0.999543, -4.72937e-10, 0.156596, 2.85581e-10 )
bones/9/enabled = true
bones/9/bound_children = [ ]
bones/10/name = "spine_2"
bones/10/parent = 9
bones/10/rest = Transform( 1, -6.51014e-07, 8.83251e-07, 6.37914e-07, 0.999891, 0.0147513, -8.92758e-07, -0.0147513, 0.999891, -4.06186e-11, 0.147629, 2.30903e-10 )
bones/10/enabled = true
bones/10/bound_children = [ ]
bones/11/name = "right_clavicle"
bones/11/parent = 10
bones/11/rest = Transform( 0.00963211, -0.992975, -0.117936, -0.0690259, -0.11832, 0.990573, -0.997568, -0.00140062, -0.0696807, -0.0597681, 0.142186, -0.00661948 )
bones/11/enabled = true
bones/11/bound_children = [ ]
bones/12/name = "right_upper_arm"
bones/12/parent = 11
bones/12/rest = Transform( 0.998794, -0.0486248, -0.00689666, 0.0479024, 0.995519, -0.0815315, 0.0108302, 0.0811028, 0.996647, 1.04774e-09, 0.0845332, -3.15486e-08 )
bones/12/enabled = true
bones/12/bound_children = [ ]
bones/13/name = "right_forearm"
bones/13/parent = 12
bones/13/rest = Transform( 0.997957, 0.0627536, -0.0120584, -0.062618, 0.997974, 0.0113097, 0.0127437, -0.0105315, 0.999863, 1.12868e-09, 0.251481, 1.24799e-07 )
bones/13/enabled = true
bones/13/bound_children = [ ]
bones/14/name = "right_hand"
bones/14/parent = 13
bones/14/rest = Transform( 0.989714, -0.00706462, -0.142888, -0.0138712, 0.989335, -0.144993, 0.142388, 0.145484, 0.979061, 6.98492e-09, 0.240761, -8.6904e-08 )
bones/14/enabled = true
bones/14/bound_children = [ ]
bones/15/name = "right_thumb_base"
bones/15/parent = 14
bones/15/rest = Transform( 0.813994, -0.514253, 0.270107, 0.46773, 0.856006, 0.220188, -0.344446, -0.0528944, 0.937315, -0.0492859, 0.0763682, -0.0032349 )
bones/15/enabled = true
bones/15/bound_children = [ ]
bones/16/name = "right_thumb_head"
bones/16/parent = 15
bones/16/rest = Transform( 0.870568, 0.491815, 0.015171, -0.491849, 0.870679, -0.00161461, -0.0140031, -0.0060562, 0.999884, -1.11759e-08, 0.0345327, 1.04774e-08 )
bones/16/enabled = true
bones/16/bound_children = [ ]
bones/17/name = "right_fingers_base"
bones/17/parent = 14
bones/17/rest = Transform( 0.994898, -0.0326043, 0.0954731, 0.0233065, 0.995018, 0.0969303, -0.0981578, -0.0942106, 0.990701, -4.65661e-09, 0.109269, 1.67463e-07 )
bones/17/enabled = true
bones/17/bound_children = [ ]
bones/18/name = "right_fingers_head"
bones/18/parent = 17
bones/18/rest = Transform( 0.99977, 0.00896365, 0.0194525, -0.00933935, 0.99977, 0.0193098, -0.019275, -0.019487, 0.999624, -2.32831e-10, 0.0397489, -2.15099e-07 )
bones/18/enabled = true
bones/18/bound_children = [ ]
bones/19/name = "left_clavicle"
bones/19/parent = 10
bones/19/rest = Transform( 0.0103369, 0.993407, 0.114177, 0.065755, -0.114611, 0.991232, 0.997782, -0.00273856, -0.0665061, 0.057635, 0.142121, -0.00659067 )
bones/19/enabled = true
bones/19/bound_children = [ ]
bones/20/name = "left_upper_arm"
bones/20/parent = 19
bones/20/rest = Transform( 0.997918, 0.0532796, 0.036327, -0.0512401, 0.997174, -0.0549321, -0.0391511, 0.0529564, 0.997829, -5.93718e-09, 0.0836569, -4.58676e-08 )
bones/20/enabled = true
bones/20/bound_children = [ ]
bones/21/name = "left_forearm"
bones/21/parent = 20
bones/21/rest = Transform( 0.997892, -0.063919, 0.0111941, 0.064214, 0.997533, -0.0283561, -0.00935395, 0.0290152, 0.999535, 3.25963e-09, 0.252095, -3.81515e-08 )
bones/21/enabled = true
bones/21/bound_children = [ ]
bones/22/name = "left_hand"
bones/22/parent = 21
bones/22/rest = Transform( -0.986881, 0.0138399, -0.160856, -0.0128795, 0.986395, 0.163886, 0.160936, 0.163808, -0.973276, -4.65661e-09, 0.240671, -7.40401e-08 )
bones/22/enabled = true
bones/22/bound_children = [ ]
bones/23/name = "left_fingers_base"
bones/23/parent = 22
bones/23/rest = Transform( -0.990865, -0.0172252, 0.133748, 0.00115541, 0.990687, 0.136149, -0.134848, 0.13506, -0.981618, -1.07102e-08, 0.109284, -6.75209e-09 )
bones/23/enabled = true
bones/23/bound_children = [ ]
bones/24/name = "left_fingers_end"
bones/24/parent = 23
bones/24/rest = Transform( 0.999816, 0.0191504, 0.000955053, -0.0191495, 0.999816, -0.000980031, -0.000973646, 0.000961562, 0.999999, -4.65661e-10, 0.0397149, -1.48359e-07 )
bones/24/enabled = true
bones/24/bound_children = [ ]
bones/25/name = "left_thunb_base"
bones/25/parent = 22
bones/25/rest = Transform( -0.858768, -0.494612, 0.133703, -0.478428, 0.867495, 0.136231, -0.183369, 0.0530237, -0.981613, -0.0497103, 0.0760591, 0.0020895 )
bones/25/enabled = true
bones/25/bound_children = [ ]
bones/26/name = "left_thumb_end"
bones/26/parent = 25
bones/26/rest = Transform( 0.879725, -0.47546, 0.00470694, 0.475471, 0.87973, -0.00149548, -0.00342979, 0.00355363, 0.999988, 1.21072e-08, 0.0346539, -3.12721e-08 )
bones/26/enabled = true
bones/26/bound_children = [ ]
bones/27/name = "neck"
bones/27/parent = 10
bones/27/rest = Transform( 1, 0.000279672, -9.73603e-05, -0.000271678, 0.997244, 0.0741962, 0.000117843, -0.0741962, 0.997244, 8.34999e-11, 0.187597, 4.45173e-10 )
bones/27/enabled = true
bones/27/bound_children = [ ]
bones/28/name = "head"
bones/28/parent = 27
bones/28/rest = Transform( 1, -0.000370401, 0.000365109, 0.000382964, 0.999386, -0.0350311, -0.00035191, 0.0350312, 0.999386, -4.3201e-12, 0.0579743, 2.99337e-09 )
bones/28/enabled = true
bones/28/bound_children = [ ]
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/RESET = SubResource( 1 )

View File

@ -4,7 +4,7 @@
[ext_resource path="res://player/CharacterSkeletonAttachPoint.gd" type="Script" id=2]
[ext_resource path="res://modules/species/Human/models/dead.tres" type="Animation" id=4]
[ext_resource path="res://modules/species/Human/models/armature.gd" type="Script" id=5]
[ext_resource path="res://modules/species/Human/models/armature.gltf" type="PackedScene" id=6]
[ext_resource path="res://modules/species/Human/models/armature.tscn" type="PackedScene" id=6]
[ext_resource path="res://player/CharacterSkeletonGD.gd" type="Script" id=8]
[ext_resource path="res://modules/species/Human/models/idle-loop.tres" type="Animation" id=9]
[ext_resource path="res://modules/species/Human/models/rest.tres" type="Animation" id=10]
@ -160,7 +160,7 @@ bones/27/bound_children = [ NodePath("NeckAttachment") ]
visible = false
[node name="LeftHandAttachment" type="BoneAttachment" parent="armature/Armature/Skeleton" index="1"]
transform = Transform( 0.190725, 0.147102, -0.970559, 0.0931773, -0.986957, -0.131278, -0.97721, -0.065396, -0.201944, 0.244939, 0.774361, -0.0217047 )
transform = Transform( 0.190725, 0.147102, -0.970559, 0.0931773, -0.986957, -0.131278, -0.97721, -0.065396, -0.201944, 0.244939, 0.774359, -0.0217047 )
bone_name = "left_hand"
[node name="LeftHandAP" type="Spatial" parent="armature/Armature/Skeleton/LeftHandAttachment"]
@ -168,14 +168,14 @@ transform = Transform( -0.0646502, 0.683772, 0.726832, -0.148514, -0.726783, 0.6
script = ExtResource( 2 )
[node name="ShieldAttachment" type="BoneAttachment" parent="armature/Armature/Skeleton" index="2"]
transform = Transform( -0.0433176, 0.125638, 0.99113, -0.0774754, -0.989496, 0.122045, 0.996052, -0.0715015, 0.0525965, 0.214702, 1.0125, -0.00449639 )
transform = Transform( -0.0433177, 0.125638, 0.99113, -0.0774755, -0.989496, 0.122045, 0.996051, -0.0715016, 0.0525966, 0.214702, 1.0125, -0.00449638 )
bone_name = "left_forearm"
[node name="LeftHandShield" type="Spatial" parent="armature/Armature/Skeleton/ShieldAttachment"]
transform = Transform( 0.122585, 0.992132, -0.0242311, 0.987746, -0.124342, -0.0941345, -0.0964273, -0.0123912, -0.995239, 0.0157415, 0.108918, 0.0213161 )
[node name="RightHandAttachment" type="BoneAttachment" parent="armature/Armature/Skeleton" index="3"]
transform = Transform( -0.0270232, -0.0924788, -0.995348, -0.0997119, -0.990496, 0.0947352, -0.99465, 0.101808, 0.0175453, -0.248237, 0.77238, -0.0111511 )
transform = Transform( -0.0270229, -0.0924788, -0.995349, -0.099712, -0.990496, 0.0947348, -0.994651, 0.101808, 0.0175456, -0.248237, 0.772379, -0.0111511 )
bone_name = "right_hand"
[node name="RightHandAP" type="Spatial" parent="armature/Armature/Skeleton/RightHandAttachment"]
@ -191,7 +191,7 @@ transform = Transform( 1, 0, 0, 0, -1.62921e-07, 1, 0, -1, -1.62921e-07, 0, 0, 0
script = ExtResource( 2 )
[node name="NeckAttachment" type="BoneAttachment" parent="armature/Armature/Skeleton" index="5"]
transform = Transform( 0.999992, 0.00218317, -0.00333621, -0.00195909, 0.997835, 0.0657461, 0.00347252, -0.065739, 0.997831, 0.000876503, 1.31821, 0.00123351 )
transform = Transform( 0.999992, 0.00218318, -0.00333627, -0.00195908, 0.997835, 0.0657461, 0.00347252, -0.065739, 0.997831, 0.000876508, 1.31821, 0.00123354 )
bone_name = "neck"
[node name="TorsoAP" type="Spatial" parent="armature/Armature/Skeleton/NeckAttachment"]
@ -199,28 +199,28 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.04, -0.09 )
script = ExtResource( 2 )
[node name="RightHipAttachment" type="BoneAttachment" parent="armature/Armature/Skeleton" index="6"]
transform = Transform( 0.999504, 0.0314799, 1.49316e-08, -0.0314799, 0.999504, 4.7162e-07, -7.76685e-11, -4.71856e-07, 1, 0, 0.776724, 0 )
transform = Transform( 0.999504, 0.0314799, 1.49316e-08, -0.0314799, 0.999504, 4.7162e-07, -7.76712e-11, -4.71856e-07, 1, 0, 0.776724, 0 )
bone_name = "pelvis"
[node name="Spatial" type="Spatial" parent="armature/Armature/Skeleton/RightHipAttachment"]
transform = Transform( 0.993372, -0.0110498, 0.114411, 0.0109836, 0.999939, 0.00120905, -0.114417, 5.56017e-05, 0.993433, -0.141825, 0.176866, 0.16621 )
[node name="LeftHipAttachment" type="BoneAttachment" parent="armature/Armature/Skeleton" index="7"]
transform = Transform( 0.999504, 0.0314799, 1.49316e-08, -0.0314799, 0.999504, 4.7162e-07, -7.76685e-11, -4.71856e-07, 1, 0, 0.776724, 0 )
transform = Transform( 0.999504, 0.0314799, 1.49316e-08, -0.0314799, 0.999504, 4.7162e-07, -7.76712e-11, -4.71856e-07, 1, 0, 0.776724, 0 )
bone_name = "pelvis"
[node name="Spatial" type="Spatial" parent="armature/Armature/Skeleton/LeftHipAttachment"]
transform = Transform( 0.99343, -0.00240871, -0.114417, 0.00240855, 0.999997, -0.000139626, 0.114417, -0.00013687, 0.993433, 0.144429, 0.18077, 0.165634 )
[node name="RightBackAttachment" type="BoneAttachment" parent="armature/Armature/Skeleton" index="8"]
transform = Transform( 0.999993, 0.00165794, -0.00337115, -0.00168643, 0.999963, -0.00847085, 0.00335698, 0.00847647, 0.999959, 0.000565477, 1.13062, -0.000356666 )
transform = Transform( 0.999993, 0.00165795, -0.00337121, -0.00168641, 0.999963, -0.00847091, 0.00335699, 0.00847657, 0.999958, 0.000565481, 1.13062, -0.000356649 )
bone_name = "spine_2"
[node name="RightBackAP" type="Spatial" parent="armature/Armature/Skeleton/RightBackAttachment"]
transform = Transform( 0.999997, -0.00244424, -0.000479204, 0.00243884, 0.999966, -3.47705e-05, 0.000479292, 3.44458e-05, 1, 0.000560207, -0.00363708, -0.120332 )
[node name="LeftBackAttachment" type="BoneAttachment" parent="armature/Armature/Skeleton" index="9"]
transform = Transform( 0.999993, 0.00165794, -0.00337115, -0.00168643, 0.999963, -0.00847085, 0.00335698, 0.00847647, 0.999959, 0.000565477, 1.13062, -0.000356666 )
transform = Transform( 0.999993, 0.00165795, -0.00337121, -0.00168641, 0.999963, -0.00847091, 0.00335699, 0.00847657, 0.999958, 0.000565481, 1.13062, -0.000356649 )
bone_name = "spine_2"
[node name="LeftBackAP" type="Spatial" parent="armature/Armature/Skeleton/LeftBackAttachment"]