Skip to content

Latest commit

 

History

History
25 lines (14 loc) · 2.23 KB

README.md

File metadata and controls

25 lines (14 loc) · 2.23 KB

Unity Psd Importer

Unity Psd Importer is an addon for Unity3D. It provides an editor window from which individual layers can be selected and exported. The layers are exported either as individual PNGs or as an atlas image.

To compile the Unity PSD Importer in the Unity3D Editor you must have the files gmcs.rsp and smcs.rsp with "-unsafe" in the first line of the files in the root directory of your project. Otherwise you can compile the code as a DLL and it will also work in the editor.

To use the Unity PSD Importer, in the Unity3D Editor go to Sprites > PSD Import to access the importer, then drag and drop or search for the PSD file you wish to import.

To only export the layers to PNG files, click on the "Export Visible Layers" button and it will only create the PNG files with the sprites that are visible. You can individually check which layers you want to import.

To create a root gameobject with all the layers as child sprites and the layers compiled in an atlas, click on the "Create atlas" button. All the layers will be saved to an atlas texture with sprites as children that is autogenerated with the atlas size you define under "Max. atlas size". A root gameobject with the filename of the PSD file is created and all the layers as sprites will be as children gameobjects under the root gameobject.

To create PNG files individually with each sprite assigned to the PNG files, click on the "Create sprites" button. This will create a root gameobject with the filename of the PSD file and all the layers as sprites under the root gameobject.

All sprites are created with a center pivot so that they will import in their correct alignment with the PSD file layers' positions.

Some notes on the PSD support:

It should support all image layers, however text, layer groups, or other special layers will not be supported. It is best to flatten layer groups and text before importing.

All the imported layers should be imported at their same positions as in the PSD file.

When importing as an atlas, if the layers cannot collectively fit in the atlas they will be scaled down to fit the atlas texture, therefore it is preferable to import the layers using "Create sprites" to have the layers imported as separate PNG files.