

Obviously not using this for production, but here is how I save a SpriteAtlas to a PNG: I couldn't find a direct way to access the SpriteAtlas texture so I went through the internal method Unity uses to show it in the inspector panel. Fortunately, TexturePacker makes it easy and fast to export the sprite. spritesheet-only Exports only the sprite sheet without data file. Caution If you have an individual image file called bullet.png, the HD version. To save memory and CPU, TexturePacker automatically makes a note of the duplicate images and only adds one from each set of duplicate images to the sprite. tps (TexturePacker Save) file for each folder. You can even hand off the sprite sheet creation to your artist.
#Texturepacker export png free
I had to copy the texture to a new RenderTexture first then save the copy, solution from here. First of all, using file formats such as png or jpeg can reduce the total size of. Usage: TexturePacker options <.pnggiftifjpgswf.>Same issue here with the new SpriteAtlas system. How can I make an atlas texture readable? If I cannot, how can I save an atlas texture into a PNG file? If you don't want to use whole UI framework for simple process of importing sprites, maybe it would be. It has ability to import atlas exported by texture packer and use it frames, take a look here: UIAtlas.

AtlasTextureExporter.ExportAtlases () (at Assets/Root/Editor/AtlasTextureExporter.cs:27) It would be easiest if you use some framework for UI, for example NGUI from Unit圓d Asset Store. You can make the texture readable in the Texture Import Settings. If (!Directory.Exists(() + "/Atlases"))ĭirectory.CreateDirectory(() + "/Atlases") įileStream fs = new FileStream(() + "/Atlases/" + texture.name + ".png", FileMode.Create) ĪrgumentException: Texture 'SpriteAtlasTexture-myScene-2048x2048-fmt12' is not readable, the texture memory can not be accessed from scripts. Texture2D textures = Packer.GetTexturesForAtlas(atlasName) įor (int j = 0 j < textures.Length j++) Public class AtlasTextureExporter : MonoBehaviourįor (int i = 0 i < atlasNames.Length i++) Use similar settings shown for step two below, then click 'Export'. Select textures you want in sheet and drag them onto grey box titled 'or drag'n'drop images here'. Click the link in the title above and it will open the tool in your browser. I wrote following script that was supposed to do so: using UnityEngine sprites.png Exporting Sprite Sheets with Free Texture Packer 0.2.4. What I would like to do is to save all of them into PNG files so I can look them up outside Unity editor. When I go to: Window > 2D > Sprite Packer I can preview atlas textures generated automatically by Sprite Packer.
