Search Unity

PSD Importer?

Discussion in '2D Experimental Preview' started by Aygtets, Dec 2, 2018.

  1. Rich_A

    Rich_A

    Joined:
    Nov 22, 2016
    Posts:
    154
    What are the options for PSD import in 2017.4?
     
  2. Leo-Yaik

    Leo-Yaik

    Unity Technologies

    Joined:
    Aug 13, 2014
    Posts:
    149
    We currently only support PSDImporter for 2018.3 onwards.

    Nonetheless, with ScriptedImporter already available in 2017.4, it is possible to implement your own PSDImporter given our package as base
     
    Rich_A likes this.
  3. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    560
    I use the latest Unity 2019.1.2f1 Windows and when I try to update PSD from Package Manager I get this error:

    Cannot perform upm operation: Unable to add package [com.unity.2d.psdimporter@1.1.0-preview.3]:
    One or more dependencies could not be added to the local file system:
    com.unity.burst: EPERM: operation not permitted, unlink 'F:\TarotReadings_test\Library\PackageCache\com.unity.burst@1.0.0-preview.6\.Runtime\Burst.Backend.dll' [NotFound]
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
     
  4. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    560
    installing Burst fixed this.
     
  5. Gronek

    Gronek

    Joined:
    Sep 23, 2017
    Posts:
    2
    Hey!
    I have a problem. I use Krita for creating sprites and after importing the PSD file to unity it opens properly only in sprite editor. I cannot check the Rig Character box as it is not visible anywhere in the inspector. My sprite is slicing properly, and everything looks like it should work, but it doesn't ;(

    The Unity ver that I use is 2018.3.14.f1.

    I've followed the Brackeys tutorial step by step and tried to use another tutorials. Reinstall, reimport, recreating sprite and using PNG doesn't work. I just cannot use the PSB extension in Krita. Should I change the graphics editor to another? It would be sad as this one is the most comfortable to me.

    Kind regards
     
  6. LOGames

    LOGames

    Joined:
    Sep 4, 2016
    Posts:
    19
    @Gronek Have you tried renaming it to .PSB even if Krita won't actually save a PSB? The formats are almost identical so that should usually work.
     
  7. Gronek

    Gronek

    Joined:
    Sep 23, 2017
    Posts:
    2
    daaaaamn it helped :O Thanks a lot! I've seen this tip earlier but just thought it's weird. Sorry :) And thanks! That really helped!
     
  8. RuslanSmirnov

    RuslanSmirnov

    Joined:
    Jun 13, 2019
    Posts:
    1
    i hoped that you will write some library for c++ background. And that be working fast (on gpu, whitout GetPixel()). But now we have wrapper over Paint.NET, which is an so slow if we have 500+ layers in file.

    In fact, this importer same as here: https://github.com/SubjectNerd-Unity/Psd2UnityImporter

    Or am I wrong?
     
  9. EvOne

    EvOne

    Joined:
    Jan 29, 2016
    Posts:
    59
    Will the PSD Importer in the future support named layers in the document?

    Here is a drawing created in the Adobe Illustrator, where in the layers with the assigned names there are grouped non-named "parts" related to this element.
    These names of layers are perfectly understood by Photoshop after exporting from AI to PSD-format.

    But the PSD Importer completely ignores both the names of the layers themselves and the grouping of elements inside the layers - everything will be broken down into separate vector paths and groups, and the names will be lost :(

    PSDImporter_02.mp4_snapshot_00.05_[2019.06.16_21.39.13].jpg
    PSDImporter_02.mp4_snapshot_00.12_[2019.06.16_21.40.14].jpg PSDImporter_02.mp4_snapshot_00.15_[2019.06.16_21.40.27].jpg

    P.S. Sorry for google-translate!
     
    Last edited: Jun 16, 2019
  10. Sam_Ooi

    Sam_Ooi

    Unity Technologies

    Joined:
    Mar 5, 2018
    Posts:
    22
    Hello! The PSD Importer supports importing layers with their names and groupings intact, but it may have issue with the vector and path elements from Adobe Illustrator.

    Just a few questions:

    1. Currently, only the .PSB format is supported with the PSD Importer. You said you converted the .AI file to a .psd file. Have you tried to save it and import it as a .psb file?

    2. Could you attach the original .AI file you created for us to check?

    Thank you!
     
  11. EvOne

    EvOne

    Joined:
    Jan 29, 2016
    Posts:
    59
    Hello!

    Export from the illustrator in my version is possible only in PSD,
    2019-06-20_10-09-57.png
    options for the export in the screenshot. Then I just renamed the file extension to .psb.
    2019-06-20_10-17-24.png
    I also imported saved from AI psd-file into Photoshop (which saw all the named layers), and then saved it in PSB format.
    2019-06-20_10-25-32.png

    But after importing into a Unity, I don’t see any difference between the two assets.
    2019-06-20_10-42-52.png

    Original AI file in attached zip

    With best regards,
    Alex
     

    Attached Files:

  12. Sam_Ooi

    Sam_Ooi

    Unity Technologies

    Joined:
    Mar 5, 2018
    Posts:
    22
    Hi, in this screenshot, you did not set the PSDImporter to keep Layer Grouping. Click the checkbox next to 'Use Layer Grouping' in the PSD Importer settings, and then click Apply. Then drag your character into the Scene again. You should see it with its layers in the correct grouping.

    Could you let me know if that helps?
     
    EvOne likes this.
  13. EvOne

    EvOne

    Joined:
    Jan 29, 2016
    Posts:
    59
    I'm sorry...
    double-facepalm-cropped.jpg
    How did I miss such an obvious reason for this "problem"...
    -Once again - excuse me ...
    1-107-128.png

    P.S. I revised my early sources - I put this checkbox! :)
    but then I did not have named layers, so there were still groups and paths, so I remembered this...
    But now... Oooh... Sorry...

    Everything is ok now :)
    2019-06-20_18-13-26.png
     
  14. Sam_Ooi

    Sam_Ooi

    Unity Technologies

    Joined:
    Mar 5, 2018
    Posts:
    22
    Ha ha, no worries. Glad that everything is working fine now :)
     
    EvOne likes this.
  15. RedOrAlive

    RedOrAlive

    Joined:
    Feb 5, 2019
    Posts:
    2
    I'm trying to us this library, and I've noticed that I am unable to build for iOS once I import the package. Thinking it might be an issue with my project, I created a brand new clean one, installed the package and even before importing a PSB I try to build to iOS and it presents me with 6 errors, was wondering if anyone else was experiencing this? Looks like the burst lib is whats throwing them.
     
  16. RedOrAlive

    RedOrAlive

    Joined:
    Feb 5, 2019
    Posts:
    2
    In true developer fashion, the minute I asked for help I resolved the issue. If anyone else has this problem, first make sure your XCode Command Line tools are set to point at the latest version (XCode > Preferences > Location) then you need to update the Burst library in Unity to match the same preview version that the PSD Importer is using - preview3 1.1.0 in my case.
     
  17. nitrofurano

    nitrofurano

    Joined:
    Jun 7, 2019
    Posts:
    54
    besides psd, would be great having xcf import as well
     
  18. EvOne

    EvOne

    Joined:
    Jan 29, 2016
    Posts:
    59
    I apologize for repeating my message in another thread of the forum, but there is still no answer.
    And maybe I just asked a question in the wrong place... :rolleyes:
    ---
    Could you please tell if it is possible now, and if so, - how can you "update" the graphics already imported by the PSDImporter to its newer version?
    Since I have never found any mention of how to do this often required process, I tried to simply change the PSB-file to a new version outside of Unity - in the Windows explorer... :rolleyes:

    But despite the fact that the Rig with the bones, the binding and the weights is preserved, the result was not successful...
    In my opinion, the structure of the layers and their names have not changed in the imported file, the dimensions of the picture also did not change (I watched it),
    but the PSD Importer, even in the form of an atlas shows a completely different picture.
    And of course, on the scene, the fully working prefab of the character was completely broken :(
    A similar substitution for the old PSB file did not help...

    -it seems that even the slightest change in the structure of the layers in the psb file, and even the addition of a new group of drawn objects inside previously imported named objects - causes catastrophic changes during import.
    Is it possible to change this in future versions?

    I understand that the method I used to update the graphics is slightly "hacker" :D
    but how can I do it in a regular way?

    P.S. Sorry for Google-translate
     
  19. Leo-Yaik

    Leo-Yaik

    Unity Technologies

    Joined:
    Aug 13, 2014
    Posts:
    149
    @EvOne which package version are you using?
     
    EvOne likes this.
  20. EvOne

    EvOne

    Joined:
    Jan 29, 2016
    Posts:
    59
    Only this is available to me:
    2019-07-24_17-13-36.png
    Are there already newer versions?
    -If this is so - I can not even find out about it - the package manager does not show future versions :(

    Unity 2019.3.0a8 and newer -I can not install because of a bug with a crash when running under Win7
    so I had to stop at a7
    and 2019.2.0b7 is stable (for me) working beta. Newer versions 19.2 - I have not yet installed.
     
  21. MikaMobile

    MikaMobile

    Joined:
    Jan 29, 2009
    Posts:
    841
    In my experience, you can make changes to a PSB and not totally ruin your rig, but there are a couple quirks right now.

    The one I keep bumping into is when you do a simple change that doesn’t effect the geometry at all, like changing a layer’s color. This should be fine, but I find that it temporarily breaks instances of the PSB that are inside prefabs: the bones all become invisible and stop working. The “fix” for me has been to simply open the effected prefab and close it again. (By the way, I reported this bug with clear repro steps but it came back as unable to repro?)

    Another issue I’ve found is when changing a layer in a way that makes it a different size than it used to be - the existing bounding box around that sprite in the atlas has to be manually changed, and the geometry for that layer has to be regenerated in the skinning editor and any weights redone as well.
     
  22. sergebat

    sergebat

    Joined:
    Nov 22, 2015
    Posts:
    4
    This is extremely useful piece of advice! It indeed worked for me for the PSDs saved in Affinity Designer!

    Can someone knowledgeable of Unity PSD importer internals comment on the reliability of this hack going forward? :) If it works now on some PSD renamed to PSB is it likely to break in future versions on the Unity/Importer? Are there particular caveats and format differences to watch for (like maybe we are safe if we only use rasterized layers)? What is the motivation behind supporting less common PSB format in the first place? Thanks in advance! :)
     
  23. Leo-Yaik

    Leo-Yaik

    Unity Technologies

    Joined:
    Aug 13, 2014
    Posts:
    149
    PSB is a Photoshop file format similar to PSD file except it supports larger file size.

    The reason we are using the PSB format is because of Unity Importer's constraint where only 1 file extension can be imported by 1 importer and the PSD extension is currently taken by the TextureImporter.

    Moving forward, works are in place to allow PSD extension to be imported by other importers (including ScriptedImporters). The current PSDImporter will also continue to support both PSB and PSD file extension.
     
    sergebat likes this.