• Off-topic
  • Image Export Size help

Related Discussions
...

We were able to change the X scale value of the root bone in the .json file and it seemed to work. The Y scale was zero. It appears that the order of the .json file as it is generated from Spine is precise but the script I mentioned in my previous reply loses this order. I would have thought that the ordering of the file didn't matter but apparently it does. Is there an ETA on when a scaling feature like DanielEgan requested could be implemented? Thanks.

rstarks, I'm not sure what you are trying to accomplish? If you want to scale using JSON, you can specify a scale for the SkeletonJson class which loads the data.

Order in JSON only matters for JSON arrays.

A root Y scale of 0 would ruin the skeleton...

Sorry for not being specific, I'm actually a UI designer/part-time coder trying to help an artist with some of his work. I'm a little lost. As far as I can understand, we'd like to be able to work with the character at a larger size and then export a smaller version of the same character with its animations scaled down properly. Basically I was asked to modify the values of the .json file based on some of the details in this thread.

{"bones":[{"name":"root","x":0.96]},{"name":"bone","parent":"root","x":38.81,"y":278.66}

Based on your previous post I took the original, working .json file and changed the x value above. Notice there isn't a Y value


which sounds like it might be another problem, or perhaps I changed the wrong thing. The x value was 1.92 but I changed it to 0.96 and then we loaded assets into Spine that were 50% of the original size. In any case, thanks for taking time to respond to this, I appreciate the help.

No worries, that helps. 🙂

See docs for values of attributes omitted from the JSON:
http://esotericsoftware.com/spine-json-format/

This thread is about using high resolution images in Spine, then exporting images at a smaller size. The answer is to use X and Y scale on the root bone in Spine before exporting.

What you want is different, you want to use high resolution images in Spine, then use different resolution images at runtimes. No need to mess with the JSON, use SkeletonJson scaling at runtime:
http://esotericsoftware.com/spine-using ... s/#scaling

2 месяца спустя

http://animagnum.com/projects/spine/SpineScale.zip

I made a quick and dirty tool that will adjust an exported JSON file in case you need to scale an entire animation to work with different sized assets. The swf will require some form of Flash Player in order to run as it currently does not work when run through a browser. The tool looks for a file named skeleton.json in the same directory as the swf. You can easily rename a file and then change it back when you're done. Enter in the scale value you want to multiply the object by and then click the scale button. You will be prompted to save a new file so the original remains untouched.

Here's an example of how it works:

I created some assets and an animation at one scale (1x) but needed to resize the animation for 2x. First I made 2x assets in Photoshop and then replaced the original assets in my /images/ folder. Then I used my tool to modify the JSON file and used a scale value of 2. This process multiplied all of the relevant values by 2 and then saved a copy of the original JSON. Back in Spine I clicked "Import Data..." and selected my modified JSON file. Then I pointed it to the directory with the resized images. This resulted in doubling the size of the animation I had previously been using.

2 месяца спустя
Nate написал

Reading your thread again...

DanielEgan написал

Am I the only one that needs images at 48 x 48 or 64 x 64 and doesn't use the runtimes.. just wants the pngs to load into my game. If I use bigger in Spine to be able to see to align the images and then try to reduce the size after in photoshop, they of course look like crap.. If I use the image size I need then I cant line them up in spine. 🙁

Can you set the root bone X and Y scale to something smaller and then export images? Eg, here is a tiny spineboy (at 60fps!):

Изображение удалено из-за отсутствия поддержки HTTPS. | Показать

How do you do this? When you say "root bone" are you referring to the bone all the other wants are parented to? I have a hip bone (like the run anim tutorial), but if I select it and try to scale... all sorts of weirdness happens. (just some of the images scale in place)

I am surprised there isn't a dialog to specify size of images on export.

Are you sure you don't have bone or image compensation on ?
Scaling the root bone should not cause problems if you scale it uniformly.

Having a dialog to specify the size of images on export might be worthwhile, not sure though. I wonder what Nate thinks.

Shiu написал

Are you sure you don't have bone or image compensation on ?
Scaling the root bone should not cause problems if you scale it uniformly.

Having a dialog to specify the size of images on export might be worthwhile, not sure though. I wonder what Nate thinks.

Ah, you are right. I tried this morning at it scaled down correctly. I must have had bone or image compensation on!

It would be really handy to be able to export images at certain sizes. Right now, the only flow that feels "natural" (but seriously tedious) is to export every animation (as a series of PNGs) and import into Photoshop to get the exact sizing, then re-render the animation at the right size. This is because I did the art hi-res, imported that way into Spine, with the thought that I could scale down at render.

Ok so for exact sizing a dialog to define the size would be handy I see. How about rulers in the viewport, would that give you enough control you think?

It seems like it would be useful control, but hard to say if that would completely fulfill being able to output specific image sizes. (I'd think not since everyone needs certain size images for game engines etc.)


Shiu написал

Are you sure you don't have bone or image compensation on ?
Scaling the root bone should not cause problems if you scale it uniformly.

Having a dialog to specify the size of images on export might be worthwhile, not sure though. I wonder what Nate thinks.

After playing with scaling down the root bone, I realize that it does indeed still cause issues with my animation. I am sure it is possible, but it's not evident how to scale down the root bone without having to do heavy tweaks afterwards. (ex. when I scale down, my translate keys are very extreme.) If that is the flow, it will be more complicated than it is worth.

This alone is enough to warrant a way to export specific image sizes on export, imo.

The translate keys being extreme should only be the case if you have translate keys on the root. If that is so you can create a second root bone and move all your other bones to that, then put the translate keys on the new root (call it whatever you like ofc). Then you should be able to scale the root bone without translation keys being extreme.