Search Unity

  1. The 2021.2 beta is now available. To find out what's new, have a look at our 2021.2 beta blog post.
    Dismiss Notice
  2. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    Dismiss Notice
  3. Dismiss Notice

PSD Importer?

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

  1. winryese

    winryese

    Joined:
    May 4, 2016
    Posts:
    17
    Same problem here. preview.4 - 1.2.0. Changing to 8-bit fixed it.
     
  2. SofielafeeStudio

    SofielafeeStudio

    Joined:
    Mar 26, 2018
    Posts:
    41
    Hi
    Is there any way to update an imported PSB without messing all previous bone geo and weighting setup?
    My use case is I have a rigged character already in place and need to add extra layers in the PSB and eventually add more bones weights etc. I've tried either to update the PSB directly or to import extra sprites but in both cases the existing rigging becomes obsolete. Any idea how to proceed and if there is any plan to support updates?
    Thanks
     
  3. Leo-Yaik

    Leo-Yaik

    Unity Technologies

    Joined:
    Aug 13, 2014
    Posts:
    352
    Hi, which software are you using (i.e. Photoshop or third party like Gimp)?
    Will it be possible to send us the 2 files to check it out?
     
  4. SofielafeeStudio

    SofielafeeStudio

    Joined:
    Mar 26, 2018
    Posts:
    41
    Hi Leo, the original materials are Pixel layers from Affinity Photo which are exported to PSD; the original materials are quite big so I'll try to mock up a sample thanks
     
  5. Kane_321

    Kane_321

    Joined:
    Aug 6, 2017
    Posts:
    6
    Is there any plans to add UI Images support to this tool? At the moment it makes a prefab using sprite renders, it would be very helpful if it also made a prefab with a canvas and UI Images already set up.

    Or does anyone know how I can extend it so that I can do this?
     
  6. IceTrooper

    IceTrooper

    Joined:
    Jul 19, 2015
    Posts:
    28
    Is it possible to control padding between sprites? It should fit in 512x512, but because of too wide padding it can't. Those green rects should be closer to each other.
    upload_2020-7-22_18-12-55.png

    EDIT: I found solution. PSDImporter.cs: Line 459 (PSDImporter 2.1.4.). Why did you guys hard code padding=4 and didn't expose it in the editor? :/
     
    Last edited: Jul 22, 2020
    EvOne likes this.
  7. TheSafestSafe

    TheSafestSafe

    Joined:
    Jun 25, 2018
    Posts:
    4
    Hi, any update on officially supporting PSD file format with the importer?
    I use krita which can only export in PSD not PSB.
     
  8. thehen2

    thehen2

    Joined:
    Apr 1, 2014
    Posts:
    46
    How can I use the AssetPostprocessor with the PSD Importer? I need to set spritePixelsPerUnit, mipmap settings etc. on import.

    Closest I can get is OnPreprocessAsset, but then I can't change anything.

    Code (CSharp):
    1.     void OnPreprocessAsset()
    2.     {
    3.         PSDImporter psdImporter = assetImporter as PSDImporter;
    4.         ???
    5.     }
     
    nickfourtimes and EvOne like this.
  9. XxPleYxX

    XxPleYxX

    Joined:
    Jul 26, 2011
    Posts:
    36
    If you exceed the maximum size of the atlas (not the file size which is 80 MB) then the console shows the following error:

     
    Last edited: Oct 14, 2020
  10. nachiketanselms

    nachiketanselms

    Joined:
    Dec 22, 2020
    Posts:
    2
    uhhh but i named my psd to "character rig.psb" but it still was of the format of psd.. pls help me i dont have the money for photoshop and i wanna get most out of unity too
     

    Attached Files:

  11. Leo-Yaik

    Leo-Yaik

    Unity Technologies

    Joined:
    Aug 13, 2014
    Posts:
    352
    You can just change the extension to PSB.
     
  12. anyamation

    anyamation

    Joined:
    Jan 9, 2021
    Posts:
    2
    hi im having an issue where unity is not recognizing my .psb file when I go to "import new assets" my .psb files are not showing up only my .psd files are able to be addes?
     
  13. Leo-Yaik

    Leo-Yaik

    Unity Technologies

    Joined:
    Aug 13, 2014
    Posts:
    352
    Do you have the PSDImporter package installed?
     
  14. nickfourtimes

    nickfourtimes

    Joined:
    Oct 13, 2010
    Posts:
    196
    Just going to jump in here and say this is an issue for me as well; I'd like to be able to change the Max Texture Size of an imported .psb file, but right now that's not an option as the
    PSDImporter
    class doesn't seem to have any viable accessors.
     
  15. Leo-Yaik

    Leo-Yaik

    Unity Technologies

    Joined:
    Aug 13, 2014
    Posts:
    352
    nickfourtimes likes this.
  16. Zephus

    Zephus

    Joined:
    May 25, 2015
    Posts:
    235
    Just a general question - why is the package called "PSD importer" when it only imports .psb? Also, if you can just rename the .psd into .psb, shouldn't that take 1-2 lines of code to make the package recognize .psd files as well?
     
  17. Leo-Yaik

    Leo-Yaik

    Unity Technologies

    Joined:
    Aug 13, 2014
    Posts:
    352
    This is because the .psd file format is currently being imported by TextureImporter.
    We are looking into hooking up with the new Importer override feature so that users can also use PSDImporter with .psd file.
     
  18. Zephus

    Zephus

    Joined:
    May 25, 2015
    Posts:
    235
    Okay, thank you. I have another question - is the PSD importer the only way to get the Skinning Editor for 2D Animation to show the full sprite? For example let's look at the viking from the samples:


    If I import a sprite sheet the character looks like the on the right. And then I have to use the Skinning Editor and kind of have to guess the right pose before putting it in the Scene. But if I use a .psb then the character shows up like the one on the left. Is there no way to arrange the individual sprites without using .psb?
     
  19. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    415
    Hello @Zephus
    A .psb file comes with additional data which enables us to "rebuild" the character the same way it is seen in your DCC tool. A .png is a "flat" image file with only the pixel data in it, which doesn't come with the additional data required to reconstruct a character.
     
  20. nickfourtimes

    nickfourtimes

    Joined:
    Oct 13, 2010
    Posts:
    196
    I just noticed that when I switch platforms (PC to console and back again), all the .psb files seem to be getting reimported, despite the fact that I'm using Asset Database v2. My impression was that, with v2, once an asset is imported on a platform, it shouldn't have to be reimported again the next time you switch back to that platform. However, I've been switching back and forth between platforms several times, and the .psbs are always being reimported (which is a very time-consuming process).

    Is this behaviour by design, or a bug?
     
  21. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    415
    Thanks for letting us know @nickfourtimes,
    The Asset Database v2 should store all previously cached platform data which should prevent a full reimport of the assets when switching between platforms. Could you file a bug report so we can take a closer look?
     
  22. Zephus

    Zephus

    Joined:
    May 25, 2015
    Posts:
    235
    Yes, I realize that. I was just wondering if there's a way to manually create a default "build" of the character when using .png files. I feel like that would help a lot, since not everyone wants to use .psb files.
     
  23. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    415
    @Zephus yeah, I think that is a valid point and something we can add to our backlog to research what that might look like. Thanks for the suggestion.
     
  24. nickfourtimes

    nickfourtimes

    Joined:
    Oct 13, 2010
    Posts:
    196
    Filed it, ID 1327701.
     
    Ted_Wikman likes this.
  25. alexlamar

    alexlamar

    Joined:
    Jan 16, 2014
    Posts:
    3
    Hi! This appears to be the general PSD importer feedback thread, but apologies if this should go somewhere else. I'd love it if we had the ability to add an additional amount of padding inside each of the sprites generated in the sprite mosaic. The big use-case here is to have some empty space around each sprite to be colored via shader, e.g. to add an outline that's 3px wide to a sprite. With the sprites being perfectly-bounded at the moment, that's not really possible.

    Is there another way currently to drive how the mosaic is generated? I would love a simple inspector-driven setting for this, but if there is API exposed that can be used to accomplish this, that works too.
     
  26. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    415
    Hello @alexlamar,
    Thank you for the feedback. Posting it here is as good as any place!
    Currently, this API is not available, but we have seen similar feedback in recent times. I will add this to our internal list of feedback, so we can take it into account when planning future PSD Importer improvements.
     
  27. andygeersdt

    andygeersdt

    Joined:
    Jan 18, 2021
    Posts:
    2
    I have the same problem that a few others have mentioned, that I am attempting to import a PSB file with different layers as an animated sprite, but they have a transparent background and once imported are not all the same size. As a result the pivot point roams all over the place and the animation is spoiled. Is there an option that would allow us to get a consistent pivot point, where its position is automatically adjusted to take account of any transparency that is cropped?
     
unityunity