diff --git a/spine-corona/examples/spineboy/spineboy-mesh.json b/spine-corona/examples/spineboy/spineboy-mesh.json new file mode 100755 index 000000000..99bc632f0 --- /dev/null +++ b/spine-corona/examples/spineboy/spineboy-mesh.json @@ -0,0 +1,989 @@ +{ +"skeleton": { "hash": "UKMzD/MoxDbC0KR0YvXCqhXtBzo", "spine": "Dev", "width": 0, "height": 0, "images": "./images/" }, +"bones": [ + { "name": "root" }, + { "name": "front_foot_ik", "parent": "root", "x": -13.52, "y": 0.04, "color": "ff3f00ff" }, + { "name": "hip", "parent": "root", "y": 247.26 }, + { "name": "rear_foot_ik", "parent": "root", "x": 61.9, "y": 0.42, "color": "ff3f00ff" }, + { "name": "front_ankle_ik", "parent": "front_foot_ik", "x": -28.39, "y": 29.06, "color": "ff3f00ff" }, + { "name": "front_thigh", "parent": "hip", "length": 74.8, "x": -17.45, "y": -11.64, "rotation": -95.51, "color": "00ff04ff" }, + { "name": "rear_ankle_ik", "parent": "rear_foot_ik", "x": -33.9, "y": 37.33, "color": "ff3f00ff" }, + { "name": "rear_thigh", "parent": "hip", "length": 85.71, "x": 8.91, "y": -5.62, "rotation": -72.54, "color": "ff000dff" }, + { "name": "torso", "parent": "hip", "length": 127.55, "x": -1.61, "y": 4.9, "rotation": 103.82, "color": "e0da19ff" }, + { + "name": "front_shin", + "parent": "front_thigh", + "length": 128.76, + "x": 78.69, + "y": 1.6, + "rotation": -2.21, + "inheritScale": false, + "color": "00ff04ff" + }, + { "name": "front_upper_arm", "parent": "torso", "length": 69.45, "x": 103.75, "y": 19.32, "rotation": 168.37, "color": "00ff04ff" }, + { "name": "neck", "parent": "torso", "length": 25.45, "x": 127.49, "y": -0.3, "rotation": -31.53, "color": "e0da19ff" }, + { "name": "rear_shin", "parent": "rear_thigh", "length": 121.87, "x": 86.1, "y": -1.32, "rotation": -19.83, "color": "ff000dff" }, + { "name": "rear_upper_arm", "parent": "torso", "length": 51.93, "x": 92.35, "y": -19.22, "rotation": -169.55, "color": "ff000dff" }, + { + "name": "front_bracer", + "parent": "front_upper_arm", + "length": 40.57, + "x": 68.8, + "y": -0.68, + "rotation": 18.29, + "color": "00ff04ff" + }, + { "name": "front_foot", "parent": "front_shin", "length": 41, "x": 128.75, "y": -0.33, "rotation": 51.26, "color": "00ff04ff" }, + { "name": "head", "parent": "neck", "length": 131.79, "x": 27.66, "y": -0.25, "rotation": 23.18, "color": "e0da19ff" }, + { "name": "rear_bracer", "parent": "rear_upper_arm", "length": 34.55, "x": 51.35, "rotation": 23.15, "color": "ff000dff" }, + { "name": "rear_foot", "parent": "rear_shin", "length": 51.58, "x": 121.45, "y": -0.75, "rotation": 45.77, "color": "ff000dff" }, + { + "name": "back_foot_tip", + "parent": "rear_foot", + "length": 50.3, + "x": 51.16, + "y": 0.23, + "rotation": -0.85, + "inheritRotation": false, + "color": "ff000dff" + }, + { "name": "front_fist", "parent": "front_bracer", "length": 65.38, "x": 40.56, "y": 0.19, "rotation": 12.43, "color": "00ff04ff" }, + { + "name": "front_foot_tip", + "parent": "front_foot", + "length": 56.02, + "x": 41.42, + "y": -0.08, + "rotation": -1.67, + "inheritRotation": false, + "color": "00ff04ff" + }, + { "name": "gun", "parent": "rear_bracer", "length": 43.1, "x": 34.42, "y": -0.45, "rotation": 5.34, "color": "ff000dff" }, + { "name": "hair1", "parent": "head", "length": 47.22, "x": 149.82, "y": -59.77, "rotation": -49.1, "color": "e0da19ff" }, + { "name": "hair3", "parent": "head", "length": 62.22, "x": 164.13, "y": 3.68, "rotation": -32.16, "color": "e0da19ff" }, + { "name": "gunTip", "parent": "gun", "x": 201.04, "y": 52.13, "rotation": 6.83, "color": "ff000dff" }, + { "name": "hair2", "parent": "hair1", "length": 55.56, "x": 47.22, "y": 0.18, "rotation": 50.41, "color": "e0da19ff" }, + { "name": "hair4", "parent": "hair3", "length": 80.28, "x": 62.22, "y": -0.03, "rotation": 83.7, "color": "e0da19ff" } +], +"ik": [ + { + "name": "front_ankle_ik", + "bones": [ "front_thigh", "front_shin" ], + "target": "front_ankle_ik", + "bendPositive": false + }, + { + "name": "rear_ankle_ik", + "bones": [ "rear_thigh", "rear_shin" ], + "target": "rear_ankle_ik", + "bendPositive": false + }, + { + "name": "front_foot_ik", + "bones": [ "front_foot" ], + "target": "front_foot_ik" + }, + { + "name": "rear_foot_ik", + "bones": [ "rear_foot" ], + "target": "rear_foot_ik" + } +], +"slots": [ + { "name": "rear_upper_arm", "bone": "rear_upper_arm", "attachment": "rear_upper_arm" }, + { "name": "rear_bracer", "bone": "rear_bracer", "attachment": "rear_bracer" }, + { "name": "gun", "bone": "gun", "attachment": "gun" }, + { "name": "rear_foot", "bone": "rear_foot", "attachment": "rear_foot" }, + { "name": "rear_thigh", "bone": "rear_thigh", "attachment": "rear_thigh" }, + { "name": "rear_shin", "bone": "rear_shin", "attachment": "rear_shin" }, + { "name": "neck", "bone": "neck", "attachment": "neck" }, + { "name": "torso", "bone": "torso", "attachment": "torso" }, + { "name": "front_upper_arm", "bone": "front_upper_arm", "attachment": "front_upper_arm" }, + { "name": "head", "bone": "head", "attachment": "head" }, + { "name": "eye", "bone": "head", "attachment": "eye_indifferent" }, + { "name": "front_thigh", "bone": "front_thigh", "attachment": "front_thigh" }, + { "name": "front_foot", "bone": "front_foot", "attachment": "front_foot" }, + { "name": "front_shin", "bone": "front_shin", "attachment": "front_shin" }, + { "name": "mouth", "bone": "head", "attachment": "mouth_grind" }, + { "name": "goggles", "bone": "head", "attachment": "goggles" }, + { "name": "front_bracer", "bone": "front_bracer", "attachment": "front_bracer" }, + { "name": "front_fist", "bone": "front_fist", "attachment": "front_fist_closed" }, + { "name": "muzzle", "bone": "gunTip", "additive": true }, + { "name": "head-bb", "bone": "head" } +], +"skins": { + "default": { + "eye": { + "eye_indifferent": { + "type": "mesh", + "uvs": [ 1, 1, 0, 1, 0, 0, 1, 0 ], + "triangles": [ 1, 3, 0, 1, 2, 3 ], + "vertices": [ 59.16, -86.8, 28.32, 0.92, 112.27, 30.44, 143.11, -57.28 ], + "hull": 4, + "edges": [ 0, 2, 2, 4, 4, 6, 0, 6 ], + "width": 93, + "height": 89 + }, + "eye_surprised": { "x": 85.72, "y": -28.18, "rotation": -70.63, "width": 93, "height": 89 } + }, + "front_bracer": { + "front_bracer": { "x": 12.03, "y": -1.67, "rotation": 79.59, "width": 58, "height": 80 } + }, + "front_fist": { + "front_fist_closed": { "x": 35.49, "y": 6, "rotation": 67.16, "width": 75, "height": 82 }, + "front_fist_open": { "x": 39.56, "y": 7.76, "rotation": 67.16, "width": 86, "height": 87 } + }, + "front_foot": { + "front_foot": { + "type": "skinnedmesh", + "uvs": [ 0.59417, 0.23421, 0.62257, 0.30335, 0.65009, 0.37035, 0.67637, 0.38403, 0.72068, 0.40709, 0.76264, 0.42894, 1, 0.70375, 1, 1, 0.65517, 1, 0.3644, 1, 0, 1, 0, 0.39196, 0, 0, 0.17845, 0, 0.49795, 0 ], + "triangles": [ 8, 9, 3, 4, 8, 3, 8, 4, 5, 8, 5, 6, 8, 6, 7, 11, 12, 13, 11, 1, 10, 13, 14, 0, 0, 11, 13, 1, 11, 0, 2, 9, 10, 2, 10, 1, 9, 2, 3 ], + "vertices": [ 2, 15, 18.17, 41.57, 0.72, 21, 12.46, 46.04, 0.27, 2, 15, 24.08, 40.75, 0.57, 21, 16.12, 41.34, 0.42, 2, 15, 29.8, 39.97, 0.47, 21, 19.67, 36.77, 0.52, 2, 15, 32.8, 41.66, 0.37, 21, 22.99, 35.89, 0.62, 2, 15, 37.86, 44.51, 0.24, 21, 28.6, 34.4, 0.75, 2, 15, 42.65, 47.21, 0.17, 21, 33.91, 32.98, 0.82, 1, 21, 64.15, 14.56, 1, 1, 21, 64.51, -5.87, 1, 1, 21, 21.07, -6.63, 1, 2, 15, 35.38, -16.16, 0.99, 21, -15.54, -7.28, 0, 2, 15, 3.1, -48.81, 1, 21, -61.44, -8.09, 0, 2, 15, -26.72, -19.31, 1, 21, -62.18, 33.84, 0, 2, 15, -45.95, -0.29, 1, 21, -62.66, 60.88, 0, 1, 15, -30.14, 15.69, 1, 2, 15, -1.84, 44.31, 0.91, 21, 0.05, 61.98, 0.08 ], + "hull": 15, + "edges": [ 14, 16, 16, 18, 18, 20, 4, 18, 20, 22, 22, 24, 24, 26, 26, 28, 22, 26, 12, 14, 10, 12, 2, 4, 2, 20, 4, 6, 6, 16, 2, 0, 0, 28, 6, 8, 8, 10 ], + "width": 126, + "height": 69 + }, + "front_foot_bend1": { "x": 22.86, "y": 20.24, "rotation": 45.32, "width": 128, "height": 70 }, + "front_foot_bend2": { "x": 8.16, "y": 19.57, "rotation": 45.32, "width": 108, "height": 93 } + }, + "front_shin": { + "front_shin": { "x": 60.92, "y": -3.9, "rotation": 96.59, "width": 82, "height": 184 } + }, + "front_thigh": { + "front_thigh": { "x": 42.47, "y": 4.44, "rotation": 84.86, "width": 48, "height": 112 } + }, + "front_upper_arm": { + "front_upper_arm": { "x": 28.3, "y": 7.37, "rotation": 97.89, "width": 54, "height": 97 } + }, + "goggles": { + "goggles": { + "type": "mesh", + "uvs": [ 0.53653, 0.04113, 0.72921, 0.16035, 0.91666, 0.33222, 0.97046, 0.31329, 1, 0.48053, 0.95755, 0.57329, 0.88825, 0.63279, 0.86877, 0.78962, 0.77403, 0.86749, 0.72628, 1, 0.60713, 0.93862, 0.496, 0.88138, 0.41557, 0.75026, 0.32547, 0.70084, 0.2782, 0.58256, 0.17209, 0.63281, 0.17228, 0.75071, 0.1078, 0.79897, 0, 0.32304, 0, 0.12475, 0.07372, 0.07343, 0.15423, 0.10733, 0.23165, 0.13994, 0.30313, 0.02256, 0.34802, 0, 0.42978, 0.69183, 0.39475, 0.51041, 0.39488, 0.31511, 0.45878, 0.23197, 0.56501, 0.28108, 0.6996, 0.39216, 0.82039, 0.54203, 0.85737, 0.62342, 0.91107, 0.51407, 0.72638, 0.32146, 0.58763, 0.19609, 0.48074, 0.11268, 0.37822, 0.05501, 0.32869, 0.17866, 0.31899, 0.30499, 0.36035, 0.53798, 0.40327, 0.70072, 0.30058, 0.55837, 0.21956, 0.2815, 0.09963, 0.28942, 0.56862, 0.4368, 0.4911, 0.37156, 0.51184, 0.52092, 0.67018, 0.59303, 0.7619, 0.68574, 0.73296, 0.43354 ], + "triangles": [ 49, 8, 48, 9, 48, 8, 12, 25, 11, 48, 9, 10, 47, 48, 10, 47, 10, 25, 25, 10, 11, 8, 49, 7, 17, 15, 16, 17, 18, 15, 49, 32, 7, 7, 32, 6, 41, 42, 40, 12, 41, 25, 41, 12, 42, 13, 14, 42, 12, 13, 42, 41, 40, 25, 40, 26, 25, 25, 26, 47, 49, 31, 32, 31, 49, 50, 18, 44, 15, 42, 14, 44, 14, 15, 44, 5, 6, 33, 6, 32, 33, 32, 31, 33, 47, 45, 48, 49, 48, 50, 50, 45, 30, 50, 48, 45, 42, 44, 43, 5, 33, 4, 42, 39, 40, 42, 43, 39, 31, 50, 33, 40, 39, 26, 45, 47, 46, 33, 2, 4, 2, 33, 34, 47, 26, 46, 26, 27, 46, 26, 39, 27, 2, 3, 4, 30, 45, 29, 30, 34, 50, 33, 50, 34, 45, 46, 29, 30, 29, 34, 27, 28, 46, 46, 28, 29, 18, 19, 44, 29, 35, 34, 2, 34, 1, 34, 35, 1, 28, 27, 38, 27, 39, 38, 39, 43, 38, 44, 19, 21, 44, 21, 43, 21, 19, 20, 43, 22, 38, 43, 21, 22, 29, 28, 35, 28, 36, 35, 28, 38, 36, 36, 0, 35, 35, 0, 1, 22, 23, 38, 38, 37, 36, 37, 23, 24, 37, 38, 23, 36, 37, 0, 37, 24, 0 ], + "vertices": [ 172.08, 22.81, 170.09, -31.19, 159.41, -86.8, 167.03, -99, 143.39, -115.48, 125.2, -110.14, 109.88, -96.35, 83.64, -100.19, 63.25, -81.15, 38.37, -76.69, 37.66, -43.98, 37, -13.47, 50.57, 13.54, 50.51, 38.45, 64.94, 56.6, 47.89, 79.94, 29.45, 73.42, 16.31, 86.63, 81.5, 139.38, 112.55, 150.28, 126.97, 134.97, 128.63, 113.28, 130.22, 92.43, 154.78, 81.29, 162.21, 71.48, 60.96, 13.26, 86.33, 31.87, 116.92, 42.6, 135.47, 31.44, 136.98, 2.58, 131.23, -36.66, 118.22, -74.65, 108.68, -88.23, 130.45, -95.43, 144.62, -39.36, 152.24, 1.69, 156.05, 32.59, 156.21, 61.01, 132.56, 66.4, 111.94, 61.83, 79.03, 38.83, 57.27, 19.29, 70.67, 52.42, 107.01, 87.61, 95.39, 116.7, 112.91, -6.87, 116.41, 15.8, 94.82, 2.47, 97.23, -40.47, 90.66, -68.16, 127.64, -47.15 ], + "hull": 25, + "edges": [ 36, 34, 34, 32, 32, 30, 30, 28, 28, 26, 26, 24, 24, 22, 18, 16, 16, 14, 14, 12, 12, 10, 10, 8, 8, 6, 6, 4, 4, 2, 2, 0, 0, 48, 48, 46, 46, 44, 36, 38, 40, 38, 24, 50, 50, 52, 52, 54, 54, 56, 56, 58, 58, 60, 62, 64, 64, 12, 8, 66, 66, 68, 68, 70, 70, 72, 72, 74, 74, 76, 76, 78, 78, 80, 80, 82, 82, 24, 24, 84, 84, 86, 86, 44, 40, 42, 42, 44, 42, 88, 88, 30, 58, 90, 90, 92, 92, 94, 18, 20, 20, 22, 94, 20, 18, 96, 96, 98, 60, 100, 100, 62, 98, 100 ], + "width": 261, + "height": 166 + } + }, + "gun": { + "gun": { "x": 77.3, "y": 16.4, "rotation": 60.82, "width": 210, "height": 203 } + }, + "head": { + "head": { + "type": "skinnedmesh", + "uvs": [ 0.75918, 0.06107, 0.88392, 0.17892, 0.90174, 0.30856, 0.94223, 0.1966, 1, 0.26584, 1, 0.42199, 0.95863, 0.46992, 0.92118, 0.51333, 0.85957, 0.53469, 0.78388, 0.65605, 0.74384, 0.74838, 0.85115, 0.75151, 0.84828, 0.82563, 0.8178, 0.85367, 0.75598, 0.85906, 0.76236, 0.90467, 0.65875, 1, 0.38336, 1, 0.18579, 0.85403, 0.12741, 0.8109, 0.06024, 0.69209, 0, 0.58551, 0, 0.41021, 0.08529, 0.20691, 0.24243, 0.14504, 0.49999, 0.14209, 0.50323, 0.07433, 0.41738, 0, 0.57613, 0, 0.85059, 0.36086, 0.73431, 0.43206, 0.6848, 0.3127, 0.72164, 0.16717, 0.55931, 0.04153, 0.44763, 0.22894, 0.23925, 0.26559, 0.71271, 0.44035, 0.56992, 0.38299, 0.41678, 0.3351, 0.29299, 0.31496, 0.70801, 0.44501, 0.56676, 0.38976, 0.4152, 0.34416, 0.28753, 0.33017, 0.88988, 0.50176, 0.30388, 0.73462, 0.2646, 0.65674, 0.21414, 0.61583, 0.14612, 0.62193, 0.10315, 0.66636, 0.10357, 0.72556, 0.14505, 0.79163, 0.20263, 0.81355, 0.27872, 0.80158, 0.34946, 0.7376, 0.23073, 0.57073, 0.08878, 0.60706, 0.2946, 0.8129, 0.73005, 0.87883, 0.69804, 0.87348, 0.66165, 0.79681 ], + "triangles": [ 34, 25, 31, 37, 38, 34, 31, 32, 29, 31, 37, 34, 37, 41, 38, 30, 31, 29, 36, 37, 31, 33, 27, 28, 26, 27, 33, 0, 33, 28, 32, 33, 0, 32, 0, 1, 33, 25, 26, 33, 32, 25, 31, 25, 32, 2, 32, 1, 2, 3, 4, 2, 29, 32, 2, 4, 5, 29, 2, 5, 6, 29, 5, 30, 36, 31, 30, 29, 6, 44, 30, 6, 36, 30, 44, 34, 24, 25, 35, 23, 24, 35, 24, 34, 39, 35, 34, 39, 22, 35, 38, 39, 34, 42, 39, 38, 43, 39, 42, 41, 42, 38, 22, 23, 35, 43, 22, 39, 40, 37, 36, 41, 37, 40, 7, 44, 6, 8, 36, 44, 40, 36, 8, 8, 44, 7, 55, 22, 43, 56, 21, 22, 55, 56, 22, 55, 48, 56, 47, 48, 55, 9, 40, 8, 55, 54, 46, 42, 55, 43, 47, 55, 46, 49, 56, 48, 20, 21, 56, 20, 56, 49, 50, 49, 48, 20, 49, 50, 46, 54, 45, 54, 55, 41, 55, 42, 41, 9, 60, 40, 46, 51, 50, 60, 41, 40, 10, 60, 9, 54, 41, 60, 46, 52, 51, 19, 50, 51, 50, 48, 47, 47, 46, 50, 46, 45, 52, 20, 50, 19, 57, 53, 45, 57, 45, 54, 53, 52, 45, 12, 10, 11, 13, 10, 12, 18, 51, 52, 19, 51, 18, 18, 52, 53, 18, 53, 57, 14, 10, 13, 60, 10, 14, 59, 60, 14, 58, 59, 14, 58, 14, 15, 17, 54, 60, 16, 17, 60, 57, 54, 17, 18, 57, 17, 59, 16, 60, 16, 59, 58, 16, 58, 15 ], + "vertices": [ 2, 26, 96.38, 70.56, 0, 27, 41.97, -41.79, 0.99, 3, 26, 73.46, 27.54, 0.18, 27, -5.75, -51.7, 0.72, 24, 112.98, -11.43, 0.08, 4, 23, 63.13, 36.65, 0.02, 26, 38.23, 10.98, 0.82, 27, -41.01, -35.22, 0.09, 24, 92.72, -44.67, 0.05, 1, 26, 73.35, 10.89, 1, 1, 26, 58.59, -10.38, 1, 2, 23, 75.49, -4.55, 0.1, 26, 14.35, -24.8, 0.89, 2, 23, 59.82, -13.72, 0.41, 26, -2.69, -18.57, 0.58, 1, 16, 163.06, -108.68, 1, 1, 16, 151.52, -95.04, 1, 1, 16, 110.6, -87.69, 1, 1, 16, 81.05, -86.58, 1, 1, 16, 89.81, -114.32, 1, 1, 16, 68.72, -120.91, 1, 1, 16, 58.1, -115.89, 1, 1, 16, 51.03, -100.62, 1, 1, 16, 38.78, -106.76, 1, 1, 16, 2.67, -89.69, 1, 1, 16, -22.07, -19.29, 1, 1, 16, 1.19, 45.62, 1, 1, 16, 8.07, 64.81, 1, 1, 16, 35.43, 93.72, 1, 1, 16, 59.98, 119.66, 1, 1, 16, 109.25, 136.98, 1, 1, 16, 174.07, 135.27, 1, 3, 16, 205.58, 101.22, 0.82, 27, 95.35, 90.04, 0.01, 24, -16.79, 104.63, 0.15, 3, 16, 229.56, 35.66, 0.02, 27, 58.93, 30.5, 0.59, 24, 38.37, 61.89, 0.38, 3, 16, 248.9, 41.54, 0, 27, 75.55, 19, 0.94, 24, 51.62, 77.15, 0.05, 1, 27, 106.69, 26.9, 1, 1, 27, 83.78, -9.5, 1, 4, 23, 44.52, 27.24, 0.19, 26, 19.12, 19.33, 0.58, 27, -46.82, -15.19, 0.07, 24, 72.17, -48.24, 0.14, 4, 16, 169.11, -52.88, 0.02, 23, 7.42, 19.08, 0.77, 26, -10.8, 42.71, 0, 24, 34.31, -45.24, 0.2, 5, 16, 198.21, -28.43, 0, 23, 8, 57.08, 0.02, 26, 18.84, 66.49, 0, 27, -10.75, 15.18, 0, 24, 45.94, -9.06, 0.95, 3, 26, 63.16, 70.43, 0.01, 27, 20.62, -16.35, 0.98, 24, 80.73, 18.67, 0, 1, 27, 75.73, 0.94, 1, 3, 16, 200.44, 40.47, 0.48, 27, 44.58, 56.29, 0.14, 24, 11.16, 50.46, 0.36, 1, 16, 171.41, 90.11, 1, 4, 16, 164.84, -48.18, 0.02, 23, 1.07, 18.93, 0.77, 26, -14.97, 47.51, 0, 24, 28.19, -43.54, 0.2, 3, 16, 168.13, -6.01, 0.11, 23, -28.63, 49.03, 0.13, 24, 8.54, -6.08, 0.75, 3, 16, 167.82, 37.86, 0.26, 27, 22.26, 80.21, 0.03, 24, -15.06, 30.9, 0.7, 1, 16, 162.36, 71.5, 1, 1, 16, 163.1, -47.44, 1, 1, 16, 165.94, -5.87, 1, 1, 16, 165.14, 37.37, 1, 1, 16, 157.6, 71.39, 1, 1, 16, 163.5, -99.53, 1, 1, 16, 45.37, 27.24, 1, 1, 16, 63.73, 44.98, 1, 1, 16, 70.69, 61.92, 0.99, 1, 16, 62.87, 78.69, 0.99, 1, 16, 46.52, 85.3, 0.99, 1, 16, 29.92, 79.33, 0.99, 1, 16, 15.07, 62.21, 1, 1, 16, 14.09, 45.32, 1, 1, 16, 24.29, 27.05, 1, 1, 16, 48.63, 15.29, 1, 1, 16, 84.87, 62.14, 0.99, 1, 16, 61.9, 94.83, 0.99, 1, 16, 22.54, 21.87, 1, 1, 16, 43.14, -95.94, 1, 1, 16, 41.77, -87.23, 1, 1, 16, 60.05, -70.35, 1 ], + "hull": 29, + "edges": [ 10, 8, 8, 6, 6, 4, 4, 2, 2, 0, 0, 56, 54, 56, 54, 52, 52, 50, 50, 48, 48, 46, 46, 44, 42, 44, 32, 34, 4, 58, 58, 60, 62, 64, 64, 66, 66, 54, 50, 68, 68, 70, 70, 44, 60, 72, 62, 74, 72, 74, 74, 76, 76, 78, 78, 44, 16, 80, 80, 82, 82, 84, 84, 86, 86, 44, 14, 88, 88, 72, 14, 16, 10, 12, 12, 14, 12, 60, 90, 92, 92, 94, 94, 96, 96, 98, 98, 100, 100, 102, 102, 104, 104, 106, 106, 90, 108, 110, 110, 112, 38, 40, 40, 42, 112, 40, 34, 36, 36, 38, 36, 114, 114, 108, 30, 32, 30, 28, 24, 26, 28, 26, 22, 24, 22, 20, 20, 18, 18, 16, 28, 116, 116, 118, 118, 120, 120, 20 ], + "width": 271, + "height": 298 + } + }, + "head-bb": { + "head": { + "type": "boundingbox", + "vertices": [ -19.143097, -70.30209, 40.80313, -118.074234, 257.77155, -115.61827, 285.16193, 57.18005, 120.77191, 164.95125, -5.067627, 76.94907 ] + } + }, + "mouth": { + "mouth_grind": { + "type": "mesh", + "uvs": [ 1, 1, 0, 1, 0, 0, 1, 0 ], + "triangles": [ 1, 3, 0, 1, 2, 3 ], + "vertices": [ 11.28, -85.88, -19.56, 1.84, 36.09, 21.41, 66.93, -66.31 ], + "hull": 4, + "edges": [ 0, 2, 2, 4, 4, 6, 0, 6 ], + "width": 93, + "height": 59 + }, + "mouth_oooo": { "x": 23.68, "y": -32.23, "rotation": -70.63, "width": 93, "height": 59 }, + "mouth_smile": { "x": 23.68, "y": -32.23, "rotation": -70.63, "width": 93, "height": 59 } + }, + "muzzle": { + "muzzle": { "x": 18.25, "y": 5.44, "rotation": 0.15, "width": 462, "height": 400 } + }, + "neck": { + "neck": { "x": 9.76, "y": -3.01, "rotation": -55.22, "width": 36, "height": 41 } + }, + "rear_bracer": { + "rear_bracer": { "x": 11.15, "y": -2.2, "rotation": 66.17, "width": 56, "height": 72 } + }, + "rear_foot": { + "rear_foot": { + "type": "skinnedmesh", + "uvs": [ 0.48368, 0.1387, 0.5199, 0.21423, 0.55099, 0.27906, 0.58838, 0.29816, 0.63488, 0.32191, 0.77342, 0.39266, 1, 0.73346, 1, 1, 0.59435, 1, 0.3116, 1, 0, 1, 0, 0.41396, 0.1363, 0, 0.41716, 0 ], + "triangles": [ 4, 8, 3, 5, 8, 4, 6, 8, 5, 8, 6, 7, 11, 1, 10, 12, 13, 0, 0, 11, 12, 1, 11, 0, 2, 9, 10, 2, 10, 1, 9, 2, 3, 8, 9, 3 ], + "vertices": [ 2, 18, 10.45, 29.41, 0.88, 19, -6.74, 49.62, 0.11, 2, 18, 16.54, 29.27, 0.83, 19, -2.65, 45.08, 0.16, 2, 18, 21.79, 29.15, 0.78, 19, 0.85, 41.19, 0.21, 2, 18, 25.53, 31.43, 0.67, 19, 5.07, 40.04, 0.32, 2, 18, 30.17, 34.27, 0.54, 19, 10.33, 38.61, 0.45, 2, 18, 44.01, 42.72, 0.16, 19, 25.97, 34.36, 0.83, 1, 19, 51.56, 13.89, 1, 2, 18, 88.08, 36.28, 0, 19, 51.54, -2.08, 1, 2, 18, 56.58, 2.98, 0.02, 19, 5.71, -2.05, 0.97, 2, 18, 34.63, -20.21, 0.99, 19, -26.22, -2.03, 0, 2, 18, 10.43, -45.8, 0.99, 19, -61.43, -2, 0, 2, 18, -15.1, -21.64, 1, 19, -61.4, 33.15, 0, 2, 18, -22.56, 6.61, 0.99, 19, -45.98, 57.97, 0, 2, 18, -0.76, 29.67, 0.99, 19, -14.25, 57.94, 0 ], + "hull": 14, + "edges": [ 14, 12, 10, 12, 14, 16, 16, 18, 18, 20, 4, 18, 20, 22, 24, 26, 22, 24, 4, 2, 2, 20, 4, 6, 6, 16, 6, 8, 8, 10, 2, 0, 0, 26 ], + "width": 113, + "height": 60 + }, + "rear_foot_bend1": { "x": 29.61, "y": 18.12, "rotation": 46.59, "width": 117, "height": 66 }, + "rear_foot_bend2": { "x": 22.82, "y": 23.69, "rotation": 46.59, "width": 103, "height": 83 } + }, + "rear_shin": { + "rear_shin": { "x": 58.29, "y": -2.75, "rotation": 92.37, "width": 75, "height": 178 } + }, + "rear_thigh": { + "rear_thigh": { "x": 33.1, "y": -4.11, "rotation": 72.54, "width": 65, "height": 104 } + }, + "rear_upper_arm": { + "rear_upper_arm": { "x": 21.12, "y": 4.08, "rotation": 89.32, "width": 47, "height": 87 } + }, + "torso": { + "torso": { + "type": "mesh", + "uvs": [ 0.62509, 0.12672, 1, 0.2636, 1, 0.2887, 1, 0.66021, 1, 0.68245, 0.92323, 0.69258, 0.95115, 0.84965, 0.77123, 1, 0.49654, 1, 0.27181, 1, 0.13842, 0.77196, 0, 0.45614, 0, 0.19436, 0.14462, 0, 0.27801, 0, 0.72524, 0.27835, 0.76091, 0.46216, 0.84888, 0.67962, 0.68257, 0.63249, 0.53985, 0.38469, 0.25443, 0.32169, 0.30062, 0.55173, 0.39552, 0.79506, 0.26389, 0.17006, 0.52409, 0.18673 ], + "triangles": [ 6, 17, 5, 6, 7, 17, 8, 18, 7, 7, 18, 17, 9, 22, 8, 8, 22, 18, 9, 10, 22, 10, 21, 22, 22, 21, 18, 10, 11, 21, 4, 5, 3, 5, 17, 3, 3, 17, 16, 17, 18, 16, 16, 2, 3, 21, 19, 18, 18, 19, 16, 11, 20, 21, 21, 20, 19, 19, 15, 16, 16, 15, 2, 11, 12, 20, 20, 24, 19, 19, 24, 15, 20, 23, 24, 20, 12, 23, 15, 1, 2, 24, 0, 15, 15, 0, 1, 12, 13, 23, 0, 24, 14, 14, 24, 13, 24, 23, 13 ], + "vertices": [ 129.62, -10.38, 102.17, -45.07, 97.66, -44.71, 31, -39.45, 27.01, -39.13, 25.78, -31.49, -2.61, -31.99, -28.2, -12.29, -26.08, 14.54, -24.34, 36.5, 17.59, 46.3, 75.33, 55.34, 122.31, 51.63, 156.07, 34.75, 155.03, 21.72, 101.64, -18.02, 68.37, -18.9, 28.68, -24.41, 38.41, -8.83, 83.99, 1.59, 97.5, 28.58, 55.86, 27.33, 11.47, 21.51, 124.63, 25.51, 119.63, 0.32 ], + "hull": 15, + "edges": [ 14, 12, 12, 10, 10, 8, 18, 20, 20, 22, 22, 24, 26, 28, 24, 26, 2, 4, 30, 4, 30, 32, 32, 34, 4, 6, 6, 8, 34, 6, 34, 36, 36, 38, 38, 40, 40, 24, 36, 14, 40, 42, 42, 44, 14, 16, 16, 18, 44, 16, 40, 46, 38, 48, 48, 30, 2, 0, 0, 28, 48, 0, 48, 26 ], + "width": 98, + "height": 180 + } + } + } +}, +"events": { + "footstep": {}, + "headAttach": { "int": 3, "float": 4 }, + "headBehind": { "int": 5, "float": 6, "string": "setup" }, + "headPop": { "int": 1, "float": 2 } +}, +"animations": { + "run": { + "slots": { + "front_fist": { + "attachment": [ + { "time": 0, "name": "front_fist_closed" } + ] + }, + "mouth": { + "attachment": [ + { "time": 0, "name": "mouth_grind" } + ] + }, + "torso": { + "attachment": [ + { "time": 0, "name": "torso" } + ] + } + }, + "bones": { + "front_thigh": { + "rotate": [ + { + "time": 0, + "angle": 42.05, + "curve": [ 0.195, 0.86, 0.75, 1 ] + }, + { "time": 0.0666, "angle": 46.07 }, + { "time": 0.1333, "angle": -20.28 }, + { "time": 0.2, "angle": -27.23 }, + { "time": 0.2666, "angle": -47.16 }, + { "time": 0.3333, "angle": -39.79 }, + { "time": 0.4, "angle": -25.86 }, + { "time": 0.4666, "angle": 14.35 }, + { "time": 0.5333, "angle": 55.62 }, + { "time": 0.6, "angle": 69.65 }, + { "time": 0.6666, "angle": 86.4 }, + { "time": 0.7333, "angle": 65.87 }, + { "time": 0.8, "angle": 42.05 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0 }, + { "time": 0.0333, "x": -5.79, "y": 11.15 }, + { "time": 0.0666, "x": -5.13, "y": 11.55 }, + { "time": 0.1333, "x": -7.7, "y": 8.98 }, + { "time": 0.5333, "x": -1.26, "y": 3.83 }, + { "time": 0.8, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.8, "x": 1, "y": 1 } + ] + }, + "torso": { + "rotate": [ + { "time": 0, "angle": -39.7 }, + { "time": 0.2, "angle": -57.29 }, + { "time": 0.4, "angle": -39.7 }, + { "time": 0.6, "angle": -57.29 }, + { "time": 0.8, "angle": -39.7 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.4, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.8, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.8, "x": 1, "y": 1 } + ] + }, + "rear_thigh": { + "rotate": [ + { "time": 0, "angle": -56.59 }, + { "time": 0.0666, "angle": -21.57 }, + { "time": 0.1333, "angle": 27.95 }, + { "time": 0.2, "angle": 42.42 }, + { "time": 0.2666, "angle": 62.37 }, + { "time": 0.3333, "angle": 45.42 }, + { "time": 0.4, "angle": 15.67 }, + { "time": 0.4666, "angle": 28.22 }, + { "time": 0.5333, "angle": -38.62 }, + { "time": 0.6, "angle": -53.26 }, + { "time": 0.6666, "angle": -79.31 }, + { "time": 0.7333, "angle": -86.47 }, + { "time": 0.8, "angle": -56.59 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0 }, + { "time": 0.4, "x": -6.76, "y": -3.86 }, + { "time": 0.4333, "x": -15.85, "y": 7.28 }, + { "time": 0.4666, "x": -13.04, "y": 4.04 }, + { "time": 0.5, "x": -10.24, "y": 7.11 }, + { "time": 0.5333, "x": -9.01, "y": -5.15 }, + { "time": 0.6666, "x": -23.18, "y": -2.57 }, + { "time": 0.8, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.8, "x": 1, "y": 1 } + ] + }, + "rear_shin": { + "rotate": [ + { "time": 0, "angle": -74 }, + { "time": 0.0666, "angle": -83.38 }, + { "time": 0.1333, "angle": -106.69 }, + { "time": 0.2, "angle": -66.01 }, + { "time": 0.2666, "angle": -55.22 }, + { "time": 0.3333, "angle": -24.8 }, + { + "time": 0.4, + "angle": 18.44, + "curve": [ 0.25, 0, 0.75, 1 ] + }, + { "time": 0.4666, "angle": -56.65 }, + { + "time": 0.5333, + "angle": -11.94, + "curve": [ 0.25, 0, 0.75, 1 ] + }, + { "time": 0.6666, "angle": -41.26 }, + { "time": 0.7333, "angle": -43.6 }, + { "time": 0.8, "angle": -74 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.8, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.8, "x": 1, "y": 1 } + ] + }, + "front_upper_arm": { + "rotate": [ + { "time": 0, "angle": -89.36 }, + { "time": 0.0666, "angle": -95.67 }, + { "time": 0.1333, "angle": -22 }, + { "time": 0.2, "angle": -316.04 }, + { "time": 0.2666, "angle": -274.94 }, + { "time": 0.3333, "angle": -273.74 }, + { "time": 0.4, "angle": -272.09 }, + { "time": 0.4666, "angle": -264.89 }, + { "time": 0.5333, "angle": -320.09 }, + { "time": 0.6, "angle": -50.83 }, + { "time": 0.6666, "angle": -81.72 }, + { "time": 0.7333, "angle": -83.92 }, + { "time": 0.8, "angle": -89.36 } + ], + "translate": [ + { "time": 0, "x": 6.24, "y": 10.05 }, + { "time": 0.2666, "x": 4.95, "y": -13.13 }, + { "time": 0.6, "x": -2.43, "y": 1.94 }, + { "time": 0.8, "x": 6.24, "y": 10.05 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.8, "x": 1, "y": 1 } + ] + }, + "front_bracer": { + "rotate": [ + { "time": 0, "angle": 33.43 }, + { "time": 0.0666, "angle": 20.53 }, + { "time": 0.1333, "angle": 15.26 }, + { "time": 0.2, "angle": 19.28 }, + { "time": 0.2666, "angle": 22.62 }, + { "time": 0.3333, "angle": 37.29 }, + { "time": 0.4, "angle": 41.53 }, + { "time": 0.4666, "angle": 31.73 }, + { "time": 0.5333, "angle": 67.45 }, + { "time": 0.6666, "angle": 39.77 }, + { "time": 0.7333, "angle": 30.95 }, + { "time": 0.8, "angle": 33.43 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.8, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.8, "x": 1, "y": 1 } + ] + }, + "front_fist": { + "rotate": [ + { "time": 0, "angle": -19.75 }, + { "time": 0.0666, "angle": -37.11 }, + { "time": 0.1333, "angle": -50.79 }, + { "time": 0.2666, "angle": -12.69 }, + { "time": 0.3333, "angle": 3.01 }, + { "time": 0.4333, "angle": 12.05 }, + { "time": 0.5333, "angle": 13.25 }, + { "time": 0.8, "angle": -19.75 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.8, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.8, "x": 1, "y": 1 } + ] + }, + "rear_upper_arm": { + "rotate": [ + { "time": 0, "angle": 68.68 }, + { "time": 0.0666, "angle": 73.89 }, + { "time": 0.1333, "angle": -9.64 }, + { "time": 0.2, "angle": 284.27 }, + { "time": 0.2666, "angle": 283.29 }, + { "time": 0.3333, "angle": 278.28 }, + { "time": 0.4, "angle": 271.02 }, + { "time": 0.4666, "angle": 263.2 }, + { "time": 0.5333, "angle": 314.25 }, + { "time": 0.6, "angle": 16.83 }, + { "time": 0.6666, "angle": 70.35 }, + { "time": 0.7333, "angle": 73.53 }, + { "time": 0.8, "angle": 68.68 } + ], + "translate": [ + { "time": 0, "x": -2.57, "y": -8.89 }, + { "time": 0.1333, "x": -4.68, "y": 7.2 }, + { "time": 0.2, "x": 21.73, "y": 51.17 }, + { "time": 0.6, "x": 4.33, "y": 2.05 }, + { "time": 0.8, "x": -2.57, "y": -8.89 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.8, "x": 1, "y": 1 } + ] + }, + "rear_bracer": { + "rotate": [ + { "time": 0, "angle": 31.04 }, + { "time": 0.0666, "angle": 28.28 }, + { "time": 0.1333, "angle": 49.36 }, + { "time": 0.2, "angle": 59.37 }, + { "time": 0.2666, "angle": 8.56 }, + { "time": 0.3333, "angle": 9.38 }, + { "time": 0.4, "angle": 11.51 }, + { "time": 0.4666, "angle": 7.22 }, + { "time": 0.5333, "angle": -18.44 }, + { "time": 0.6, "angle": 11.44 }, + { "time": 0.6666, "angle": 9.99 }, + { "time": 0.7333, "angle": 8.28 }, + { "time": 0.8, "angle": 31.04 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.8, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.8, "x": 1, "y": 1 } + ] + }, + "neck": { + "rotate": [ + { "time": 0, "angle": 11.03 }, + { "time": 0.2, "angle": 13.58 }, + { "time": 0.4, "angle": 11.03 }, + { "time": 0.6, "angle": 13.58 }, + { "time": 0.8, "angle": 11.03 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.4, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.8, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.8, "x": 1, "y": 1 } + ] + }, + "head": { + "rotate": [ + { "time": 0, "angle": 11.03 }, + { "time": 0.1, "angle": 12.34 }, + { "time": 0.2, "angle": 25.55 }, + { "time": 0.4, "angle": 11.03 }, + { "time": 0.5, "angle": 12.34 }, + { "time": 0.6, "angle": 25.55 }, + { "time": 0.8, "angle": 11.03 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.4, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.8, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.8, "x": 1, "y": 1 } + ] + }, + "front_shin": { + "rotate": [ + { + "time": 0, + "angle": 0, + "curve": [ 0.481, 0.01, 0.75, 1 ] + }, + { "time": 0.0666, "angle": -64.42 }, + { + "time": 0.1333, + "angle": -20.59, + "curve": [ 0.25, 0, 0.75, 1 ] + }, + { "time": 0.2666, "angle": -62.51 }, + { "time": 0.3333, "angle": -79.74 }, + { "time": 0.4, "angle": -78.28 }, + { + "time": 0.4666, + "angle": -118.96, + "curve": [ 0.93, 0, 0.952, 0.95 ] + }, + { "time": 0.6, "angle": -88.95 }, + { "time": 0.6666, "angle": -79.09 }, + { "time": 0.7333, "angle": -47.77 }, + { "time": 0.8, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.8, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.8, "x": 1, "y": 1 } + ] + }, + "front_foot": { + "rotate": [ + { "time": 0, "angle": 0 }, + { + "time": 0.0333, + "angle": -21.13, + "curve": [ 0.121, 0.23, 0.75, 1 ] + }, + { "time": 0.0666, "angle": 17.64 }, + { "time": 0.1, "angle": 29.92 }, + { "time": 0.1333, "angle": 16.44 }, + { "time": 0.2, "angle": -29.22 }, + { "time": 0.2666, "angle": -1.61 }, + { "time": 0.3333, "angle": -10.22 }, + { "time": 0.4666, "angle": -15.99 }, + { "time": 0.6, "angle": 9.03 }, + { "time": 0.7333, "angle": 17.32 }, + { "time": 0.8, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.8, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.8, "x": 1, "y": 1 } + ] + }, + "rear_foot": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.0666, "angle": -12.04 }, + { "time": 0.1333, "angle": -0.87 }, + { "time": 0.2, "angle": 25.81 }, + { "time": 0.2666, "angle": 4.71 }, + { + "time": 0.4, + "angle": 18.09, + "curve": [ 0.281, 0.73, 0.75, 1 ] + }, + { "time": 0.4333, "angle": -1.7 }, + { "time": 0.4666, "angle": 27.12 }, + { "time": 0.5, "angle": 38.83 }, + { "time": 0.5333, "angle": 30.76 }, + { "time": 0.5666, "angle": -20.49 }, + { "time": 0.6, "angle": -30.8 }, + { "time": 0.6666, "angle": -1.31 }, + { "time": 0.8, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.8, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.8, "x": 1, "y": 1 } + ] + }, + "gun": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.1333, "angle": 24.72 }, + { "time": 0.5, "angle": -11.87 }, + { "time": 0.8, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 0, "y": 0, "curve": "stepped" }, + { "time": 0.8, "x": 0, "y": 0 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.8, "x": 1, "y": 1 } + ] + }, + "hip": { + "rotate": [ + { "time": 0, "angle": 0, "curve": "stepped" }, + { "time": 0.8, "angle": 0 } + ], + "translate": [ + { + "time": 0, + "x": 0, + "y": -24.88, + "curve": [ 0.3, 0.8, 0.663, 0.91 ] + }, + { + "time": 0.0666, + "x": 0, + "y": -40.28, + "curve": [ 0.456, 0, 0.339, 0.98 ] + }, + { + "time": 0.2666, + "x": 0, + "y": 20.51, + "curve": [ 0.17, 0.52, 0.596, 0.99 ] + }, + { "time": 0.4, "x": 0, "y": -24.88 }, + { "time": 0.4333, "x": 0, "y": -26.36 }, + { + "time": 0.4666, + "x": 0, + "y": -45.06, + "curve": [ 0.25, 0, 0.75, 1 ] + }, + { "time": 0.6666, "x": 0, "y": 20.51 }, + { "time": 0.8, "x": 0, "y": -24.88 } + ], + "scale": [ + { "time": 0, "x": 1, "y": 1, "curve": "stepped" }, + { "time": 0.8, "x": 1, "y": 1 } + ] + }, + "front_foot_ik": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.0333, "angle": -41.68 }, + { "time": 0.1333, "angle": -102.41 }, + { "time": 0.2, "angle": -121.43 }, + { "time": 0.2333, "angle": -133.6 }, + { "time": 0.2666, "angle": -139.86 }, + { "time": 0.3333, "angle": -152.39 }, + { "time": 0.3666, "angle": -146.32 }, + { "time": 0.5, "angle": -143.8 }, + { "time": 0.5333, "angle": -114.84 }, + { "time": 0.5666, "angle": -99.08 }, + { "time": 0.6, "angle": -63.03 }, + { "time": 0.6333, "angle": -47.34 }, + { "time": 0.6666, "angle": -31.04 }, + { "time": 0.7, "angle": -25.01 }, + { "time": 0.7666, "angle": -15.95 }, + { "time": 0.8, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": 159.31, "y": 38.68 }, + { "time": 0.0333, "x": 115.32, "y": 0.18 }, + { "time": 0.0666, "x": 16.34, "y": 0.18 }, + { "time": 0.1333, "x": -116.47, "y": 0.18 }, + { "time": 0.2, "x": -210.62, "y": 126.29 }, + { "time": 0.2333, "x": -226.11, "y": 203.77 }, + { "time": 0.2666, "x": -223.73, "y": 258 }, + { "time": 0.3333, "x": -208.23, "y": 250.25 }, + { "time": 0.3666, "x": -207.64, "y": 215.69 }, + { "time": 0.4, "x": -205.85, "y": 185.29 }, + { "time": 0.4333, "x": -179.03, "y": 176.95 }, + { "time": 0.4666, "x": -154, "y": 157.28 }, + { "time": 0.5, "x": -128.97, "y": 108.41 }, + { "time": 0.5333, "x": -76.68, "y": 75.29 }, + { "time": 0.5666, "x": -41.24, "y": 67.74 }, + { "time": 0.6, "x": 28.47, "y": 59.02 }, + { "time": 0.6333, "x": 70.89, "y": 78.19 }, + { "time": 0.6666, "x": 110.42, "y": 99 }, + { "time": 0.7, "x": 122.21, "y": 79.58 }, + { "time": 0.7666, "x": 145.33, "y": 44.61 }, + { "time": 0.8, "x": 159.31, "y": 38.68 } + ] + }, + "front_ankle_ik": { + "translate": [ + { "time": 0, "x": -14.25, "y": -25.95 }, + { "time": 0.1333, "x": -13.63, "y": -34.72 }, + { "time": 0.1666, "x": -11.41, "y": -12.61 }, + { "time": 0.5, "x": -14.88, "y": -31.78 }, + { "time": 0.8, "x": -14.25, "y": -25.95 } + ] + }, + "rear_foot_ik": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.0666, "angle": 18.55 }, + { "time": 0.1333, "angle": 52.75 }, + { "time": 0.1666, "angle": 87.39 }, + { "time": 0.2333, "angle": 133.94 }, + { "time": 0.3, "angle": 150.92 }, + { "time": 0.3666, "angle": 168.02 }, + { "time": 0.4, "angle": 129.09 }, + { "time": 0.4333, "angle": 125.95 }, + { "time": 0.5, "angle": 114.27 }, + { "time": 0.5333, "angle": 85.36 }, + { "time": 0.5666, "angle": 49.17 }, + { "time": 0.6333, "angle": 9.5 }, + { "time": 0.7, "angle": 4.15 }, + { "time": 0.7666, "angle": -1.36 }, + { "time": 0.8, "angle": 0 } + ], + "translate": [ + { "time": 0, "x": -248.9, "y": 230.06 }, + { "time": 0.0666, "x": -228.7, "y": 134.11 }, + { "time": 0.1333, "x": -145.37, "y": 94.22 }, + { "time": 0.1666, "x": -82.75, "y": 54.32 }, + { "time": 0.2333, "x": 37.92, "y": 74.38 }, + { "time": 0.2666, "x": 80.37, "y": 91.82 }, + { "time": 0.3, "x": 93.21, "y": 67.3 }, + { "time": 0.3666, "x": 99.34, "y": 35.47 }, + { "time": 0.4, "x": 68.62, "y": 0.35 }, + { "time": 0.4333, "x": 21.58, "y": -2.63 }, + { "time": 0.5, "x": -92.9, "y": -2.63 }, + { "time": 0.5333, "x": -166.79, "y": -2.63 }, + { "time": 0.5666, "x": -252.51, "y": 57.14 }, + { "time": 0.6333, "x": -304.31, "y": 214.02 }, + { "time": 0.7, "x": -296.91, "y": 281.36 }, + { "time": 0.7666, "x": -269.53, "y": 257.68 }, + { "time": 0.8, "x": -248.9, "y": 230.06 } + ] + }, + "rear_ankle_ik": { + "translate": [ + { "time": 0, "x": 85, "y": -33.59, "curve": "stepped" }, + { "time": 0.8, "x": 85, "y": -33.59 } + ] + }, + "back_foot_tip": { + "rotate": [ + { "time": 0, "angle": -151.51 }, + { "time": 0.1333, "angle": -93.33 }, + { "time": 0.1666, "angle": -70.77 }, + { "time": 0.2333, "angle": 22.43 }, + { "time": 0.3, "angle": 36.85 }, + { "time": 0.3666, "angle": 34.85 }, + { "time": 0.4, "angle": 0.76 }, + { "time": 0.4333, "angle": 0.82, "curve": "stepped" }, + { "time": 0.5333, "angle": 0.82 }, + { "time": 0.5666, "angle": -61.7 }, + { "time": 0.6333, "angle": -139.59 }, + { "time": 0.7, "angle": -146.78 }, + { "time": 0.8, "angle": -151.51 } + ] + }, + "front_foot_tip": { + "rotate": [ + { "time": 0, "angle": 42.19 }, + { "time": 0.0333, "angle": -0.23 }, + { "time": 0.1333, "angle": -0.28 }, + { "time": 0.1666, "angle": -59.58 }, + { "time": 0.2, "angle": -112.55 }, + { "time": 0.2666, "angle": -130.07 }, + { "time": 0.3333, "angle": -146.2 }, + { "time": 0.5, "angle": -86.48 }, + { "time": 0.5333, "angle": -86.98 }, + { "time": 0.5666, "angle": -66.86 }, + { "time": 0.6, "angle": -22.89 }, + { "time": 0.6333, "angle": -12.06 }, + { "time": 0.7, "angle": 35.39 }, + { "time": 0.8, "angle": 42.19 } + ] + }, + "hair1": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.1, "angle": -10.21 }, + { "time": 0.2666, "angle": 7.16 }, + { "time": 0.3666, "angle": -0.15 }, + { "time": 0.4666, "angle": -10.21 }, + { "time": 0.6333, "angle": 7.16 }, + { "time": 0.7333, "angle": -0.15 }, + { "time": 0.8, "angle": 0 } + ] + }, + "hair2": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.1, "angle": -10.21 }, + { "time": 0.1666, "angle": -30.13 }, + { "time": 0.2666, "angle": 6.38 }, + { "time": 0.3666, "angle": -13.48 }, + { "time": 0.4666, "angle": -10.21 }, + { "time": 0.5333, "angle": -30.13 }, + { "time": 0.6333, "angle": 6.38 }, + { "time": 0.7333, "angle": -13.48 }, + { "time": 0.8, "angle": 0 } + ] + }, + "hair3": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.1, "angle": -10.21 }, + { "time": 0.2666, "angle": 7.16 }, + { "time": 0.3666, "angle": -0.15 }, + { "time": 0.4666, "angle": -10.21 }, + { "time": 0.6333, "angle": 7.16 }, + { "time": 0.7333, "angle": -0.15 }, + { "time": 0.8, "angle": 0 } + ] + }, + "hair4": { + "rotate": [ + { "time": 0, "angle": 0 }, + { "time": 0.1, "angle": -10.21 }, + { "time": 0.1666, "angle": -30.13 }, + { "time": 0.2666, "angle": 6.38 }, + { "time": 0.3666, "angle": -13.48 }, + { "time": 0.4666, "angle": -10.21 }, + { "time": 0.5333, "angle": -30.13 }, + { "time": 0.6333, "angle": 6.38 }, + { "time": 0.7333, "angle": -13.48 }, + { "time": 0.8, "angle": 0 } + ] + } + }, + "ffd": { + "default": { + "eye": { + "eye_indifferent": [ + { + "time": 0, + "vertices": [ -0.15, 0.7, -0.15, 0.7, -0.15, 0.7, -0.15, 0.7 ], + "curve": [ 0.25, 0, 0.75, 1 ] + }, + { + "time": 0.4, + "vertices": [ 3.92, -18.23, 3.92, -18.23, 3.92, -18.23, 3.92, -18.23 ], + "curve": [ 0.25, 0, 0.75, 1 ] + }, + { + "time": 0.8, + "vertices": [ -0.15, 0.7, -0.15, 0.7, -0.15, 0.7, -0.15, 0.7 ] + } + ] + }, + "goggles": { + "goggles": [ + { + "time": 0, + "vertices": [ -0.08, 0.23, -0.04, 0.11, -1.15, 5.38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.08, 5, -1.86, 8.62, -0.82, 3.8, -0.09, 0.27, -0.11, 0.32, -5.76, 7.76, -3.05, 10.76, -2.18, 10.12, -4.92, 9.45, 0, 0, 0, 0, 0.65, -3.03, 0.55, -2.59, -1.4, 6.49, -0.16, 0.42, -0.14, 0.37, -0.13, 0.35, -0.11, 0.31, -0.12, 0.33, -0.12, 0.32, -0.1, 0.28, -0.9, 4.02, -0.04, 0.13, -1.07, 4.96, -1.06, 4.94, -1.04, 4.9, -0.04, 0.11, -0.07, 0.2, -0.1, 0.26, -0.12, 0.33, -0.13, 0.36, -0.14, 0.37, -0.13, 0.35, -0.11, 0.33, -0.14, 0.39, -0.16, 0.43, -1.4, 6.49, -0.82, 3.8, -0.82, 3.8, -0.82, 3.8, -1.82, 8.48, -1.82, 8.48, -1.82, 8.48 ], + "curve": [ 0.25, 0, 0.75, 1 ] + }, + { + "time": 0.4, + "vertices": [ 1.73, -8.03, 0.7, -3.25, 0.39, -1.84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.08, -5.04, 3.97, -18.45, 0.47, -2.19, 1.59, -7.39, 2.05, -9.54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2.58, -11.98, 2.93, -13.58, 2.71, -12.57, 2.01, -9.32, 2.26, -10.49, 2.34, -10.86, 2.05, -9.51, 1.96, -9.1, 0.75, -3.51, 0.08, -0.37, 0.57, -2.69, 0.35, -1.63, 0.65, -3.01, 1.4, -6.53, 1.98, -9.21, 4.07, -18.92, 3.45, -16.03, 3.45, -16.02, 2.42, -11.25, 2.14, -9.93, 2.06, -9.56, 2.59, -12, 0, 0, 0.47, -2.19, 0.47, -2.19, 0.47, -2.19, 0.47, -2.19, 0.47, -2.19, 0.47, -2.19 ], + "curve": [ 0.25, 0, 0.75, 1 ] + }, + { + "time": 0.8, + "vertices": [ -0.08, 0.23, -0.04, 0.11, -1.15, 5.38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.08, 5, -1.86, 8.62, -0.82, 3.8, -0.09, 0.27, -0.11, 0.32, -5.76, 7.76, -3.05, 10.76, -2.18, 10.12, -4.92, 9.45, 0, 0, 0, 0, 0.65, -3.03, 0.55, -2.59, -1.4, 6.49, -0.16, 0.42, -0.14, 0.37, -0.13, 0.35, -0.11, 0.31, -0.12, 0.33, -0.12, 0.32, -0.1, 0.28, -0.9, 4.02, -0.04, 0.13, -1.07, 4.96, -1.06, 4.94, -1.04, 4.9, -0.04, 0.11, -0.07, 0.2, -0.1, 0.26, -0.12, 0.33, -0.13, 0.36, -0.14, 0.37, -0.13, 0.35, -0.11, 0.33, -0.14, 0.39, -0.16, 0.43, -1.4, 6.49, -0.82, 3.8, -0.82, 3.8, -0.82, 3.8, -1.82, 8.48, -1.82, 8.48, -1.82, 8.48 ] + } + ] + }, + "head": { + "head": [ + { + "time": 0, + "offset": 36, + "vertices": [ 2.81, 0.98, 1.01, 8.62, -2.7, 4.09, -4.48, 7.13, -4.76, 3.34, 0, 0, -2.25, -4.31, 0, 0, 0, 0, -0.45, 2.11, -0.45, 2.11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -3.14, 14.58, -2.86, 13.27, -2.55, 11.81, -2.17, 10.06, -1.96, 9.1, -2.01, 9.33, -2.29, 10.65, -2.63, 12.23, -3.05, 14.17, 0, 0, 0, 0, 0, 0, 0, 0, -0.59, 2.77, -1.96, 9.1, -2.16, 10.02 ], + "curve": [ 0.25, 0, 0.75, 1 ] + }, + { + "time": 0.4, + "offset": 38, + "vertices": [ 3.14, -14.61, 3.14, -14.61, 3.14, -14.61, 0.83, -3.87, 0, 0, 0, 0, 0, 0, 0, 0, -0.45, 2.11, -0.45, 2.11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.17, -0.81, 0.17, -0.81, 0.17, -0.81, 0.17, -0.81, 0.17, -0.81, 0.17, -0.81, 0.17, -0.81, 0.17, -0.81, 0.17, -0.81, 0, 0, 0, 0, 0, 0, 0, 0, 0.55, -2.58, 0.41, -1.93, 1.04, -4.83 ], + "curve": [ 0.25, 0, 0.75, 1 ] + }, + { + "time": 0.8, + "offset": 36, + "vertices": [ 2.81, 0.98, 1.01, 8.62, -2.7, 4.09, -4.48, 7.13, -4.76, 3.34, 0, 0, -2.25, -4.31, 0, 0, 0, 0, -0.45, 2.11, -0.45, 2.11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -3.14, 14.58, -2.86, 13.27, -2.55, 11.81, -2.17, 10.06, -1.96, 9.1, -2.01, 9.33, -2.29, 10.65, -2.63, 12.23, -3.05, 14.17, 0, 0, 0, 0, 0, 0, 0, 0, -0.59, 2.77, -1.96, 9.1, -2.16, 10.02 ] + } + ] + }, + "mouth": { + "mouth_grind": [ + { + "time": 0, + "vertices": [ -10.19, 11.77, -1.6, 14.33, 0.02, 8.88, -8.56, 6.32 ], + "curve": [ 0.25, 0, 0.75, 1 ] + }, + { + "time": 0.4, + "vertices": [ -1.87, -8.97, 0, -17.7, 0, -17.7, -1.87, -8.97 ], + "curve": [ 0.25, 0, 0.75, 1 ] + }, + { + "time": 0.8, + "vertices": [ -10.19, 11.77, -1.6, 14.33, 0.02, 8.88, -8.56, 6.32 ] + } + ] + }, + "torso": { + "torso": [ + { + "time": 0, + "offset": 6, + "vertices": [ 6.35, 1.33, 6.35, 1.33, 0, 0, 0, 0, 0.82, 5.12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.82, 5.12, 0.82, 5.12, -0.94, 5.14, 0.82, 5.12, 0.82, 5.12, 0.24, 4.36, 0.24, 4.36, 0.24, 4.36, 0, 0, 0.82, 5.12 ] + }, + { + "time": 0.4, + "offset": 2, + "vertices": [ 1.46, 2.96, 0.68, 3.23, 2.2, 0.1, 0, 0, -0.31, -2.89, 0, 0, -0.18, 0.38, 0.33, -3.61, 0, 0, 0, 0, -0.55, 4.21, -0.55, 4.21, 0, 0, 0, 0, -0.29, -8.94, -0.02, -9.5, 0.23, -9.93, -4.64, -8.88, -2.62, -9.24, -1.7, -5.16, -1.7, -5.16, -1.7, -5.16, 0, 0, -7.37, -10.47 ] + }, + { + "time": 0.8, + "offset": 6, + "vertices": [ 6.35, 1.33, 6.35, 1.33, 0, 0, 0, 0, 0.82, 5.12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.82, 5.12, 0.82, 5.12, -0.94, 5.14, 0.82, 5.12, 0.82, 5.12, 0.24, 4.36, 0.24, 4.36, 0.24, 4.36, 0, 0, 0.82, 5.12 ] + } + ] + } + } + } + } +} +} \ No newline at end of file diff --git a/spine-corona/examples/spineboy/spineboy-mesh.lua b/spine-corona/examples/spineboy/spineboy-mesh.lua new file mode 100644 index 000000000..d1ed51cef --- /dev/null +++ b/spine-corona/examples/spineboy/spineboy-mesh.lua @@ -0,0 +1,62 @@ + +-- This example shows simple usage of displaying a skeleton with queued animations. + +local spine = require "spine-corona.spine" + +local json = spine.SkeletonJson.new() +json.scale = 0.6 +local skeletonData = json:readSkeletonDataFile("examples/spineboy/spineboy-mesh.json") + +local skeleton = spine.Skeleton.new(skeletonData) +function skeleton:createImage (attachment) + -- Customize where images are loaded. + return display.newImage("examples/spineboy/images/" .. attachment.name .. ".png") +end +function skeleton:createMesh (attachment, meshParameters) + -- Customize where mesh fill is loaded from. + local mesh = display.newMesh(meshParameters) + mesh.fill = {type="image", filename="examples/spineboy/images/" .. attachment.name .. ".png"} + return mesh +end + +skeleton.group.x = display.contentWidth * 0.5 +skeleton.group.y = display.contentHeight * 0.9 +skeleton.flipX = false +skeleton.flipY = false +skeleton.debug = true -- Omit or set to false to not draw debug lines on top of the images. +skeleton.debugAabb = true +skeleton:setToSetupPose() + + +local stateData = spine.AnimationStateData.new(skeletonData) + +-- AnimationState has a queue of animations and can apply them with crossfading. +local state = spine.AnimationState.new(stateData) +state:addAnimationByName(0, "run", true, 0) + +state.onStart = function (trackIndex) + print(trackIndex.." start: "..state:getCurrent(trackIndex).animation.name) +end +state.onEnd = function (trackIndex) + print(trackIndex.." end: "..state:getCurrent(trackIndex).animation.name) +end +state.onComplete = function (trackIndex, loopCount) + print(trackIndex.." complete: "..state:getCurrent(trackIndex).animation.name..", "..loopCount) +end +state.onEvent = function (trackIndex, event) + print(trackIndex.." event: "..state:getCurrent(trackIndex).animation.name..", "..event.data.name..", "..event.intValue..", "..event.floatValue..", '"..(event.stringValue or "").."'") +end + +local lastTime = 0 +Runtime:addEventListener("enterFrame", function (event) + -- Compute time in seconds since last frame. + local currentTime = event.time / 1000 + local delta = currentTime - lastTime + lastTime = currentTime + + -- Update the state with the delta time, apply it, and update the world transforms. + state:update(delta) + state:apply(skeleton) + skeleton:updateWorldTransform() +end) + diff --git a/spine-corona/main.lua b/spine-corona/main.lua index e279f778e..abc21fe60 100644 --- a/spine-corona/main.lua +++ b/spine-corona/main.lua @@ -1,5 +1,5 @@ - require "examples.spineboy.spineboy" +-- require "examples.spineboy.spineboy-mesh" -- require "examples.goblins.goblins" -- require "examples.dragon.dragon" -- require "examples.hero.hero" diff --git a/spine-corona/spine-corona/spine.lua b/spine-corona/spine-corona/spine.lua old mode 100644 new mode 100755 index ff6c21afd..fe4bed0d7 --- a/spine-corona/spine-corona/spine.lua +++ b/spine-corona/spine-corona/spine.lua @@ -84,6 +84,13 @@ function spine.Skeleton.new (skeletonData, group) return display.newImage(attachment.name .. ".png") end + -- Customizes where images are found. + function self:createMesh (attachment, meshParameters) + local mesh = display.newMesh(meshParameters) + mesh.fill = {type="image", filename=attachment.name .. ".png"} + return mesh + end + -- Customizes what happens when an image changes, return false to recreate the image. function self:modifyImage (attachment) return false @@ -200,6 +207,69 @@ function spine.Skeleton.new (skeletonData, group) self.group:insert(image) end + elseif attachment.type == spine.AttachmentType.mesh or attachment.type == spine.AttachmentType.skinnedmesh then + + if image and image.attachment ~= attachment then -- Attachment image has changed. + if self:modifyImage(image, attachment) then + image.lastR, image.lastA = nil, nil + image.attachment = attachment + else -- If not modified, remove the image and it will be recreated. + display.remove(image) + images[slot] = nil + image = nil + end + end + + local worldVertices = {} + attachment:updateUVs() + attachment:computeWorldVertices(0, 0, slot, worldVertices) + + for i = 2, #worldVertices, 2 do + worldVertices[i] = -worldVertices[i] + end + + if not image then + local meshParameters = { + mode = "indexed", + vertices = worldVertices, + indices = attachment.triangles, + uvs = attachment.uvs, + zeroBasedIndices = true, + } + image = self:createMesh(attachment, meshParameters) + if image then + if slot.data.blendMode == spine.BlendMode.normal then + image.blendMode = "normal" + elseif slot.data.blendMode == spine.BlendMode.additive then + image.blendMode = "add" + elseif slot.data.blendMode == spine.BlendMode.multiply then + image.blendMode = "multiply" + elseif slot.data.blendMode == spine.BlendMode.screen then + image.blendMode = "screen" + end + self.images[slot] = image + image:translate( image.path:getVertexOffset() ) + end + else + for i = 1, #worldVertices, 2 do + image.path:setVertex( 1+ 0.5*(i-1), worldVertices[i], worldVertices[i+1]) + end + end + + if image then + local r, g, b = skeletonR * slot.r, skeletonG * slot.g, skeletonB * slot.b + if image.lastR ~= r or image.lastG ~= g or image.lastB ~= b or not image.lastR then + image:setFillColor(r, g, b) + image.lastR, image.lastG, image.lastB = r, g, b + end + local a = skeletonA * slot.a + if a and (image.lastA ~= a or not image.lastA) then + image.lastA = a + image.alpha = image.lastA + end + self.group:insert(image) + end + end end diff --git a/spine-lua/Animation.lua b/spine-lua/Animation.lua index 79af8c295..8b4cc423b 100644 --- a/spine-lua/Animation.lua +++ b/spine-lua/Animation.lua @@ -612,16 +612,16 @@ function Animation.FfdTimeline.new () local frameVertices = self.frameVertices local vertexCount = #frameVertices[0] local vertices = slot.attachmentVertices - if not vertices or #vertices ~= vertexCount then - if #vertices < vertexCount then - vertices = {} - slot.attachmentVertices = vertices - end + if not vertices or #vertices < vertexCount then + vertices = {} + slot.attachmentVertices = vertices + end + if #vertices ~= vertexCount then alpha = 1 -- Don't mix from uninitialized slot vertices. end slot.attachmentVerticesCount = vertexCount - if time >= frames[#frames - 1] then -- Time is after last frame. - local lastVertices = frameVertices[#frames - 1] + if time >= frames[#frames] then -- Time is after last frame. + local lastVertices = frameVertices[#frames] if alpha < 1 then for i = 1, vertexCount do local vertex = vertices[i]