Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

PSD Importer 1.2.0 Not Creating Sprite Library/Resolvers

Discussion in '2D Experimental Preview' started by ChubbyPitbull, Oct 19, 2019.

  1. ChubbyPitbull

    ChubbyPitbull

    Joined:
    Apr 4, 2015
    Posts:
    6
    I've been trying out PSD Importer 1.2.0 with Unity 2019.2.6f1 Personal and have really been appreciating the easy splitting of the different layers into a single prefab.

    One feature I was interested in as mentioned here: https://docs.unity3d.com/Packages/com.unity.2d.animation@3.0/manual/SSManual.html is the PSD Importer automatically creating a sprite library and adding a Sprite Resolver to each object for easy sprite swapping during the game. The use case we're looking at is swapping clothing and visual items on a character.

    While I've been able to get the Prefab with the split components when importing the PSB file, one thing I haven't been able to get working was the automatic sprite library/resolver creation. Each object just has a normal sprite renderer and we're having to go to each sprite to manually build the sprite library asset, and add sprite library components and add resolvers, etc to each object. Looking through https://docs.unity3d.com/Packages/c...r@1.2/manual/index.html#name-collision-errors I didn't see any config options that would control this.

    How do I get the PSD importer to handle the auto-creation of sprite libraries and sprite resolvers for PSBs imported using PSD importer?
     
  2. dquek

    dquek

    Unity Technologies

    Joined:
    Apr 17, 2018
    Posts:
    48
    Hi @ChubbyPitbull ,

    The Sprite Library Feature was only added in 2D Animation version: 2.2.0-preview.1 onward.

    Would recommend you to try the latest Packages on 2019.3 to grab the latest changes.
    2D Animation 3.0.5
    2D PSD Importer 2.0.5
     
  3. ChubbyPitbull

    ChubbyPitbull

    Joined:
    Apr 4, 2015
    Posts:
    6
    Previously I had been using 2.20-preview.2

    I installed Unity 2019.3.0b7, and confirmed I now had 2D Animation 3.0.5, and 2D PDF Importer 2.0.5.

    I freshly imported the PSB file, and the result was the same as previously; a prefab with the layers split into objects, each only with a Sprite Render component with the specific sprite. No Sprite Library Assets were created, nor was any Sprite Library Components or Sprite Resolver components.

    I did see numerous warnings in the console on import:
    "File's Layer ID is not unique. Please report to developer. 0 PLAYER SELECT::SQUARE SELECT
    UnityEditor.Experimental.AssetImporters.ScriptedImporter:GenerateAssetData(AssetImportContext)"
    "File's Layer ID is not unique. Please report to developer. 0 Buttons::Remaining Boxing for Layout
    UnityEditor.Experimental.AssetImporters.ScriptedImporter:GenerateAssetData(AssetImportContext)"
    "File's Layer ID is not unique. Please report to developer. 0 Remaining Boxing for Layout::SINGLE INVENTORY BOX
    UnityEditor.Experimental.AssetImporters.ScriptedImporter:GenerateAssetData(AssetImportContext)"
    etc


    Could the lack of Sprite Libraries/Resolvers be a function of some aspect of the PSB file?
     
  4. ed_s

    ed_s

    Unity Technologies

    Joined:
    Apr 17, 2015
    Posts:
    59
    Sorry for the confusion but the functionality of the 2D PSD Importer has changed and the documentation is in the process of being updated to reflect this.

    Starting from 2D PSD Importer version 1.2.0-preview.3, the Sprite Library asset is no longer being created automatically upon importing the PSB file. Instead, the Sprite Library asset will be added to your PSB once you use the Skinning Editor and assign a Category and Label to a sprite.

    The Sprite Library asset that was automatically created in earlier versions of the 2D PSD Importer was empty and not immediately usable so you would still have to go into the Skinning Editor and assign Category/Index to your sprites.
     
    ChubbyPitbull likes this.
  5. ChubbyPitbull

    ChubbyPitbull

    Joined:
    Apr 4, 2015
    Posts:
    6
    Thanks for the info! After reading your post, I did some more Googling and found https://docs.unity3d.com/Packages/com.unity.2d.animation@2.2/manual/EditInter.html

    The PSB importer I had imported originally only showed me the "Bone" category and not a "Sprite" category, so I re-imported the PSB, went straight to the Sprite Editor and then the Skinning Editor, and now my Sprites are listed once I opened the Visibility tab. I was able to assign Categories and Labels and confirm that the Sprite Library/Resolver Assets and Components were being created. Thank you so much!
     
    dquek likes this.