Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more..
    Dismiss Notice
  3. Dismiss Notice

Update exisiting PSB sprite

Discussion in '2D' started by PapayaLimon, Feb 3, 2020.

  1. PapayaLimon

    PapayaLimon

    Joined:
    Aug 22, 2018
    Posts:
    84
    Hello, I want to know if there is a way to update an existing PSB file where I need to add more elements in sprite resolver (such as new mouths, eyes, etc..) , but that don't make the sprite sheet move everything and lost all my configuration (bones, animations, meshes, etc..)?

    Or maybe just paste new elements in the sprite sheet in the sprite editor? Any ideas?
     
    Tehenauin likes this.
  2. Zonlib

    Zonlib

    Joined:
    Apr 15, 2014
    Posts:
    39
    If you need to change the psb file resolution, you should place the anchor point in the lower left corner where Unity3D sets the (0, 0) coordinates in the sprite sheet, so all the cut sprites will be preserved.

     
    Last edited: Feb 4, 2020
  3. PapayaLimon

    PapayaLimon

    Joined:
    Aug 22, 2018
    Posts:
    84
    No, not that. When I import a PSB file it create a sprite sheet automatically. But if I add a new element in PSB (for example mouth open, closed eyes, etc..). and I reimport, sprite sheet change drastically and then I have to make all over again (bones, mesh heights,etc...). I just want to know if there is a way I don't lost all this.
     
  4. Zonlib

    Zonlib

    Joined:
    Apr 15, 2014
    Posts:
    39
    So try to save it as a psd file.
     
  5. Leo-Yaik

    Leo-Yaik

    Unity Technologies

    Joined:
    Aug 13, 2014
    Posts:
    434
    The data should persist. Are you modifying in Photoshop or another tool?
     
  6. PapayaLimon

    PapayaLimon

    Joined:
    Aug 22, 2018
    Posts:
    84
    PSD file dont show layers on sprite editor, just PSB.

    Ok, thats it. Photoshop solve the problem.
     
    Last edited: Feb 7, 2020
  7. Lepisto3D

    Lepisto3D

    Joined:
    Oct 6, 2019
    Posts:
    27
    I have a similar issue. It doesn't necessarily mess up my sprite configuration layout, but it does mess up the generated geometry so I need to redo it.
     
    Tehenauin likes this.
  8. Lepisto3D

    Lepisto3D

    Joined:
    Oct 6, 2019
    Posts:
    27
    nothing new on this? i still have the same problems... Changing literally one small pixel on a PSB file kills my entire rig. It's really frustrating
     
  9. Leo-Yaik

    Leo-Yaik

    Unity Technologies

    Joined:
    Aug 13, 2014
    Posts:
    434
    @Lepisto3D when you say 'mess up' do you mean that due to a change in the Sprite's size it causes the geometry and size to be misaligned?
     
  10. Unrighteouss

    Unrighteouss

    Joined:
    Apr 24, 2018
    Posts:
    599
    I used to struggle with updating PSB files, but there are two things I found that make it very consistent in my experience. The first is to open the PSB file that's actually in Unity and save the changes directly to that (don't replace it with a file from elsewhere), and the second thing is to check the "Reslice" option in the inspector for the PSB file.

    Hopefully this helps, good luck!
     
    PatientTurtle and ebbenflow like this.
  11. Tehenauin

    Tehenauin

    Joined:
    Oct 18, 2018
    Posts:
    43
    This might work if you are working on a project on your own. But what if the designer wants to send you an updated file and he doesnt even have unity installed?
     
  12. Tehenauin

    Tehenauin

    Joined:
    Oct 18, 2018
    Posts:
    43
    I think I have about the same problems as Lepisto3D. Every time, that I think I found a solution, to my problems something else happens that drives me crazy.
    The thing that the importer seem to like the least is when something changes in the hierarchy. (adding new layers in between etc.)
     
  13. Unrighteouss

    Unrighteouss

    Joined:
    Apr 24, 2018
    Posts:
    599
    If that's the case, you could open the PSB file in Unity and replace all of the images in the file with the one's your designer sent you. That way you keep the same file, but get the new images.
     
  14. Tehenauin

    Tehenauin

    Joined:
    Oct 18, 2018
    Posts:
    43
    This sounds like a workaround. But also a really annoying one. Anyway, I don't have a photoshop license, so I cant do that.
     
  15. Tehenauin

    Tehenauin

    Joined:
    Oct 18, 2018
    Posts:
    43
    I may have to ad, that our designers are using Illustrator to create the graphics and then bring them into photoshop to export them as PSB. This might leed to problems because it is a new psd file that gets exportet from AI each time.
     
  16. Tehenauin

    Tehenauin

    Joined:
    Oct 18, 2018
    Posts:
    43
    Thank you for your pointing me in the right direction! We now managed to make it work. I do not open it directly from unity, but I told the Designer to only update the parts needed in the .psb file and not to export the whole file from illustrator. This way every new file version inherits from the same file. Then I exchange the file in the explorer and open Unity. Unity now reimports everything correctly.
     
    ExtraCat, Leo-Yaik and Unrighteouss like this.
  17. radiowaves

    radiowaves

    Joined:
    Jan 20, 2017
    Posts:
    12
    I am using Unity 2022 and replaced all the layers in PSB file, while keeping the layer names same. In project window it shows fine as spritesheet, but on all of my prefabs the images are gone. I am using PSB as a spritesheet only, without any bones and such.

    Defeats the purpose of PSB if you ask me. It is much easier to render PSD as one PNG image and cut the graphics manually, that way I KNOW that graphics persists. Now I am stuck with PSB that I can not modify at all.

    EDIT:

    I fixed it. In import settings, the "Layer mapping" parameter was set to "layer ID", I set it to "Layer name" and marked the "reslice" checkbox.
     
    Last edited: Apr 2, 2023
    yeoneuik and Leo-Yaik like this.