Hi,
Our Spine files (json, atlas, png) in our app have been prepared using Spine 3.6.50. But from the app perspective, we used the older version of cocos2dx engine(cocos2dx 2.2.3). I notice that the lastest runtime version for cocos2dx 2.2.3 is in the branch - cocos2dx-v2, and the Readme file said "spine-cocos2dx v2 works with data exported from Spine 3.1.08."
Unfortunately, we have done a lot of animations in spine 3.6.50. So i want to convert the .json(exported from 3.6.50) to .json(can be imported by 3.1.08).
I did the attempt step by step(copy content to .json and try to import), and found that:
- 3.1.08 can use the "bones" section
- 3.1.08 can use the "slots" section
- but in skins section, when i edited the following code to the json(exported from 3.6.50), spine 3.1.08 will imported error.
"skins": {
"default": {
"finger": {
"finger": {
"type": "mesh",
"uvs": [ 0.14206, 0.01496, 0.03123, 0.02052, 0.02173, 0.18734, 0.16106, 0.32081, 0.40806, 0.44685, 0.47456, 0.673, 0.66139, 0.99924, 0.94956, 0.99924, 1, 0.825, 0.86406, 0.59144, 0.76273, 0.3412, 0.47773, 0.19291, 0.16086, 0.16132, 0.3857, 0.27439, 0.58836, 0.37264, 0.69919, 0.6099, 0.8227, 0.87312 ],
"triangles": [ 2, 12, 3, 2, 1, 12, 1, 0, 12, 11, 12, 0, 3, 13, 4, 4, 13, 14, 13, 11, 14, 3, 12, 13, 13, 12, 11, 6, 16, 7, 7, 16, 8, 6, 15, 16, 6, 5, 15, 16, 9, 8, 16, 15, 9, 5, 14, 15, 5, 4, 14, 15, 10, 9, 15, 14, 10, 14, 11, 10 ],
"vertices": [ 1, 10, 8.88, -2.21, 1, 1, 10, 10.4, -0.01, 1, 2, 9, 14.24, 4.43, 0.01579, 10, 5.27, 4.52, 0.98421, 2, 9, 7.9, 5.44, 0.7013, 10, -1.08, 5.42, 0.2987, 2, 8, 16.05, 3.96, 0.61124, 9, 0.12, 4.28, 0.38876, 1, 8, 6.71, 5.02, 1, 1, 8, -7.39, 4.45, 1, 1, 8, -9.32, -2.19, 1, 1, 8, -2.8, -5.35, 1, 1, 8, 7.3, -4.89, 1, 2, 8, 17.83, -5.43, 0.84921, 9, -2.11, -5, 0.15079, 2, 9, 6.96, -3.75, 0.91487, 10, -1.87, -3.78, 0.08513, 2, 9, 12.88, 1.19, 6.3E-4, 10, 3.96, 1.26, 0.99937, 2, 9, 5.85, 0.1, 0.99992, 10, -3.05, 0.05, 8.0E-5, 2, 8, 17.77, -1.05, 0.77272, 9, -0.37, -0.98, 0.22728, 1, 8, 7.68, -0.88, 1, 1, 8, -3.51, -0.71, 1 ],
"hull": 12,
"edges": [ 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14, 16, 16, 18, 18, 20, 20, 22, 0, 22, 2, 24, 24, 26, 26, 28, 28, 30, 30, 32 ],
"width": 24,
"height": 41
}
}
}
},
so, i use spine 3.1.08 to make a mesh, then export, the json like this, and works fine:
"skins": {
"default": {
"body": {
"body": { "x": 35.14, "y": -2.91, "rotation": 91.3, "width": 209, "height": 142 }
},
"head": {
"head": {
"type": "mesh",
"uvs": [ 0, 0, 0.20726, 1.0E-5, 0.40726, 0, 0.6, 0, 0.8, 0, 1, 0, 1, 0.2, 1, 0.4, 1, 0.6, 1, 0.8, 1, 1, 0.8, 1, 0.6, 1, 0.4, 1, 0.2, 1, 0, 1, 0, 0.8, 0, 0.6, 0, 0.4, 0, 0.2, 0.2, 0.2, 0.2, 0.4, 0.2, 0.6, 0.2, 0.8, 0.4, 0.2, 0.4, 0.4, 0.4, 0.6, 0.4, 0.8, 0.6, 0.2, 0.6, 0.4, 0.6, 0.6, 0.6, 0.8, 0.8, 0.2, 0.8, 0.4, 0.8, 0.6, 0.8, 0.8 ],
"triangles": [ 20, 19, 0, 1, 20, 0, 24, 1, 2, 20, 1, 24, 28, 3, 4, 2, 3, 28, 24, 2, 28, 32, 4, 5, 28, 4, 32, 32, 5, 6, 18, 19, 20, 21, 20, 24, 18, 20, 21, 25, 24, 28, 21, 24, 25, 29, 28, 32, 25, 28, 29, 33, 32, 6, 29, 32, 33, 33, 6, 7, 17, 18, 21, 22, 21, 25, 17, 21, 22, 26, 25, 29, 22, 25, 26, 30, 29, 33, 26, 29, 30, 34, 33, 7, 30, 33, 34, 34, 7, 8, 16, 17, 22, 23, 22, 26, 16, 22, 23, 27, 26, 30, 23, 26, 27, 31, 30, 34, 27, 30, 31, 35, 34, 8, 31, 34, 35, 35, 8, 9, 15, 16, 23, 14, 23, 27, 15, 23, 14, 13, 27, 31, 14, 27, 13, 12, 31, 35, 13, 31, 12, 11, 35, 9, 12, 35, 11, 11, 9, 10 ],
"vertices": [ 168.54, 88.94, 168.15, 54.12, 167.78, 20.52, 167.42, -11.84, 167.05, -45.44, 166.68, -79.04, 133.08, -78.67, 99.48, -78.29, 65.87999, -77.92, 32.28, -77.55, -1.29999, -77.17, -0.93, -43.58, -0.56, -9.97999, -0.18, 23.61, 0.18, 57.21, 0.55, 90.81, 34.15, 90.43, 67.75, 90.06, 101.35, 89.69, 134.94, 89.31, 134.57, 55.71, 100.97, 56.09, 67.37, 56.46, 33.78, 56.83, 134.2, 22.12, 100.6, 22.49, 67, 22.86, 33.4, 23.24, 133.82, -11.47, 100.23, -11.1, 66.62999, -10.72, 33.03, -10.35, 133.45, -45.07, 99.85, -44.7, 66.26, -44.32, 32.66, -43.95 ],
"hull": 20,
"edges": [ 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14, 16, 16, 18, 18, 20, 20, 22, 22, 24, 24, 26, 26, 28, 28, 30, 30, 32, 32, 34, 34, 36, 36, 38, 38, 0 ],
"width": 168,
"height": 168
}
}
}
},
I cannot find why 3.1.08 cannot use the "finger" mesh. I think may be there are some different algorithm about the "triangles" or "vertices" in the in 3.6.xx version.
So my questions are:
- Is it possible to convert Spine files (json, atlas, png) from spine 3.6.50 to make them support the Spine 3.1.08?
- What's the details when doing the convert?
- What's are best practices for my situation?
Thanks in advance for any hints.