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

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.

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

Hi!

How do I access the generated Texture2D sprite sheet in an editor script? The PSDImporter class has almost nothing in it.

What do you want to do with the Texture2D? You can do AssetDatabase.LoadAssetAtPath([path to the file]) to access the texture2d

1 Like

Hello,

Texture2D does not work with “PSB” files not PSD. already tried it. it only return null.
I’m also looking for a way to convert the PSB file to PNG so i can properly make secondary textures.
Current using 2D skeletal animation.

does anyone know a solution to this?

If anyone is reading this I hope this helps.

  1. For png converter code you can check this out PSD Importer and Secondary Textures
  2. Disable Compression and enable read/write in advanced settings
  3. Click to the object field and search your PSB file. Dragging does not work. (If this does not work you can just restart unity this happened to me lol)
  4. Now generate png!

Hmm it should since the PSDImporter also generates a Texture2D as a subasset that should be loadable via the AssetDatbase call.