Search Unity

Export PSB file as It Appears (Sliced) in the Sprite Editor Window?

Discussion in '2D Experimental Preview' started by GarethDWilson, May 4, 2019.

  1. GarethDWilson


    May 27, 2017
    Hi, first time poster here.

    Is there a way to view and export a PSB file as it is shown (Sliced) in the Sprite Editor window (as pictured)?

    I'm looking to match the positions of each sprite so that I can build a corresponding spritesheet of normal maps with SpriteIlluminator and TexturePacker.

    I've tried the different layout options in TexturePacker (i.e. adding padding and "Force Squared") to get it to match up, but none seem to result in that which is shown in Unitys Sprite Editor window. Does Unity use specific settings when it packs and slices the sprites in the sprite editor?

    Please let me know if more info is needed, or if I'm going about this the wrong way.

    Thanks for your time.

    View attachment 415321
  2. Leo-Yaik


    Unity Technologies

    Aug 13, 2014
    Yes, we use our own custom packing algorithm to layout the layers from the PSB file into a single image.

    One possible way you can do this is to write a simple 'texture converter' that takes the Texture2D that is generated from the PSDImporter and save it out as an external png file. Using that PNG file, you will then modified it to use it as your normal map