feat: customizable hero can now be configured in the editor (only for editor)

main
Sara 2024-02-04 22:32:41 +01:00
parent b6da8e1bf8
commit 3c70d35b0b
3 changed files with 303 additions and 5 deletions

View File

@ -1,4 +1,219 @@
[gd_scene format=3 uid="uid://dw8q1vqnc657"] [gd_scene load_steps=5 format=3 uid="uid://dw8q1vqnc657"]
[ext_resource type="PackedScene" uid="uid://c8h5f82tunglj" path="res://Models/Characters/ModularCharacters.fbx" id="1_b4mv3"]
[sub_resource type="Animation" id="Animation_ckewo"]
resource_name = "Take 001"
length = 2.63333
tracks/0/type = "rotation_3d"
tracks/0/imported = true
tracks/0/enabled = true
tracks/0/path = NodePath("RootNode/Skeleton3D:Spine_01")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = PackedFloat32Array(0, 1, 0.99502, 0.0996789, -1.32155e-15, 7.08517e-17, 0.966667, 1, 0.99502, 0.0996789, -1.32155e-15, 7.08517e-17, 1, 1, 0.994443, 0.105273, -6.49255e-05, 7.60056e-06, 1.03333, 1, 0.992727, 0.120391, -0.000240586, 2.81644e-05, 1.06667, 1, 0.989791, 0.142524, -0.000498229, 5.83256e-05, 1.1, 1, 0.98559, 0.169151, -0.000808954, 9.47009e-05, 1.13333, 1, 0.98025, 0.197761, -0.00114378, 0.000133897, 1.16667, 1, 0.974154, 0.225878, -0.00147381, 0.000172533, 1.2, 1, 0.967963, 0.251086, -0.00177053, 0.000207268, 1.23333, 1, 0.962569, 0.271031, -0.00200586, 0.000234818, 1.26667, 1, 0.958997, 0.28341, -0.00215218, 0.000251947, 1.3, 1, 0.958249, 0.285926, -0.00218196, 0.000255433, 1.33333, 1, 0.959274, 0.282468, -0.00214105, 0.000250644, 1.36667, 1, 0.960437, 0.27849, -0.00209401, 0.000245137, 1.4, 1, 0.961725, 0.27401, -0.00204107, 0.000238939, 1.43333, 1, 0.963125, 0.269047, -0.00198244, 0.000232076, 1.46667, 1, 0.964625, 0.263619, -0.00191835, 0.000224573, 1.5, 1, 0.966212, 0.257744, -0.00184903, 0.000216458, 1.53333, 1, 0.967871, 0.25144, -0.0017747, 0.000207757, 1.56667, 1, 0.969591, 0.244726, -0.00169559, 0.000198496, 1.6, 1, 0.971357, 0.237621, -0.00161193, 0.000188702, 1.63333, 1, 0.973156, 0.230143, -0.00152395, 0.000178402, 1.66667, 1, 0.974975, 0.22231, -0.00143188, 0.000167624, 1.7, 1, 0.976801, 0.214143, -0.00133595, 0.000156394, 1.73333, 1, 0.978623, 0.20566, -0.0012364, 0.000144741, 1.76667, 1, 0.980427, 0.196881, -0.00113347, 0.000132691, 1.8, 1, 0.982202, 0.187826, -0.0010274, 0.000120273, 1.83333, 1, 0.983937, 0.178514, -0.000918428, 0.000107517, 1.86667, 1, 0.985622, 0.168966, -0.000806799, 9.44486e-05, 1.9, 1, 0.987246, 0.159202, -0.000692761, 8.10987e-05, 1.93333, 1, 0.9888, 0.149243, -0.000576562, 6.74957e-05, 1.96667, 1, 0.990277, 0.13911, -0.000458452, 5.3669e-05, 2, 1, 0.991667, 0.128824, -0.000338681, 3.9648e-05, 2.06667, 1, 0.994164, 0.107878, -9.51748e-05, 1.11417e-05, 2.3, 1, 0.999457, 0.0329305, 0.000771924, -9.03659e-05, 2.36667, 1, 0.99993, 0.0117785, 0.00101547, -0.000118876, 2.4, 1, 0.999998, 0.001357, 0.00113527, -0.000132901, 2.43333, 1, 0.999959, -0.00893196, 0.00125342, -0.000146733, 2.46667, 1, 0.999817, -0.0190664, 0.00136969, -0.000160344, 2.5, 1, 0.999578, -0.0290244, 0.00148381, -0.000173703, 2.53333, 1, 0.999246, -0.0387841, 0.00159555, -0.000186784, 2.56667, 1, 0.99883, -0.048324, 0.00170467, -0.000199558, 2.6, 1, 0.998337, -0.0576224, 0.00181092, -0.000211997, 2.63333, 1, 0.997774, -0.0666581, 0.00191408, -0.000224073)
tracks/1/type = "rotation_3d"
tracks/1/imported = true
tracks/1/enabled = true
tracks/1/path = NodePath("RootNode/Skeleton3D:Spine_02")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = PackedFloat32Array(0, 1, 0.995186, 0.0980028, 5.60143e-16, -5.62927e-16, 0.966667, 1, 0.995186, 0.0980028, 5.60143e-16, -5.62927e-16, 1, 1, 0.995722, 0.0924047, 4.23555e-05, -3.37352e-06, 1.03333, 1, 0.997012, 0.0772432, 0.000156951, -1.25008e-05, 1.06667, 1, 0.998488, 0.0549646, 0.00032503, -2.5888e-05, 1.1, 1, 0.999607, 0.0280308, 0.000527738, -4.20332e-05, 1.13333, 1, 0.999999, -0.00107169, 0.000746165, -5.94305e-05, 1.16667, 1, 0.999554, -0.0298403, 0.000961473, -7.65792e-05, 1.2, 1, 0.998443, -0.0557743, 0.00115504, -9.19964e-05, 1.23333, 1, 0.997077, -0.0763911, 0.00130857, -0.000104224, 1.26667, 1, 0.99601, -0.0892314, 0.00140402, -0.000111827, 1.3, 1, 0.995772, -0.0918462, 0.00142345, -0.000113374, 1.33333, 1, 0.996097, -0.0882538, 0.00139676, -0.000111249, 1.36667, 1, 0.996454, -0.0841246, 0.00136607, -0.000108805, 1.4, 1, 0.996836, -0.0794788, 0.00133153, -0.000106054, 1.43333, 1, 0.997232, -0.074337, 0.00129328, -0.000103007, 1.46667, 1, 0.997635, -0.0687194, 0.00125147, -9.96772e-05, 1.5, 1, 0.998035, -0.0626467, 0.00120625, -9.60753e-05, 1.53333, 1, 0.998422, -0.0561394, 0.00115776, -9.22132e-05, 1.56667, 1, 0.998787, -0.0492183, 0.00110615, -8.81028e-05, 1.6, 1, 0.999121, -0.0419041, 0.00105158, -8.37558e-05, 1.63333, 1, 0.999414, -0.0342178, 0.00099418, -7.91843e-05, 1.66667, 1, 0.999657, -0.0261804, 0.000934115, -7.44003e-05, 1.7, 1, 0.999841, -0.0178132, 0.000871535, -6.94159e-05, 1.73333, 1, 0.999958, -0.00913759, 0.000806593, -6.42434e-05, 1.76667, 1, 1, -0.000174957, 0.000739444, -5.88951e-05, 1.8, 1, 0.999959, 0.00905304, 0.000670246, -5.33836e-05, 1.83333, 1, 0.999828, 0.0185246, 0.000599155, -4.77214e-05, 1.86667, 1, 0.999602, 0.0282179, 0.000526332, -4.19212e-05, 1.9, 1, 0.999273, 0.0381108, 0.000451937, -3.59958e-05, 1.93333, 1, 0.998839, 0.0481814, 0.000376132, -2.99581e-05, 1.96667, 1, 0.998293, 0.0584074, 0.00029908, -2.38211e-05, 2, 1, 0.997633, 0.0687666, 0.000220946, -1.75979e-05, 2.06667, 1, 0.99596, 0.0897955, 6.20893e-05, -4.94527e-06, 2.33333, 1, 0.984605, 0.174793, -0.000583394, 4.64661e-05, 2.36667, 1, 0.982709, 0.185155, -0.00066246, 5.27635e-05, 2.4, 1, 0.980726, 0.195387, -0.000740616, 5.89884e-05, 2.43333, 1, 0.978664, 0.205467, -0.000817697, 6.51278e-05, 2.46667, 1, 0.976531, 0.215376, -0.000893544, 7.11688e-05, 2.5, 1, 0.974337, 0.225093, -0.000967994, 7.70986e-05, 2.53333, 1, 0.972092, 0.234597, -0.00104089, 8.29047e-05, 2.56667, 1, 0.969808, 0.243869, -0.00111207, 8.85743e-05, 2.6, 1, 0.967494, 0.252889, -0.00118139, 9.40953e-05, 2.63333, 1, 0.965165, 0.261638, -0.00124869, 9.94552e-05)
tracks/2/type = "rotation_3d"
tracks/2/imported = true
tracks/2/enabled = true
tracks/2/path = NodePath("RootNode/Skeleton3D:Spine_03")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = PackedFloat32Array(0, 1, 0.99381, 0.11109, -3.91661e-17, -7.27518e-16, 0.966667, 1, 0.99381, 0.11109, -3.91661e-17, -7.27518e-16, 1, 1, 0.99317, 0.116675, 7.79419e-06, 0.000153309, 1.03333, 1, 0.99128, 0.131769, 2.88819e-05, 0.000568098, 1.06667, 1, 0.988092, 0.15386, 5.98115e-05, 0.00117647, 1.1, 1, 0.983586, 0.180428, 9.71135e-05, 0.00191019, 1.13333, 1, 0.977919, 0.208966, 0.000137308, 0.0027008, 1.16667, 1, 0.971503, 0.237003, 0.000176929, 0.00348012, 1.2, 1, 0.965023, 0.26213, 0.000212549, 0.00418076, 1.23333, 1, 0.959401, 0.282006, 0.0002408, 0.00473645, 1.26667, 1, 0.955688, 0.294339, 0.000258366, 0.00508197, 1.3, 1, 0.954911, 0.296846, 0.00026194, 0.00515227, 1.33333, 1, 0.955976, 0.293401, 0.000257029, 0.00505568, 1.36667, 1, 0.957184, 0.289438, 0.000251382, 0.0049446, 1.4, 1, 0.958523, 0.284975, 0.000245026, 0.00481958, 1.43333, 1, 0.95998, 0.280029, 0.000237988, 0.00468114, 1.46667, 1, 0.961542, 0.27462, 0.000230294, 0.00452981, 1.5, 1, 0.963196, 0.268766, 0.000221972, 0.00436612, 1.53333, 1, 0.964927, 0.262483, 0.000213049, 0.00419061, 1.56667, 1, 0.966724, 0.255792, 0.000203553, 0.00400381, 1.6, 1, 0.968571, 0.248709, 0.000193509, 0.00380626, 1.63333, 1, 0.970455, 0.241254, 0.000182947, 0.00359851, 1.66667, 1, 0.972364, 0.233446, 0.000171894, 0.0033811, 1.7, 1, 0.974284, 0.225303, 0.000160378, 0.00315459, 1.73333, 1, 0.976202, 0.216844, 0.000148428, 0.00291953, 1.76667, 1, 0.978106, 0.208089, 0.000136071, 0.00267648, 1.8, 1, 0.979985, 0.199058, 0.000123338, 0.00242601, 1.83333, 1, 0.981826, 0.189769, 0.000110256, 0.00216869, 1.86667, 1, 0.98362, 0.180244, 9.68548e-05, 0.0019051, 1.9, 1, 0.985356, 0.170502, 8.31647e-05, 0.00163582, 1.93333, 1, 0.987024, 0.160565, 6.92152e-05, 0.00136144, 1.96667, 1, 0.988617, 0.150453, 5.50363e-05, 0.00108254, 2, 1, 0.990125, 0.140186, 4.06581e-05, 0.00079973, 2.06667, 1, 0.992861, 0.119276, 1.14256e-05, 0.000224737, 2.3, 1, 0.999011, 0.0444175, -9.2668e-05, -0.00182275, 2.36667, 1, 0.999726, 0.0232786, -0.000121905, -0.00239783, 2.4, 1, 0.999914, 0.0128618, -0.000136287, -0.00268072, 2.43333, 1, 0.999992, 0.00257615, -0.000150471, -0.00295972, 2.46667, 1, 0.999966, -0.0075562, -0.000164428, -0.00323425, 2.5, 1, 0.999841, -0.0175133, -0.000178129, -0.00350373, 2.53333, 1, 0.999621, -0.0272733, -0.000191543, -0.00376758, 2.56667, 1, 0.999314, -0.0368144, -0.000204642, -0.00402524, 2.6, 1, 0.998927, -0.0461151, -0.000217398, -0.00427614, 2.63333, 1, 0.998468, -0.0551539, -0.000229781, -0.00451972)
tracks/3/type = "rotation_3d"
tracks/3/imported = true
tracks/3/enabled = true
tracks/3/path = NodePath("RootNode/Skeleton3D:Neck")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = PackedFloat32Array(0, 1, 7.07478e-17, -1.29906e-15, -0.0417333, 0.999129, 0.966667, 1, 7.07478e-17, -1.29906e-15, -0.0417333, 0.999129, 1, 1, -4.38324e-06, -0.000135251, -0.0473499, 0.998878, 1.03333, 1, -1.62424e-05, -0.000501184, -0.0625393, 0.998042, 1.06667, 1, -3.36364e-05, -0.0010379, -0.0848003, 0.996397, 1.1, 1, -5.4614e-05, -0.00168519, -0.11162, 0.99375, 1.13333, 1, -7.72184e-05, -0.00238268, -0.140485, 0.99008, 1.16667, 1, -9.94998e-05, -0.00307021, -0.168903, 0.985628, 1.2, 1, -0.000119532, -0.00368832, -0.194422, 0.980911, 1.23333, 1, -0.000135419, -0.00417856, -0.214642, 0.976684, 1.26667, 1, -0.000145298, -0.00448338, -0.227204, 0.973837, 1.3, 1, -0.000147308, -0.0045454, -0.22976, 0.973237, 1.33333, 1, -0.000144546, -0.00446019, -0.226249, 0.974059, 1.36667, 1, -0.000141371, -0.0043622, -0.222211, 0.974989, 1.4, 1, -0.000137796, -0.0042519, -0.217665, 0.976014, 1.43333, 1, -0.000133838, -0.00412976, -0.21263, 0.977124, 1.46667, 1, -0.000129511, -0.00399626, -0.207125, 0.978306, 1.5, 1, -0.000124831, -0.00385185, -0.201169, 0.979549, 1.53333, 1, -0.000119813, -0.00369701, -0.194781, 0.98084, 1.56667, 1, -0.000114472, -0.00353221, -0.18798, 0.982167, 1.6, 1, -0.000108824, -0.00335794, -0.180786, 0.983517, 1.63333, 1, -0.000102885, -0.00317465, -0.173217, 0.984879, 1.66667, 1, -9.66687e-05, -0.00298285, -0.165294, 0.98624, 1.7, 1, -9.01925e-05, -0.00278302, -0.157037, 0.987589, 1.73333, 1, -8.34718e-05, -0.00257564, -0.148464, 0.988914, 1.76667, 1, -7.65228e-05, -0.00236122, -0.139597, 0.990206, 1.8, 1, -6.93617e-05, -0.00214026, -0.130456, 0.991452, 1.83333, 1, -6.20047e-05, -0.00191325, -0.121062, 0.992643, 1.86667, 1, -5.44685e-05, -0.0016807, -0.111434, 0.99377, 1.9, 1, -4.67696e-05, -0.00144314, -0.101594, 0.994825, 1.93333, 1, -3.89248e-05, -0.00120108, -0.0915643, 0.995798, 1.96667, 1, -3.09509e-05, -0.000955035, -0.0813647, 0.996684, 2, 1, -2.2865e-05, -0.000705533, -0.0710174, 0.997475, 2.03333, 1, -1.46841e-05, -0.0004531, -0.060544, 0.998165, 2.2, 1, 2.70424e-05, 0.000834434, -0.00705271, 0.999975, 2.23333, 1, 3.54312e-05, 0.00109328, 0.0037157, 0.999992, 2.33333, 1, 6.03736e-05, 0.00186292, 0.0357622, 0.999359, 2.36667, 1, 6.8556e-05, 0.00211539, 0.0462844, 0.998926, 2.4, 1, 7.6644e-05, 0.00236496, 0.05669, 0.998389, 2.43333, 1, 8.4621e-05, 0.0026111, 0.0669571, 0.997752, 2.46667, 1, 9.24701e-05, 0.0028533, 0.0770639, 0.997022, 2.5, 1, 0.000100175, 0.00309104, 0.086989, 0.996205, 2.53333, 1, 0.000107719, 0.00332381, 0.0967109, 0.995307, 2.56667, 1, 0.000115085, 0.00355112, 0.106208, 0.994338, 2.6, 1, 0.000122259, 0.00377247, 0.11546, 0.993305, 2.63333, 1, 0.000129223, 0.00398736, 0.124446, 0.992218)
tracks/4/type = "rotation_3d"
tracks/4/imported = true
tracks/4/enabled = true
tracks/4/path = NodePath("RootNode/Skeleton3D:Clavicle_L")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = PackedFloat32Array(0, 1, 0.578548, 0.632486, -0.352513, 0.375471, 0.466667, 1, 0.646782, 0.560995, -0.30937, 0.413822, 0.933333, 1, 0.706543, 0.482156, -0.262174, 0.446751, 0.966667, 1, 0.710467, 0.47627, -0.258664, 0.448884, 2.63333, 1, 0.710467, 0.47627, -0.258664, 0.448884)
tracks/5/type = "rotation_3d"
tracks/5/imported = true
tracks/5/enabled = true
tracks/5/path = NodePath("RootNode/Skeleton3D:Shoulder_L")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = PackedFloat32Array(0, 1, 0.0113281, -0.23686, -0.0338065, 0.970889, 0.7, 1, -0.0147209, -0.236673, 0.0728921, 0.968739, 0.966667, 1, -0.0246146, -0.23585, 0.113378, 0.964839, 2.63333, 1, -0.0246146, -0.23585, 0.113378, 0.964839)
tracks/6/type = "rotation_3d"
tracks/6/imported = true
tracks/6/enabled = true
tracks/6/path = NodePath("RootNode/Skeleton3D:Elbow_L")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = PackedFloat32Array(0, 1, 0.00168383, -0.0407496, 0.0412519, 0.998316, 2.63333, 1, 0.0253554, -0.681801, 0.0300695, 0.73048)
tracks/7/type = "rotation_3d"
tracks/7/imported = true
tracks/7/enabled = true
tracks/7/path = NodePath("RootNode/Skeleton3D:Clavicle_R")
tracks/7/interp = 1
tracks/7/loop_wrap = true
tracks/7/keys = PackedFloat32Array(0, 1, 0.632486, -0.578548, -0.375471, -0.352513, 0.166667, 1, 0.609764, -0.602447, -0.388753, -0.33781, 0.2, 1, -0.605111, 0.607122, 0.39134, 0.334809, 0.733333, 1, -0.525973, 0.676837, 0.429495, 0.284216, 0.966667, 1, -0.488771, 0.704172, 0.444173, 0.260681, 2.63333, 1, -0.488771, 0.704172, 0.444173, 0.260681)
tracks/8/type = "rotation_3d"
tracks/8/imported = true
tracks/8/enabled = true
tracks/8/path = NodePath("RootNode/Skeleton3D:Shoulder_R")
tracks/8/interp = 1
tracks/8/loop_wrap = true
tracks/8/keys = PackedFloat32Array(0, 1, 0.0113281, -0.23686, -0.0338065, 0.970889, 0.966667, 1, -0.0124639, -0.236803, 0.0636533, 0.96939, 2.63333, 1, -0.0124639, -0.236803, 0.0636533, 0.96939)
tracks/9/type = "rotation_3d"
tracks/9/imported = true
tracks/9/enabled = true
tracks/9/path = NodePath("RootNode/Skeleton3D:Elbow_R")
tracks/9/interp = 1
tracks/9/loop_wrap = true
tracks/9/keys = PackedFloat32Array(0, 1, 0.00168383, -0.0407496, 0.0412519, 0.998316, 2.63333, 1, 0.00855582, -0.700158, 0.0286455, 0.713362)
tracks/10/type = "rotation_3d"
tracks/10/imported = true
tracks/10/enabled = true
tracks/10/path = NodePath("RootNode/Skeleton3D:Thumb_01_2")
tracks/10/interp = 1
tracks/10/loop_wrap = true
tracks/10/keys = PackedFloat32Array(0, 1, 0.0254806, -0.276843, -0.0880396, 0.956534, 0.3, 1, 0.0339865, -0.121864, -0.083387, 0.988454, 2.63333, 1, 0.0339865, -0.121864, -0.083387, 0.988454)
tracks/11/type = "rotation_3d"
tracks/11/imported = true
tracks/11/enabled = true
tracks/11/path = NodePath("RootNode/Skeleton3D:Thumb_02_2")
tracks/11/interp = 1
tracks/11/loop_wrap = true
tracks/11/keys = PackedFloat32Array(0, 1, -0.039942, 0.11784, -0.141636, 0.982068, 0.3, 1, -0.0148419, 0.271167, -0.14729, 0.95108, 2.63333, 1, -0.0148419, 0.271167, -0.14729, 0.95108)
tracks/12/type = "rotation_3d"
tracks/12/imported = true
tracks/12/enabled = true
tracks/12/path = NodePath("RootNode/Skeleton3D:Thumb_03_2")
tracks/12/interp = 1
tracks/12/loop_wrap = true
tracks/12/keys = PackedFloat32Array(0, 1, -0.0364033, 0.152035, 0.229995, 0.960553, 0.3, 1, 0.00856023, 0.300065, 0.22903, 0.925977, 2.63333, 1, 0.00856023, 0.300065, 0.22903, 0.925977)
tracks/13/type = "rotation_3d"
tracks/13/imported = true
tracks/13/enabled = true
tracks/13/path = NodePath("RootNode/Skeleton3D:IndexFinger_01_2")
tracks/13/interp = 1
tracks/13/loop_wrap = true
tracks/13/keys = PackedFloat32Array(0, 1, 0.000280495, -0.0657944, -0.00425393, 0.997824, 0.0333333, 1, 0.00279181, -0.0657358, -0.0423399, 0.996934, 0.3, 1, 0.0224309, -0.0618534, -0.340182, 0.938055, 2.63333, 1, 0.0224309, -0.0618534, -0.340182, 0.938055)
tracks/14/type = "rotation_3d"
tracks/14/imported = true
tracks/14/enabled = true
tracks/14/path = NodePath("RootNode/Skeleton3D:IndexFinger_02_2")
tracks/14/interp = 1
tracks/14/loop_wrap = true
tracks/14/keys = PackedFloat32Array(0, 1, -0.00115399, 0.0107416, -0.0983299, 0.995095, 0.3, 1, -0.00470549, 0.00972486, -0.427839, 0.903791, 2.63333, 1, -0.00470549, 0.00972486, -0.427839, 0.903791)
tracks/15/type = "rotation_3d"
tracks/15/imported = true
tracks/15/enabled = true
tracks/15/path = NodePath("RootNode/Skeleton3D:IndexFinger_03_2")
tracks/15/interp = 1
tracks/15/loop_wrap = true
tracks/15/keys = PackedFloat32Array(0, 1, -0.0069122, 0.0257174, -0.0570024, 0.998019, 0.3, 1, -0.0151725, 0.0218851, -0.389912, 0.920467, 2.63333, 1, -0.0151725, 0.0218851, -0.389912, 0.920467)
tracks/16/type = "rotation_3d"
tracks/16/imported = true
tracks/16/enabled = true
tracks/16/path = NodePath("RootNode/Skeleton3D:IndexFinger_04_2")
tracks/16/interp = 1
tracks/16/loop_wrap = true
tracks/16/keys = PackedFloat32Array(0, 1, -0.00451965, 0.0280399, 0.159068, 0.986859, 0.0666667, 1, -0.000206443, 0.0264292, 0.0834327, 0.996163, 0.1, 1, 0.00195218, 0.0255654, 0.045405, 0.99864, 0.133333, 1, 0.00410797, 0.0246644, 0.00731118, 0.999661, 0.166667, 1, 0.00625776, 0.0237274, -0.0307934, 0.999224, 0.3, 1, 0.0147346, 0.0196481, -0.182209, 0.982953, 2.63333, 1, 0.0147346, 0.0196481, -0.182209, 0.982953)
tracks/17/type = "rotation_3d"
tracks/17/imported = true
tracks/17/enabled = true
tracks/17/path = NodePath("RootNode/Skeleton3D:Finger_01_2")
tracks/17/interp = 1
tracks/17/loop_wrap = true
tracks/17/keys = PackedFloat32Array(0, 1, -0.00248643, 0.0438797, -0.0565193, 0.997434, 0.3, 1, -0.0171246, 0.0404767, -0.38926, 0.920079, 2.63333, 1, -0.0171246, 0.0404767, -0.38926, 0.920079)
tracks/18/type = "rotation_3d"
tracks/18/imported = true
tracks/18/enabled = true
tracks/18/path = NodePath("RootNode/Skeleton3D:Finger_02_2")
tracks/18/interp = 1
tracks/18/loop_wrap = true
tracks/18/keys = PackedFloat32Array(0, 1, 0.00263727, -0.019492, -0.0212693, 0.99958, 0.3, 1, 0.00905014, -0.0174639, -0.356794, 0.933976, 2.63333, 1, 0.00905014, -0.0174639, -0.356794, 0.933976)
tracks/19/type = "rotation_3d"
tracks/19/imported = true
tracks/19/enabled = true
tracks/19/path = NodePath("RootNode/Skeleton3D:Finger_03_2")
tracks/19/interp = 1
tracks/19/loop_wrap = true
tracks/19/keys = PackedFloat32Array(0, 1, -0.0181492, 0.0714789, -0.0925108, 0.992977, 0.3, 1, -0.0411701, 0.0611854, -0.421646, 0.903757, 2.63333, 1, -0.0411701, 0.0611854, -0.421646, 0.903757)
tracks/20/type = "rotation_3d"
tracks/20/imported = true
tracks/20/enabled = true
tracks/20/path = NodePath("RootNode/Skeleton3D:Finger_04_2")
tracks/20/interp = 1
tracks/20/loop_wrap = true
tracks/20/keys = PackedFloat32Array(0, 1, 0.0166464, -0.0965253, 0.16913, 0.980714, 0.0666667, 1, 0.0101437, -0.0973571, 0.0937358, 0.990774, 0.1, 1, 0.00686777, -0.0975604, 0.0558062, 0.99364, 0.133333, 1, 0.00358186, -0.0976214, 0.0177952, 0.995058, 0.166667, 1, 0.000290722, -0.0975402, -0.0202417, 0.995026, 0.2, 1, -0.00300084, -0.0973168, -0.0582491, 0.993543, 0.3, 1, -0.0128301, -0.0957977, -0.171541, 0.980424, 2.63333, 1, -0.0128301, -0.0957977, -0.171541, 0.980424)
tracks/21/type = "rotation_3d"
tracks/21/imported = true
tracks/21/enabled = true
tracks/21/path = NodePath("RootNode/Skeleton3D:UpperLeg_R")
tracks/21/interp = 1
tracks/21/loop_wrap = true
tracks/21/keys = PackedFloat32Array(0, 1, -0.0417752, 0.705872, -0.70419, 0.0641594, 0.0333333, 1, -0.0293165, 0.707805, -0.703341, 0.0588568, 0.0666667, 1, -0.0158787, 0.709634, -0.702395, 0.0530001, 0.1, 1, -0.00156003, 0.711354, -0.701283, 0.0466399, 0.133333, 1, 0.0135395, 0.71296, -0.699942, 0.0398275, 0.166667, 1, 0.0293178, 0.714449, -0.698312, 0.0326145, 0.2, 1, 0.0456707, 0.715818, -0.696342, 0.0250533, 0.233333, 1, 0.062492, 0.717065, -0.693986, 0.0171964, 0.266667, 1, 0.0796738, 0.718192, -0.691209, 0.00909673, 0.3, 1, 0.0971064, 0.719199, -0.687984, 0.000807262, 0.466667, 1, 0.184165, 0.722666, -0.664908, -0.0416379, 0.5, 1, 0.20079, 0.723119, -0.659004, -0.04996, 0.533333, 1, 0.216907, 0.723527, -0.652751, -0.0581061, 0.566667, 1, 0.232414, 0.723909, -0.646205, -0.0660254, 0.6, 1, 0.247217, 0.724286, -0.639427, -0.0736677, 0.633333, 1, 0.261222, 0.724682, -0.632488, -0.0809834, 0.666667, 1, 0.274342, 0.725122, -0.625463, -0.0879228, 0.7, 1, 0.286495, 0.725631, -0.618435, -0.094437, 0.733333, 1, 0.297599, 0.726238, -0.611488, -0.100477, 0.766667, 1, 0.307582, 0.726969, -0.60471, -0.105993, 0.8, 1, 0.316372, 0.727855, -0.598189, -0.110936, 0.833333, 1, 0.323899, 0.728923, -0.592011, -0.115257, 0.866667, 1, 0.3301, 0.730201, -0.586262, -0.118903, 0.9, 1, 0.334908, 0.731717, -0.581022, -0.121824, 0.933333, 1, 0.338262, 0.733496, -0.576364, -0.123966, 0.966667, 1, 0.340097, 0.735562, -0.572354, -0.125274, 1.03333, 1, 0.338951, 0.740637, -0.566485, -0.125154, 1.06667, 1, 0.335833, 0.743678, -0.564696, -0.123603, 1.1, 1, 0.330924, 0.747066, -0.56369, -0.120971, 1.13333, 1, 0.324147, 0.750807, -0.563458, -0.117187, 1.16667, 1, 0.31111, 0.755843, -0.565527, -0.109959, 1.2, 1, 0.28829, 0.762788, -0.570587, -0.0973355, 1.23333, 1, 0.256917, 0.771076, -0.577129, -0.0797351, 1.26667, 1, 0.218291, 0.7801, -0.583504, -0.057585, 1.3, 1, 0.173855, 0.789244, -0.58812, -0.0313523, 1.33333, 1, 0.12521, 0.797925, -0.589606, -0.00156902, 1.36667, 1, 0.0740916, 0.805621, -0.586953, 0.031156, 1.46667, 1, -0.0765461, 0.81909, -0.551091, 0.139753, 1.5, 1, -0.120676, 0.819759, -0.531227, 0.176721, 1.53333, 1, -0.159858, 0.818549, -0.509124, 0.212639, 1.56667, 1, -0.193473, 0.815679, -0.486214, 0.246641, 1.6, 1, -0.221247, 0.811482, -0.464036, 0.277881, 1.63333, 1, -0.243179, 0.80638, -0.444133, 0.305549, 1.66667, 1, -0.259434, 0.800859, -0.427976, 0.328869, 1.7, 1, -0.270193, 0.795426, -0.41691, 0.347103, 1.73333, 1, -0.275488, 0.790565, -0.412126, 0.359535, 1.76667, 1, -0.277167, 0.786182, -0.411984, 0.36792, 1.8, 1, -0.277266, 0.781914, -0.414063, 0.374546, 1.83333, 1, -0.275839, 0.777788, -0.418239, 0.379519, 1.86667, 1, -0.272904, 0.773816, -0.424368, 0.38294, 1.9, 1, -0.268448, 0.770002, -0.432292, 0.384912, 1.93333, 1, -0.262435, 0.766337, -0.441835, 0.385535, 1.96667, 1, -0.254819, 0.762808, -0.45281, 0.384908, 2, 1, -0.24555, 0.759395, -0.46501, 0.383131, 2.03333, 1, -0.234578, 0.756075, -0.478221, 0.380301, 2.06667, 1, -0.221868, 0.752819, -0.492212, 0.376518, 2.1, 1, -0.207396, 0.7496, -0.506748, 0.371879, 2.13333, 1, -0.191165, 0.746389, -0.521585, 0.366482, 2.16667, 1, -0.173201, 0.743158, -0.53648, 0.360427, 2.2, 1, -0.153564, 0.73988, -0.551191, 0.353812, 2.23333, 1, -0.132345, 0.736533, -0.565488, 0.34674, 2.26667, 1, -0.109667, 0.733093, -0.579152, 0.339309, 2.3, 1, -0.0856896, 0.729545, -0.591987, 0.331622, 2.33333, 1, -0.0606041, 0.725875, -0.603821, 0.32378, 2.43333, 1, 0.0189676, 0.714074, -0.632083, 0.300351, 2.46667, 1, 0.0460377, 0.709882, -0.638867, 0.292913, 2.5, 1, 0.0728949, 0.705577, -0.644321, 0.285829, 2.53333, 1, 0.0992345, 0.701175, -0.648501, 0.279201, 2.56667, 1, 0.12475, 0.696697, -0.6515, 0.273127, 2.6, 1, 0.149138, 0.692169, -0.653448, 0.267704, 2.63333, 1, 0.172102, 0.687618, -0.654505, 0.263031)
tracks/22/type = "rotation_3d"
tracks/22/imported = true
tracks/22/enabled = true
tracks/22/path = NodePath("RootNode/Skeleton3D:Ankle_R")
tracks/22/interp = 1
tracks/22/loop_wrap = true
tracks/22/keys = PackedFloat32Array(0, 1, 0.85767, -0.507213, -0.0397527, -0.0745436, 0.866667, 1, 0.801178, -0.592361, -0.047675, -0.0703443, 1.6, 1, 0.746767, -0.659576, -0.0539899, -0.0662109, 1.76667, 1, 0.7336, -0.674176, -0.05537, -0.0652007, 1.8, 1, 0.730933, -0.677065, -0.0556434, -0.0649956, 2.1, 1, 0.706415, -0.702584, -0.058065, -0.0631046, 2.13333, 1, -0.703636, 0.705365, 0.0583296, 0.0628895, 2.4, 1, -0.681007, 0.727216, 0.0604133, 0.0611339, 2.56667, 1, -0.666517, 0.740506, 0.0616851, 0.0600056, 2.63333, 1, -0.660649, 0.745741, 0.0621872, 0.0595477)
tracks/23/type = "rotation_3d"
tracks/23/imported = true
tracks/23/enabled = true
tracks/23/path = NodePath("RootNode/Skeleton3D:Ball_R")
tracks/23/interp = 1
tracks/23/loop_wrap = true
tracks/23/keys = PackedFloat32Array(0, 1, -8.01262e-16, -1.24803e-15, 0.270016, 0.962856, 2.63333, 1, -0.00706421, 0.00726187, 0.645198, 0.763948)
tracks/24/type = "rotation_3d"
tracks/24/imported = true
tracks/24/enabled = true
tracks/24/path = NodePath("RootNode/Skeleton3D:UpperLeg_L")
tracks/24/interp = 1
tracks/24/loop_wrap = true
tracks/24/keys = PackedFloat32Array(0, 1, -0.705872, -0.0417752, 0.0641594, 0.70419, 0.0333333, 1, -0.704685, -0.0467432, 0.0771256, 0.703765, 0.0666667, 1, -0.703304, -0.0523115, 0.0910932, 0.703085, 0.1, 1, -0.701667, -0.0584138, 0.10596, 0.702156, 0.133333, 1, -0.699714, -0.0649838, 0.121622, 0.700989, 0.166667, 1, -0.697394, -0.0719553, 0.137972, 0.699591, 0.2, 1, -0.69466, -0.0792625, 0.154904, 0.697975, 0.233333, 1, -0.691475, -0.0868406, 0.172306, 0.696155, 0.266667, 1, -0.687811, -0.0946255, 0.190066, 0.694145, 0.3, 1, -0.683647, -0.102554, 0.208072, 0.691965, 0.466667, 1, -0.65542, -0.142267, 0.297826, 0.679327, 0.5, 1, -0.64846, -0.149831, 0.314946, 0.676654, 0.533333, 1, -0.641167, -0.157146, 0.331541, 0.674011, 0.566667, 1, -0.633607, -0.164164, 0.347514, 0.671436, 0.6, 1, -0.625853, -0.170837, 0.362768, 0.66897, 0.633333, 1, -0.617987, -0.177122, 0.377216, 0.666654, 0.666667, 1, -0.610097, -0.182973, 0.390772, 0.66453, 0.7, 1, -0.602276, -0.188348, 0.403357, 0.662641, 0.733333, 1, -0.59462, -0.193203, 0.414895, 0.661031, 0.766667, 1, -0.58723, -0.197497, 0.425316, 0.659744, 0.8, 1, -0.580206, -0.201187, 0.434553, 0.658824, 0.833333, 1, -0.573647, -0.20423, 0.442541, 0.658313, 0.866667, 1, -0.567652, -0.20658, 0.44922, 0.658254, 0.9, 1, -0.562312, -0.208191, 0.454527, 0.658685, 0.933333, 1, -0.557716, -0.209013, 0.458404, 0.659646, 0.966667, 1, -0.553941, -0.208993, 0.460788, 0.66117, 1, 1, -0.551057, -0.208074, 0.461615, 0.663289, 1.03333, 1, -0.54912, -0.206195, 0.460818, 0.666031, 1.06667, 1, -0.548172, -0.203287, 0.458325, 0.669418, 1.1, 1, -0.548237, -0.199278, 0.454057, 0.673466, 1.13333, 1, -0.549321, -0.194086, 0.447933, 0.678184, 1.16667, 1, -0.553534, -0.185326, 0.435561, 0.685231, 1.2, 1, -0.562033, -0.17088, 0.41335, 0.695745, 1.23333, 1, -0.573139, -0.151008, 0.382382, 0.708867, 1.26667, 1, -0.585015, -0.125966, 0.343801, 0.723665, 1.3, 1, -0.595864, -0.0960655, 0.298899, 0.739173, 1.33333, 1, -0.604096, -0.061728, 0.249163, 0.754438, 1.36667, 1, -0.608475, -0.0235212, 0.196257, 0.768562, 1.4, 1, -0.608226, 0.0178273, 0.141959, 0.780763, 1.46667, 1, -0.593313, 0.106274, 0.0362412, 0.797102, 1.5, 1, -0.579629, 0.15123, -0.0120263, 0.800634, 1.53333, 1, -0.56314, 0.195118, -0.0555732, 0.801071, 1.56667, 1, -0.545212, 0.236747, -0.0935677, 0.798711, 1.6, 1, -0.527355, 0.274951, -0.125506, 0.79407, 1.63333, 1, -0.51111, 0.30862, -0.151153, 0.787828, 1.66667, 1, -0.497957, 0.336721, -0.170434, 0.780775, 1.7, 1, -0.489251, 0.358294, -0.183298, 0.773732, 1.73333, 1, -0.486168, 0.372445, -0.189547, 0.767461, 1.76667, 1, -0.48728, 0.381391, -0.191324, 0.761902, 1.8, 1, -0.490406, 0.388029, -0.191111, 0.756579, 1.83333, 1, -0.495421, 0.392507, -0.188972, 0.751522, 1.86667, 1, -0.502177, 0.394975, -0.184933, 0.746735, 1.9, 1, -0.510504, 0.39558, -0.178997, 0.742201, 1.93333, 1, -0.520213, 0.394472, -0.171146, 0.737889, 1.96667, 1, -0.531097, 0.391797, -0.161354, 0.733755, 2, 1, -0.542936, 0.387701, -0.149593, 0.729747, 2.03333, 1, -0.555492, 0.382332, -0.135843, 0.725809, 2.06667, 1, -0.568517, 0.375836, -0.120098, 0.721881, 2.1, 1, -0.581759, 0.36836, -0.102371, 0.717905, 2.13333, 1, -0.594958, 0.360051, -0.0827013, 0.713827, 2.16667, 1, -0.60786, 0.351056, -0.0611578, 0.709596, 2.2, 1, -0.620217, 0.341521, -0.0378424, 0.705169, 2.23333, 1, -0.631796, 0.331589, -0.0128914, 0.700512, 2.26667, 1, -0.642385, 0.321404, 0.0135245, 0.695599, 2.3, 1, -0.651799, 0.311105, 0.0412008, 0.690416, 2.33333, 1, -0.659886, 0.300826, 0.0699021, 0.684958, 2.43333, 1, -0.675265, 0.271397, 0.159423, 0.667042, 2.46667, 1, -0.677348, 0.262454, 0.189402, 0.660639, 2.5, 1, -0.677986, 0.254125, 0.218925, 0.654085, 2.53333, 1, -0.677296, 0.246511, 0.247675, 0.647425, 2.56667, 1, -0.675439, 0.239703, 0.275342, 0.640712, 2.6, 1, -0.672613, 0.233787, 0.301625, 0.634002, 2.63333, 1, -0.669052, 0.228843, 0.326239, 0.62735)
tracks/25/type = "rotation_3d"
tracks/25/imported = true
tracks/25/enabled = true
tracks/25/path = NodePath("RootNode/Skeleton3D:Ankle_L")
tracks/25/interp = 1
tracks/25/loop_wrap = true
tracks/25/keys = PackedFloat32Array(0, 1, 0.85767, -0.507213, -0.0397527, -0.0745436, 0.866667, 1, 0.801314, -0.592548, -0.0452834, -0.0687881, 1.5, 1, 0.754762, -0.651014, -0.0490269, -0.0641207, 1.53333, 1, 0.752192, -0.653992, -0.0492164, -0.0638648, 2.1, 1, 0.706742, -0.703032, -0.0523194, -0.059366, 2.13333, 1, -0.703967, 0.70582, 0.0524947, 0.0590929, 2.63333, 1, -0.661056, 0.7463, 0.055025, 0.0548874)
tracks/26/type = "rotation_3d"
tracks/26/imported = true
tracks/26/enabled = true
tracks/26/path = NodePath("RootNode/Skeleton3D:Ball_L")
tracks/26/interp = 1
tracks/26/loop_wrap = true
tracks/26/keys = PackedFloat32Array(0, 1, 3.53394e-15, -4.89182e-15, 0.270016, 0.962856, 2.63333, 1, -0.005258, -0.00147451, 0.579877, 0.814686)
[sub_resource type="AnimationLibrary" id="AnimationLibrary_2cvfb"]
_data = {
"Take 001": SubResource("Animation_ckewo")
}
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_7e1iu"]
graph_offset = Vector2(-457, 44)
[node name="Player" type="Player"] [node name="Player" type="Player"]
selected = "Torso"
index = 15
slide_on_ceiling = false slide_on_ceiling = false
[node name="Model" parent="." instance=ExtResource("1_b4mv3")]
[node name="AnimationTree" type="AnimationTree" parent="."]
root_node = NodePath("../Model")
libraries = {
"": SubResource("AnimationLibrary_2cvfb")
}
tree_root = SubResource("AnimationNodeStateMachine_7e1iu")
anim_player = NodePath("../Model/AnimationPlayer")

