Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Sprite asset library setup removed from 2D Animation (Skinning editor) 6.x - How to setup now?

Discussion in '2D Experimental Preview' started by herra_lehtiniemi, Apr 23, 2021.

  1. herra_lehtiniemi

    herra_lehtiniemi

    Joined:
    Feb 12, 2017
    Posts:
    133
    What is the intended workflow for converting an importer rig to Sprite Resolver in the new 2D animation package 6? It was very straightforward, when Sprite Library setup was in the Skinning editor and could be done directly in the rigging phase.

    The problem is that the rig importer imports all variations for example for an "Eye" (see attachment) as separate GameObjects, where as the Sprite Resolver expects there to be one GameObject for Eye with one Resolver that swaps sprites.

    How can I convert an imported PSB character structure to be compatible with Sprite Resolver? I did read the manual and can setup Sprite Asset Library and Resolvers, but the problem is that after rigging a character, I have all for example Eye-variations in separate GameObjects and all of the objects have their Sprite Skin component.

    I understand that the expected format for the Sprite Asset Library would be one single GameObject for all Eye-states with a single Resolver? So how do I "implode" all my objects into one Eye-gameobject?

    Here is how my rig looks after import. It seems there is now more work to get the Sprite swapping working than when the GUI was in the Skinning editor. I found the previous implementation it really easy and quick to use.

    This is how my rig looks after import. How do I go one from here to make my eye-objects into a single Resolver? Do I create a new GameObject with a new SpriteRenderer for the Resolver?

    upload_2021-4-23_16-30-28.png
     
  2. herra_lehtiniemi

    herra_lehtiniemi

    Joined:
    Feb 12, 2017
    Posts:
    133
    @Ted_Wikman Sorry to drag you into this, but I was wondering if you would happen to have any information on how the workflow is now with sprite switching - previously automatically setup by skinning editor. Or in other words - how to manually setup the Sprite Library the same way the Skinning editor did with the previous GUI?
     
  3. herra_lehtiniemi

    herra_lehtiniemi

    Joined:
    Feb 12, 2017
    Posts:
    133
    This is what I'm trying, is this the correct way?

    upload_2021-4-25_11-30-13.png

    In the image above, I have duplicated one of the eye-layers (to get the correct Sprite skin -settings) and have then added a Sprite resolver. Then I have build a Sprite Asset Library so that "Eye L"-category contains each sprite from each layer under the "Eyes L"-object.

    This seems to work so far.

    But I have to say - this is a huge downgrade workflow-wise from how easy it was to setup in the Skinning editor. I'm sure there was a reason for removing it, but still - some alternative way to automate the Sprite Asset Library building would really help, this can easily be hours of work when repeated and constantly altered manually.
     
  4. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    916
    Hello @herra_lehtiniemi,
    It seems you have figured out the way to work with Sprite Swap in Animation 6.x and onwards. You are correct that the Sprite Library Asset now has to be created separately and populated outside of the Skinning Editor.

    For automation, in Animation 6.x and onwards, you can now drag and drop Sprites into the Sprite Library Asset to quickly assign them to existing Categories, or create new Categories. This works with both a single Sprite and multiple Sprites. We are also looking at improving this workflow, so if you have any suggestions on how we could improve the setup of the Sprite Library Asset, do let us know!

    When setting up a new character which contains multiple Sprites used for swapping, you can either unpack the Prefab once dragged into the Scene, or create a new prefab by dragging the character back from the Scene and into the Project view. After one of these steps has been performed, you can then remove any extra Sprite Renderer that is not needed (any extra eyes, mouths etc) and then add the Sprite Resolver on all Sprite Renderers that will be swapping out its Sprite, and a Sprite Library component at the root level.

    I understand that going from the previous setup to the one in Animation 6.x feels less straight forward and requires more steps. We have made this change for a few reasons:
    1. We would like to unify the way a .psb file and any other image files can be worked on. Right now there are two flows, one for if you start off with a .psb file, and another one if you start off with any other image file. This is very confusing, and not ideal. The ideal situation would be to let the users work with an image file while not caring or knowing what the actual file format is.
    2. The UI space inside the visibility tab in the Skinning editor is very small and does not give a good overview once the number of swappable items and categories grows. Moving the Sprite Library Asset out of the Skinning Editor and into its own inspector gives us more space to improve the UX.
    3. When going from one .psb file which contains all the swappable items to multiple .psb files containing swappable items for the same character, the in Skinning Editor flow does not work. Once a user makes the choice to go multiple files, they will experience quite some pain to migrate all the data from the single Sprite Library Asset to one which is used by multiple files. By letting the users start with a Sprite Library Asset not tied to a single file, the transition from one .psb file to multiple has less friction.

    Sprite Swapping in Unity is something we believe in, and we are working on improving it in future versions of 2D Animation. If you have a suggestion on how we can improve the usage for you, do let us know! What is especially useful is if you also pair the suggestion with your current workflow, so we can also learn a bit of how you work/would like to work while iterating over your art.
     
    EvOne likes this.
  5. herra_lehtiniemi

    herra_lehtiniemi

    Joined:
    Feb 12, 2017
    Posts:
    133
    I'll reply with more thoughts when I get back to work tomorrow, but one concern I have at the moment is how well the relation between the original imported model and the prefab created in the scene hold up when the PSB is updated. I dragged the model into the scene and added the Sprite Library and Sprite Resolvers and got the model to work. I then dragged the prefab (without Unpacking) into the Asset folder because the prefab variant will be instantiated in my game, it's not in the Scene from the start. After some changes to the PSB, the prefab variant hadn't updated and not all sprites followed the bones anymore. This is what I would want to avoid: after making the model into a prefab variant, I would need it to keep the connection with the PSB and update all the skinning changes and additions I make (unless I have unpacked it of course). Currently it doesn't seem to update all changes (I'll try to make a repro on this).

    I understand the need to make the product generic enough for all use cases. The good thing in the previous approach (for my use case) was because the changes were made already in the Skinning editor, it wouldn't break the relationship between PSB and prefab so easily.

    So I think this is the most important feature for this kind of character rigging - to maintain the PSB and prefab relationship intact until the very end - even after while adding the Sprite swapping.

    Just as a quick thought, wouldn't it be possible to release the Sprite swapping setup GUI for Skinning editor as a separate package (would act as a Skinning editor plugin)?

    Anyway, I'll get back to this soon and try to come up with suggestions that would work more generally, based on my particular case. Thanks for the quick reply again! :)
     
  6. herra_lehtiniemi

    herra_lehtiniemi

    Joined:
    Feb 12, 2017
    Posts:
    133
    @Ted_Wikman As you asked about the workflows regarding to Sprite swapping, here are some workflow notes and ideas.


    Problem 1: Breaking sprite sheet when re-importing PSB. I'll make a simplified report of this, but here's approximately what I do: I update often the PSB. I even do some restructuring when designing the rig structure. For example rename a layer that was already rigged or remove a complete group of layers from the PSB. This often breaks the auto-imported sprite sheet, making the pre-existing meshes show parts of other sprite layers in a malformed manner. At this point, regenerating the mesh fixes the issue, but it also removes all the weights.

    SUGGESTIONS: At this point it would help that one could regenerate the part of the mesh that broke and is in connection to the sprite sheet, but keep the weights to the bones and vertexes. In other words, not change the vertex structure or the bones, but fix the broken sprite connection.


    Problem 2: Often I want to bind the whole layer to one bone that doesn't necessary overlap the mesh (so I can't just generate the mesh with "Weight" checked because it's not overlapping). Generating the mesh and then applying full weight to single bone are currently done in different tabs so it produces really much mouse miles, having to first generate mesh for selected layer, then switching tab, then choosing a bone, then dragging the weight Amount-slider to 1 (this is the fastest way I've found so far to apply full weight to one bone).

    SUGGESTIONS: I have a huge screen and all the tools are in different tabs. This slows me down really much. I would have enough screen space to have all the tools visible at once (maybe context-sensitive). The screen space seems a bit too preserved at the moment and many of the tools that are used in an alternating manner (well, most of them), are behind a click. This is not so useful. I would gladly see geometry and weight tools all at once if it would save me clicks. But at the minimum, I wish there one a one-click solution to "generate mesh for selected sprite layer and bind it fully to currently selected bone(s)" (contrary to overlapping bones). This would save really much time, to be able to do this in one tab.


    Problem 3: Changing PSB layer names breaks the sprite sheet for other layers as well. Let's say I have a PSB file that has layers with unique file names. I have rigged them and generated meshes for them. If I now remove one of the layers, this sometimes messes up the sprite sheet for the other meshes as well so that the meshes I previously had, contain warped pieces of other layers. I assume this means that the the sprite sheet offsets have changed and mesh points to old locations or something?

    I was under the assumption that if I keep the unique names in the PSB, the meshes would remain intact, but this doesn't seem to be the case. Is there some recommended way of keeping the meshes working when making changes to the PSB? I can make a bug report on this as well and isolate it a bit more, but keeping the layer names intact doesn't seem to be foolproof.

    SUGGESTIONS: This would be an important improvement in the future - to make stuff that's alread rigged break as little as possible. For example, guarantee that if I don't change a layer name in the PSB, it will keep the related mesh working no matter what other changes I do in the PSB-file.

    Problem 4: Fixing Sprite skins after re-rigging. With the new manual Sprite Resolve workflow, I also find myself doing the following:
    * I have dragged the imported character rig model to scene and created a prefab variant
    * I then duplicate for example one of multiple mouth shape layer, add resolver and deactivate the ones imported from the model. This way I end up with one mouth shape game object that has a resolver for swapping sprites.
    * I then change the rigging some how, maybe add a bit different bone weights
    * This makes my current prefab variant break because the previously created resolver object has an obsolete Sprite skin component. I now have to manually copy the new sprite skin component from the original model.

    SUGGESTIONS: I can make a report of this as well. But this is the original problem with removing the automated GUI for Sprite Asset Library from Skinning editor: sprite variations for for example mouth shape are all exported as game objects and sprite resolver uses sprites so this bridging requires manual work and breaks easily. So some kind of bridging here would save a lot of work.
     
    EvOne likes this.
  7. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    916
    Great breakdown of your issues and suggested solution. I really like that you added the outcome you are after and the steps you tend to take. This makes it easier for us to setup a similar scenario and test these steps out ourselves to see how we can improve upon these points.

    Regarding problem 3, would you mind filing a bug report and post the bug ID number here? Then we can take a look.

    Thank you for taking the time to write this all down, I'll store this feedback so that we can use it for future improvements.