- Изменено
Size Changes of Skins Throws off Positioning
Here is an issue I'm having that I may have alluded to before but now I need to find a way to address. So I have a character template and currently the character is using skins to look like this.
But now I've decided to make the mouth and eyebrow skins a little smaller (only a pixel in my case). I did this in photoshop and then used the photoshoptospine script. This results in them now being moved 0.5 (because they are a pixel smaller) in all animations. (In this case I did not import any new data into the spine project, the editor automatically is using the new images which have smaller dimensions)
Even if I took the time to move them back, some characters may have giant eyebrows for example and then they'll be off again. There's gotta be some kind of easy solution. All I can think of is if the dimensions of the exported assets area always the same then they won't throw off the coordinate position.
EDIT: If the output photoshop layer images were consistently had dimensions that were either odd or even numbers, that might fix this issue as skins would not end up half a pixel off relative to the other skins. I bet I could edit the script to do this. Still, perhaps there is an easier way. Also, even if that worked, I would have to repair all 40 animations here.
In my approach, create a new skeleton by importing the new JSON file which is exported from Photoshop via Import Data
, then move the attachment to the existing skeleton from the new skeleton, copy the transform of the moved attachment, and paste it to the existing attachment in Setup mode. If you reposition attachments in this way in setup mode, there is no need to modify your animations. To be clear about this workflow, I have prepared a screen recording that demonstrates it.
The steps demonstrated in this video are as follows:
- Modify the mouth image already placed on the Spine editor in Photoshop and re-export it using PhotoshopToSpine.
2.Import the JSON file created by PhotoshopToSpine as an additional skeleton viaImport Data
. - Move only the mouth slot and attachment from the added skeleton to the existing skeleton.
- Select the moved mouth attachment and press
Ctrl+C
to copy the transform, select the existing mouth attachment and pressCtrl+V
to paste and reposition it.
Perhaps there is a better way to do it, but at least I often follow this procedure. I hope this will help you.
Let me add something additional. You can use the Replace
option to replace an existing attachment, but if you have not used the [skin] tag in your psd to assign the attachment to the appropriate skin, the skin placeholder will be removed after replacing, so this is the reason why I did the way in the video.
If the tag settings in the PSD correctly match the skin and the slot it is set to in Spine, the animation will be retained even if it is replaced using the Replace
option.
Thank you. I might need some time to try this out and some other stuff before I've got a satisfying solution.