View File

@ -1,13 +1,76 @@
#include "player.hpp" #include "player.hpp"
#include <utility>
#include "godot_cpp/classes/animation_tree.hpp" #include "godot_cpp/classes/animation_tree.hpp"
#include "godot_cpp/classes/node3d.hpp" #include "godot_cpp/classes/node3d.hpp"
#include "godot_cpp/classes/skeleton3d.hpp"
#include "godot_cpp/variant/utility_functions.hpp"
#include "godot_macros.h"
namespace godot { namespace godot {
void Player::_bind_methods() {} void Player::_bind_methods() {
#define CLASSNAME Player
#ifndef NDEBUG
GDPROPERTY(selected, Variant::STRING);
GDPROPERTY(index, Variant::INT);
#endif
}
void Player::_enter_tree() { void Player::_enter_tree() {
this->model = this->get_node<Node3D>("Model"); this->model = this->get_node<Node3D>("Model");
this->animTree = this->get_node<AnimationTree>("Model/AnimationTree"); this->animTree = this->get_node<AnimationTree>("AnimationTree");
this->customization_init();
} }
void Player::_exit_tree() {
for(std::pair<const String, std::pair<size_t, std::vector<Node3D*>>>& pair: this->customization) {
for(Node3D *option: pair.second.second) {
if(!option->is_inside_tree()) {
option->queue_free();
}
}
}
}
void Player::_process(double deltaTime) {} void Player::_process(double deltaTime) {}
void Player::_physics_process(double deltaTime) {} void Player::_physics_process(double deltaTime) {}
void Player::customization_init() {
customizationParent = this->get_node<Skeleton3D>("Model/RootNode/Skeleton3D");
if(!customizationParent)
return;
for(int i = 0; i < customizationParent->get_child_count(); ++i) {
Node3D *child = Object::cast_to<Node3D>(customizationParent->get_child(i));
if(!child)
continue;
String name = child->get_name();
PackedStringArray slices = name.split("_", false);
if(customization.find(slices[1]) != customization.end()) {
auto &array = customization.at(slices[1]);
array.second.push_back(child);
customizationParent->remove_child(child);
--i;
} else {
customization.insert({slices[1], {0, {child}}});
}
}
UtilityFunctions::print("customization categories:");
for(std::pair<const String, std::pair<size_t, std::vector<Node3D *>>>& pair: this->customization) {
UtilityFunctions::print("- ", pair.first);
}
}
void Player::select_customization(String key, int index) {
std::pair<size_t, std::vector<Node3D *>> &pair = this->customization.at(key);
if(index > pair.second.size())
return;
if(index == pair.first)
return;
customizationParent->remove_child(pair.second[pair.first]);
customizationParent->add_child(pair.second[index]);
pair.first = index;
}
#ifndef NDEBUG
void Player::set_selected(String value) { this->selected = value; }
String Player::get_selected() const { return this->selected; }
#endif
} // namespace godot } // namespace godot

View File

@ -1,8 +1,10 @@
#ifndef PLAYER_HPP #ifndef PLAYER_HPP
#define PLAYER_HPP #define PLAYER_HPP
#include <map>
#include "godot_cpp/classes/animation_tree.hpp" #include "godot_cpp/classes/animation_tree.hpp"
#include "godot_cpp/classes/character_body3d.hpp" #include "godot_cpp/classes/character_body3d.hpp"
#include "godot_cpp/classes/skeleton3d.hpp"
namespace godot { namespace godot {
class Player : public CharacterBody3D { class Player : public CharacterBody3D {
@ -12,11 +14,29 @@ class Player : public CharacterBody3D {
protected: protected:
Node3D* model{nullptr}; Node3D* model{nullptr};
AnimationTree* animTree{nullptr}; AnimationTree* animTree{nullptr};
std::map<String, std::pair<size_t, std::vector<Node3D *>>> customization{};
Skeleton3D *customizationParent{nullptr};
#ifndef NDEBUG
String selected;
#endif
public: public:
virtual void _enter_tree() override; virtual void _enter_tree() override;
virtual void _exit_tree() override;
virtual void _process(double deltaTime) override; virtual void _process(double deltaTime) override;
virtual void _physics_process(double deltaTime) override; virtual void _physics_process(double deltaTime) override;
void customization_init();
void disable_customization_option(Node3D *option);
void select_customization(String key, int value);
#ifndef NDEBUG
void set_selected(String value);
String get_selected() const;
void set_index(int value) { this->select_customization(this->selected, value); }
int get_index() { return this->customization.find(this->selected) == this->customization.end() ? 0 : this->customization.at(this->selected).first; }
#endif
}; };
} // namespace godot } // namespace godot