zurrutik@yahoo.es

Hi,

I am using the latest version of the PhotoshopToSpine.jsx script(v 2.9), and I am a little bit surprised by the way it exports Smart Objects. Let's assume we got the following layers in Photoshop:

[slot]MySlot
pic
[slot]MySlot2
pic

MySlot/MySlot2 are groups and both instances of pic are smart objects. If I export this all goes well, two slots are created and each of them contain an attachment called pic( both of them pointing to the pic.png that is generated )

...however...

if I decide to apply a transformation to MySlot2/pic( e.g. change the scale of it to 200% ) and I export, then I see that the scaling has been applied to both MySlot/pic and MySlot2/pic!!!!! I think this is because the export process goes like this:

1)MySlot/pic is rasterized to pic.png ( 1x scale )
2)MySlot2/pic is ratsterized to pic.png( 2x scale ) -> this "smashes" the pic.png generated in 1)

This behaviour is wrong...Technically a Smart Object keeps a reference to the original image as well as all the transforms being made to it so in theory the export process could be done like this:

1)MySlot/pic is rasterized to pic.png ( 1x scale )
2)MySlot2/pic is ratsterized to pic.png( 1x scale ) -> this "smashes" the pic.png generated in 1) but that's ok since both Smart Objects should point to the original 1x scale image
3)Create slot "MySlot" with an attachment "pic" whose scale is 1.0
4)Create slot "MySlot2" with an attachment "pic" whose scale is 2.0


Likewise, when I create a group as a bone( e.g. [bone]MyBone ) and I apply transformations to it, they propagate to the pic being rasterized instead of being applied to the generated bone


Could someone please provide a solution to this problem?( either a fix in the script or maybe a workaround??? ). I am using Photoshop heavily to layout the GUI of my game
and I would happily do it directly in Spine instead of Photoshop but unfortunately Spine has got no alignment tools :(

Cheers,
zurrutik@yahoo.es
  • Сообщения: 8

Erikari

Hello,
just to clarify, do the two pics also have the same name? if their name is the same and they get saved in the same folder, one will overwrite the other.
They can have the same name only if they are written in different folders, such as when the folder tag is used, or when they are part of different skins.

In case they don't, are the two smart objects variations of the same element or two completely different entities? A workaround I used once was to put each of them in a [merge] folder to ensure the script would just flatten them without trying to do anything else.

Regarding the no alignment tools, if you mean snapping, auto distancing, I must agree. Spine has numeric entries and if you parent each part to a bone, you can take advantage of using different axes, such as a parent axis, to enforce alignment. But Photoshop's alignment tools are just too convenient.
Аватара пользователя
Erikari

Erikari
  • Сообщения: 2009

zurrutik@yahoo.es

Hi,

Yes, they have the same name and they get saved in the same folder and the fact that one overwrites the other is good behavior, I don't want this to change, but the problem is that if I change the name of every image that I apply transforms to, I could end up with something like this

[slot]MySlot
pic_big
[slot]MySlot2
pic_small
[slot]MySlot3
pic_rotated
[slot]MySlot4
pic_big_rotated
[slot]MySlot5
pic_small_rotated
....

which will create 5 different pngs( pic_big.png, pic_small.png, pic_rotated, pic_big_rotated.png, pic_small_rotated.png ) even though they all refer to the same image, just rotated/scaled differently!!!. This will generate an atlas with unnecessary bloat when exported from spine, which is never desirable since texture memory in a game is always precious.

If we were to do this task directly in Spine, all slots could refer to the same image and we could add each of the different transforms to each attachment separately e.g.

[slot]MySlot
pic ( scale: 2.0 2.0 )
[slot]MySlot2
pic ( scale: 0.5 0.5 )
[slot]MySlot3
pic ( rotate: 45.0 )


Makes sense?

Could you please give me any ideas on how to tackle this problem?

Cheers,
zurrutik@yahoo.es
  • Сообщения: 8

Erikari

Hello,
Photoshop to Spine does not take note of the amount of rotation or scale you applied to a smart object, it will see it just like a normal layer.
If the name is the same, you'll end up with one file. if they are all different, you'll have many of them in all the different rotated/scaled ways.

I suggest placing them as you need them, export them, then once in Spine, duplicate one of them multiple times, and match the position of the others with it, deleting the references as you go.
Аватара пользователя
Erikari

Erikari
  • Сообщения: 2009

zurrutik@yahoo.es

Hi,

Ok, thanks a lot for the clarification. It's a little inconvenient though, I might try to modify the PhotoshopToSpine.jsx to get what I want. Will let you know if I find a way to do it.

Thanks!
zurrutik@yahoo.es
  • Сообщения: 8

Erikari

Well, if you manage to, that would be a nice addition :D
Аватара пользователя
Erikari

Erikari
  • Сообщения: 2009

zurrutik@yahoo.es

maybe in exchange for a free Pro license? :p ;)
zurrutik@yahoo.es
  • Сообщения: 8


Вернуться в Bugs