What’s new?
With the release of Unity 2021.1 2D PSDImporter 5.0 is now available. This release includes:
Skeleton sharing. This is designed to be used together with the 2D Animation package to create bone hierarchies that can be shared between similar characters. Read more about it in the Skeleton sharing section of the documentation.
The Keep Duplicate Name feature is no longer experimental
About 2D PSD Importer
The 2D PSD Importer is an Asset importer that imports Adobe Photoshop .psb files into Unity, and generates a Prefab of Sprites based on the imported source file. Read the complete documentation here. Read more in the 2D PSD Importer documentation.
Getting Started
In an existing project in Unity 2021.1:
Open Package Manager by going to Window > Package Manager
Select Unity Registry in the Packages drop-down menu.
Choose 2D PSD Importer from the list and click on Install at the bottom right of the Package Manager window.
I’m using the PSD file Importer Override scripts mentioned here so that I can import my psd files directly. They work, mostly, provided you add
using UnityEditor.AssetImporters;
to the PSDImporterOverride.cs and you set the class to “public” instead of “internal”.
There is a small problem though; in
[ScriptedImporter(1, "psd", AutoSelect = false)]
AutoSelect is deprecated and supposed to be replaced by overrideFileExtensions. Unfortunately I don’t know how to do that and I’m not good enough to guess by myself, since the documentation is useless in the matter.
The code works but I sometimes get the following error message on entering play mode. This message doesn’t prevent working on the project though. I guess something should be added to the override script to avoid this kind of confusion?
Not sure if it belongs here or in 2d-animation discussion, but current workflow with normal maps has an issue.
Sometimes, PSD importer has quantum-tier differences in arrangement of sprites in atlas for seemingly identical PSB files. Using such atlas with misplaced sprites as a normal map in secondary textures, naturally leads to wrong results after rendering is done.
PSD importer is changing the arrangement of sprites in atlas quite often actually, despite me locking transparency of layers when I edit the source.
This randomness is absolutely killing me. Can we have some control over how sprites are arranged in atlas? Currently, I’m dealing with it by directly exporting atlas texture and drawing a normal version over it. But as you would expect, this method is terrible since, again, PSD importer can change the arrangement of the base file at any moment because it reacted to space radiation, Moon phase, or something else.
The arrangement shouldn’t change unless there is a size change in any layer i.e. the visual of a layer has gone bigger or smaller. The size change sometimes can be undetecteable by the naked eye eg there might be residue of a pixel that has very low alpha value from previous paint and erase. We are considering adding a ‘alpha tolerance’ parameter during import so that it can be tweak to prevent this from happening.
It looks like combining a few layers during edit caused edited sprites to get a combined alpha channel (despite locked layers) which is triggered rearrangement. After I restricted my workflow to using clipping masks only, I’ve managed to prevent my atlases from rearranging sprites. Still… limiting artists in their workflow is not a good thing.
I understand where the issue lies but I can’t suggest any elegant solution. Maybe… sharing atlas coordinates for sprites? Since we need a normal map to be exactly the same as the main file, it’s kind of logical for main file to share its arrangement if our layers named identically.
Yes, we are thinking along that line as well for how it works under the hood. On top of that, we would also thinking of a UI/UX flow that makes sense and hassle free as much as possible.
Doing anything and the default importer is not changing. Reimport, copy new psd into project, delete meta file, any and everything cannot change default importer
@Thaina you should now be able to upgrade to PSD Importer 7.0.0-pre.3, which is the latest package version for Unity 2022.1. Have a look at our documentation on how to create a PSD Override with PSD Importer 7.0.0-pre.3 and let us know how it goes.