- 編集済み
meshes not working - with import data -scale
Hello.
I'm having problems working with meshes and scale.
I have a character that I created and animated in 100% full resolution.
then I want to import the character in another spine project to animate it in different scale. The character has meshes applied.
I go to file/import data... and import the json (that I previously exported) and set scale to 0.44.
Then when the skeleton is created I point the image folder to a folder containing PNGs at 0.44 scale. But any assets that don't have meshes render properly. Any assets that have meshes, render I believe at 1 scale (blowed up), and get cropped by the meshes.
I have also tested another thing. For instance. I take a skeleton that I created with meshes. And it renders fine. Then I re link the image folder to a folder containing pngs at 44% scaled down. The weird thing is that any image that has meshes still renders properly on spine setup editor. But images that don't have meshes render at 0.44 scale. Why the meshes render properly evnthough it is linked to pngs that at 44% scaled down? Then if I go back to images and change back to the proper image folder with the assets at 100%, then the meshes render in a wrong way, the original image gets scaled up, and cropped by the mess.
Am I doing anything wrong?
I'd definitively like to edit my characters at higher resolution and then import the json at whatever resolution I may need, So I don't need to make the skeleton and bones and meshes structure every time.
Well, you'd better work at 100% all the time and then scale the exported atlas at 0.44 scale or whatever you need, spine can scale images and optimize the size for you (:
Thanks Erikari,
That's what I am trying to do. But I'm having problems with meshes. My full res character is let's say, 1300x 800. So I rig it and make basic animations in full res 1300x800. But then I need to import that skeleton into a let's say a 2048x1536 spine project to do further animations and tweaks, and that's where I have the problem.
I create all my atlas with texture packer, so it hasn't been a problem for us to create different assets sizes for different devices @2x @3X.
But I assume that if I import the full res skeleton (1300x800) and then scale the root bone down to work on the 2048x1536 comp, then when I export the json from the 2048x1536 and link it during runtime to the the let's say 44% smaller atlas that I created with texture packer, I assume it would make the assets extra smaller, because it is loading the already sized down atlas and then apply the 44% scale down I created on the root bone. Does it make sense?
That's why I am trying to import the json data by file/import data.../ -> and set scale to .44 to match the the right 44% scale image pngs folder.
I tried many times, and I think I made it to kind of work. Before exporting the son from the full res spine project (1300x800) I made the image link to go online to link it to a folder that doesn't have those images. Then when importing the json I tried with the axes set to local, and that time the skeleton loaded properly all the assets even the meshes.
I dont know if I am doing something wrong on this process or there is a bug on the way spine editor loads images with meshes applied to it, when using different scale than 1 on data import.
When you Import Data
with a scale, the resulting skeleton has all its bones and attachments scaled. Spine doesn't scale the mesh UVs or your image files, it expects the mesh images to be scaled the same amount. This is because generally people use Import Data
with scale to create a version of their project that uses smaller or larger images (often because they created their project with massive images and later realized that isn't great). If you resize your images by 44% to match your scaled Spine project, then your meshes will show up correctly.
We've added a section to the documentation to explain how Spine handles image size changes for mesh images. Sorry that wasn't clear!
Meshes - Spine User Guide: Image resize
I suggest using a single resolution across all your skeletons. I also don't think it's helpful to use massive images in Spine. You can use one size images in Spine, then at runtime you can use those Spine skeletons with images that are smaller (eg to support crappy devices) or larger (eg to support super ultra mega HD).