我想知道,mesh附件属性的附件是怎么保存XY轴坐标的?
比如这里两个例子,一个是mesh属性的BG,另一个是region属性的BG,通过它们各自导出的JSON文件,我可以在region属性的BG的JSON下清晰的看到保存好的Y轴坐标,而mesh属性的BG的JSON我找不到,是否有什么算法可以转化?
最近我在编写一些集体导出脚本,发现有些文件的XY轴坐标不是统一,但是有些是使用了mesh属性的BG我无法定位。
这是例子文件:
这是test_mesh_BG:
{"skeleton": {"hash": "Skrp5nAiu7D6MU+fNMrFVc6E4uI","spine": "3.8.99","width": 1406,"height": 901,"images": "","audio": ""},
"bones": [{ "name": "root" },{ "name": "BG", "parent": "root" }],
"slots": [{ "name": "BG", "bone": "BG", "attachment": "BG" }],
"skins": [{
"name": "default",
"attachments": {
"BG": {
"BG": {
"type": "mesh",
"uvs": [ 1, 0.41334, 0.99999, 0.49947, 0.99999, 0.59895, 1, 0.80904, 1, 1, 0.92601, 1, 0.75986, 1, 0.52268, 1, 0.29635, 1, 0.12486, 1, 0, 1, 0, 0.84193, 0, 0.51745, 0, 0.26991, 0, 0, 0.15702, 0, 0.37246, 0, 0.50401, 0, 0.6297, 0, 0.72348, 0, 1, 0, 0.91138, 0.28087, 0.81994, 0.45768, 0.72685, 0.62491, 0.63002, 0.81004, 0.37245, 0.85866, 0.4657, 0.69307, 0.58682, 0.50742, 0.69401, 0.33849, 0.81698, 0.13976, 0.88064, 0.34726, 0.77107, 0.19564, 0.67583, 0.06385, 0.58575, 0.19799, 0.485, 0.37194, 0.35531, 0.54923, 0.23848, 0.72318, 0.11843, 0.62115, 0.2149, 0.44386, 0.35423, 0.26155, 0.45927, 0.07254, 0.22347, 0.18126, 0.10342, 0.36525, 0.1045, 0.0876, 0.79205, 0.9209, 0.87616, 0.74752, 0.95197, 0.59196 ],
"triangles": [ 13, 43, 41, 36, 35, 26, 35, 38, 34, 38, 39, 34, 38, 41, 39, 39, 40, 33, 39, 41, 40, 43, 15, 41, 41, 16, 40, 11, 37, 36, 36, 37, 35, 37, 38, 35, 37, 12, 38, 12, 42, 38, 38, 42, 41, 42, 13, 41, 46, 22, 1, 0, 1, 30, 21, 20, 0, 18, 40, 17, 41, 15, 16, 29, 19, 20, 40, 16, 17, 32, 18, 19, 9, 36, 8, 36, 9, 11, 11, 12, 37, 12, 13, 42, 6, 44, 5, 5, 44, 3, 6, 7, 24, 44, 6, 24, 7, 25, 24, 44, 24, 45, 25, 26, 24, 24, 23, 45, 24, 26, 23, 8, 25, 7, 44, 45, 3, 11, 9, 10, 13, 14, 43, 43, 14, 15, 5, 3, 4, 45, 2, 3, 45, 46, 2, 2, 46, 1, 25, 8, 36, 1, 22, 30, 30, 21, 0, 45, 23, 46, 26, 27, 23, 26, 35, 27, 23, 22, 46, 23, 27, 22, 35, 34, 27, 27, 28, 22, 27, 34, 28, 22, 28, 30, 34, 33, 28, 34, 39, 33, 21, 30, 31, 30, 28, 31, 28, 33, 31, 31, 29, 21, 21, 29, 20, 33, 40, 18, 33, 32, 31, 33, 18, 32, 31, 32, 29, 32, 19, 29, 25, 36, 26 ],
"vertices": [ 1, 1, 703, 528.58, 1, 1, 1, 702.99, 450.98, 1, 1, 1, 702.99, 361.34, 1, 1, 1, 703, 172.06, 1, 1, 1, 703, 0, 1, 1, 1, 598.97, 0, 1, 1, 1, 365.37, 0, 1, 1, 1, 31.9, 0, 1, 1, 1, -286.33, 0, 1, 1, 1, -527.45, 0, 1, 1, 1, -703, 0, 1, 1, 1, -703, 142.42, 1, 1, 1, -703, 434.78, 1, 1, 1, -703, 657.81, 1, 1, 1, -703, 901, 1, 1, 1, -482.24, 901, 1, 1, 1, -179.33, 901, 1, 1, 1, 5.64, 901, 1, 1, 1, 182.35, 901, 1, 1, 1, 314.21, 901, 1, 1, 1, 703, 901, 1, 1, 1, 578.4, 647.93, 1, 1, 1, 449.84, 488.63, 1, 1, 1, 318.95, 337.96, 1, 1, 1, 182.81, 171.16, 1, 1, 1, -179.33, 127.35, 1, 1, 1, -48.22, 276.54, 1, 1, 1, 122.07, 443.82, 1, 1, 1, 272.77, 596.02, 1, 1, 1, 445.68, 775.07, 1, 1, 1, 535.17, 588.12, 1, 1, 1, 381.13, 724.73, 1, 1, 1, 247.22, 843.47, 1, 1, 1, 120.56, 722.61, 1, 1, 1, -21.09, 565.88, 1, 1, 1, -203.44, 406.14, 1, 1, 1, -367.7, 249.41, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, -57.26, 835.64, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 410.63, 71.27, 1, 1, 1, 528.89, 227.49, 1, 1, 1, 635.46, 367.65, 1 ],
"hull": 21,
"edges": [ 38, 40, 0, 40, 4, 6, 6, 8, 0, 42, 14, 16, 38, 58, 58, 42, 34, 36, 36, 38, 0, 2, 2, 4, 2, 60, 62, 60, 36, 64, 64, 62, 16, 18, 18, 20, 20, 22, 22, 24, 32, 34, 24, 26, 26, 28, 28, 30, 30, 32, 12, 14, 8, 10, 10, 12 ],
"width": 1406,
"height": 901
}
}
}
}
],
"animations": {"test": {}}}
这是test_region_BG:
{"skeleton": {"hash": "is2VKuDonHyKRd1X1t3CoeNtdoY","spine": "3.8.99","width": 1406,"height": 901,"images": "","audio": ""},
"bones": [{ "name": "root" },{ "name": "BG", "parent": "root" }],
"slots": [{ "name": "BG", "bone": "BG", "attachment": "BG" }],
"skins": [
{
"name": "default",
"attachments": {
"BG": {
"BG": { "y": 450.48, "width": 1406, "height": 901 }
}
}
}
],
"animations": {"test": {}}}