Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Sprite Atlas Skinning editor on multiple sprite assets

Discussion in '2D Experimental Preview' started by TJHeuvel-net, Sep 16, 2019.

  1. TJHeuvel-net

    TJHeuvel-net

    Joined:
    Jul 31, 2012
    Posts:
    732
    I'm not an artist, so i'm using Kenneys amazing packages for my art. The characters come in separate files, is there any way to make a rig without merging them? My initial attempt was to just make a Sprite Atlas edit and try to add it there, but it seems like i am forced to first put them all in the same PSD, and then Unity packs them apart again.

    upload_2019-9-16_12-51-15.png
     
    Last edited: Sep 16, 2019
  2. nikefootbag

    nikefootbag

    Joined:
    Jun 13, 2017
    Posts:
    27
    Did you happen to find a solution to this? I’m wondering how to do the same.
    If it’s not possible with current editor gui, i’m also wondering if it can be achieved via custom editor script
     
  3. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    791
    My advice is that you build the character up with multiple layers inside Photoshop. If Photoshop is not for you, users have found success with other DCC tools. Having the character in one .psd/.psb file will give you a much easier workflow than spreading it out over multiple .pngs.

    The Sprite Editor only allows editing of one source file (.png) at a time, so if you really want to build a character using multiple .pngs, you would have to create one bone structure per .png and then assemble them all inside a prefab.
     
  4. nikefootbag

    nikefootbag

    Joined:
    Jun 13, 2017
    Posts:
    27
    Thanks @Ted_Wikman , you seem to be the go to for all things Sprite Skinning Editor.
    So is the way that the Sprite Skinning editor displays psd layers just not replicatable with a custom editor script?
    Like it doesn’t seem a psd in the Sprite Skinning Editor is flattening all the layers into a single png for editing (ie the only one png edited at a time you mention), so how is the Sprite Skinning Editor able to arrange each layer so you can cohesively rig something (versus a single atlas of disjointed parts if it’s not in PSD format)
     
  5. nikefootbag

    nikefootbag

    Joined:
    Jun 13, 2017
    Posts:
    27
    E.g. if I have some individual pngs and a json file storing their individual offsets from the origin, can I arrange them in the Sprite Skinning Editor in the same way the psd is visualized?
     
  6. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    791
    Not sure I fully understand what you are asking. But the difference between a .png and a .psd is that a .png only contains image data, while a .psd contains, among other things, layer data (with positioning etc). This additional data is the reason why we can both slice the texture inside the .psd into Sprites and construct a hierarchy the same way they are arranged in Photoshop.

    If you wanted to, you could for sure build a custom editor which works similar to the Sprite Editor. This custom editor can then take .pngs and .jsons, where the .json contains the layer data.
     
  7. nikefootbag

    nikefootbag

    Joined:
    Jun 13, 2017
    Posts:
    27
    That definitely sounds like what i’m after. Layer data with positioning sounds like what I mean. In my case each png is a piece of a character and I store each sprite’s pivot and offset to parent in a json file, aswell as sorting layer relative to parent.
    So how would I go about constructing the layer data from json and getting that into the Sprite Skinning Editor?
     
  8. nikefootbag

    nikefootbag

    Joined:
    Jun 13, 2017
    Posts:
    27
    Oh I just re-read and you said custom editor that works similar. So is it likely not worth the effort, i.e. not really possible to piggy back on the existing Sprite Skinning Editor, and therefore better to work out how to have the data in psd/psb format? (As you more or less suggested originally )
     
  9. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    791
    Yes, working with .psb/.psd will be the more efficient solution, as working with .png & .json will require some engineering efforts from your end.
    The reason why we haven't looked into supporting this .png/.json combo is because there doesn't seem to be any widely used .json formats for this type of data, while .psd/.psb files are heavily used throughout the game dev industry.
     
    nikefootbag likes this.
  10. nikefootbag

    nikefootbag

    Joined:
    Jun 13, 2017
    Posts:
    27
    Thanks Ted, makes sense, i’ll give it a go
     
    Ted_Wikman likes this.