Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

Unity 2D Animation is out of preview for 2019.3

Discussion in '2D' started by rustum, Jan 30, 2020.

Thread Status:
Not open for further replies.
  1. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    573
    Hello @EvOne,
    It seems you have the project setup in the correct way. It could be that the preview 2D Animation package for 2021 didn't make it into the beta version that you are using. I'll pull down the same version just to verify what went wrong there.
    In the meantime, you can follow these steps to manually bump the package version. Do note for anyone else who would like to manually update the package version, that 2D Animation 6.x requires Unity 2021.1.

    1. Open the Packages folder in your Unity Project
    2. Open the manifest.json file
    3. Update the following lines:
    "com.unity.2d.animation": "5.0.4",
    "com.unity.2d.psdimporter": "4.0.2",
    to
    "com.unity.2d.animation": "6.0.0-pre.2",
    "com.unity.2d.psdimporter": "5.0.0-pre.2",

    Give that a go @EvOne, and I'll get back to you once I've tested out the same editor version you are using.
     
    EvOne likes this.
  2. EvOne

    EvOne

    Joined:
    Jan 29, 2016
    Posts:
    150
    Thank You!:)

    i updated the package and everything started fine, the PSB files processed in earlier versions of the package were re-imported, everything works.

    Ok, I'm trying to import from scratch...

    But ... I don't understand ...
    -In my old files I did not see the "single identifier" - "Sprite Key hash", that you discussed above
    "Сategories" and "Labels" are still visible there
    -And the library component shows them and the spriteswapper changes, but ...

    -How to set all this with the newly imported PSB-file, considering the changes?

    from changelog:
    "[6.0.0-pre.1] - 2020-11-02

    Changed

    • Sprite Swap related features moved out of experimental namespace
    • Removed editing of Sprite Swap feature in Skinning Module
    • Updated Sprite Swap workflow focusing on Project Window and Inspector "
    Ok... see an opportunity to create a SpriteLibrary, add a Category, give it a name
    add Entry point... wait ...
    Wait...
    Previously, this could be done by selecting the "Convert Group / Layer to Category" item from context menu, _automatically_
    but now?

    Is it really just to manually name the Сategories and distribute sprites to the desired fields? 0_o
    ALL these variants of sprites that will change, -manually?

    No-no ... This can't be!.. :eek:
    Looking into the documentation ...
    Oh... it looks like it hasn't been updated yet ...
     
    Last edited: Feb 18, 2021
  3. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    573
    So first off, I pulled down the same version you are using @EvOne, to see if I can reproduce the issue with not being able to find the 2D Animation 6.0.0-pre.2 package.
    These are the steps I took:
    1. Create a new project with Unity 2021.1.0b7.1944, using the 2D template
    2. Verify that the new project comes with 2D Animation 5.0.3
    3. Go to the Project Settings > Package Manager and Enable Pre-release packages
    4. Open the Package Manager
    6. Verify that my view in Package Manager is In Project
    7. Find 2D Animation in the list of packages and expand the section
    8. At the top of the list of 2D Animation versions is 2D Animation 6.0.0-pre.2

    Could you walk me through the steps you took when you were unable to see the package?

    Secondly, let's look into the feedback. Although I must say that the format is a bit tricky to read, so let me know if I missed anything.

    The previous code path is still in the package, so going from 2D Animation 5.x to 6.x will not break your animation clips. Any new animation clips created in 6.x will use the Sprite Key Hash instead of Category and Label.

    Not sure what you mean, could you elaborate?

    Yes, this context menu is no longer available in 6.x. We want to unify the SpriteLibrary workflow between .psb files and other image files. The context menu was only available for .psb files, which caused confusion. Any feedback on how you would like to see this workflow is appreciated.

    We are currently working on updating the documentation for 6.x, and it will be available in a future update. What information where you looking to find in the documentation?

    Thanks again for testing the package out and giving us feedback, this helps us creating a better package.
     
    EvOne likes this.
  4. EvOne

    EvOne

    Joined:
    Jan 29, 2016
    Posts:
    150
    I beg your pardon - English is not my native language, and relying entirely on Google translate - as you can see, leads to misunderstandings. :oops:
    I will try to describe everything in detail and formulate it as correctly as possible.
    But it will take a little time ...

    Thank you for your participation!:)
     
    Ted_Wikman likes this.
  5. alexlamar

    alexlamar

    Joined:
    Jan 16, 2014
    Posts:
    5
    @Ted_Wikman,
    Thanks for pointing me to the RuntimeSwap example! The SpriteLibrary.AddOverride API works great, and I've been able to successfully restructure around it.

    While I'm here -- I know there's been talk about bringing in SpriteSwap support for sprites with different bone hierarchies. Is that something that's on the roadmap? I just wanted to echo how useful it would be to be able to swap in different components with fundamentally different structures (i.e. a cape for a set of wings, as a contrived example) using a native interface.
     
  6. ErdTod

    ErdTod

    Joined:
    Jan 7, 2018
    Posts:
    11
    How is 2D Animation package "is ready for use" if it's performance is ass (like, a lot of ass) without an experimental package that isn't even listed when you enable experimental packages and you have to reference it with a direct link, and then it still doesn't work?.. </end angry forum post>
     
    EvOne likes this.
  7. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    573
    @alexlamar awesome that the RuntimeSwap example could be of help!

    For your second question, in 2D Animation 6.0.0, we have added the ability to toggle an auto rebind action in the SpriteSkin. This action will trigger the SpriteSkin to try to find and rebind the bones that a new Sprite is requiring. Note that the transforms has to already exist in the GameObjects hierarchy for this to work. It will not create new transforms if the transforms cannot be found.
    You can read a bit more here: https://docs.unity3d.com/Packages/com.unity.2d.animation@6.0/manual/SLAsset.html#auto-rebind
    and let us know if you have any questions!
     
    EvOne likes this.
  8. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    573
    Hello @ErdTod,
    If you would like us to act on your feedback, do provide some actual data on the issues you are experiencing. Without it, it is only a rant post.
    Thanks.
     
  9. ErdTod

    ErdTod

    Joined:
    Jan 7, 2018
    Posts:
    11
    Nope, I just wanted to make an angry forum post at the moment of emotional frustration. No constructive feedback yet!
     
  10. Leo-Yaik

    Leo-Yaik

    Unity Technologies

    Joined:
    Aug 13, 2014
    Posts:
    373
    You will need to enable pre-release packages in the Project settings -> package manager
    upload_2021-3-1_13-55-31.png
     
    EvOne likes this.
  11. indie6

    indie6

    Joined:
    Dec 15, 2012
    Posts:
    76
    Hi!

    Is there a way to automate "bone creation" and "auto geometry" via scripting? I want to create bones with exact length and distance from other bones, which is impossible to do with a mouse manually
     
    Last edited: Mar 21, 2021
    EvOne likes this.
  12. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    573
    Hello @indie6,
    Currently there is no convenient way to update the Sprite's bone or mesh meta data. The only way to do it would be for you to create your own authoring module (See SpritePostProcess.cs if you are interested).

    If we could improve on the bone creation experience so that you could set the position, rotation and length of the bones, would that solve your issue?
    And what problem would you like to solve by being able to trigger the mesh generation from code?
     
  13. indie6

    indie6

    Joined:
    Dec 15, 2012
    Posts:
    76
    Thanks I'll check the SpritePostProcess script

    For improvement, it would be great if you can add some snapping functionality for rotation and length of bones. For e.g rotating at 15, 30, 45 degree

    I have different circular sprites with different sizes and I want them to have
    - bones with an exact difference of 45 degree
    - bones with exact same length for each sprite

    Thanks and have a nice day!
     
  14. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    573
    Great, thanks for the feedback!
     
  15. Leo-Yaik

    Leo-Yaik

    Unity Technologies

    Joined:
    Aug 13, 2014
    Posts:
    373
    Hi, could we get a sample project to take a look?

    It sounds familiar and might be something we already fixed. Would it possible for you to try it on the LTS version 19.4 with the latest packages?
     
  16. SaltwaterAssembly

    SaltwaterAssembly

    Joined:
    Mar 8, 2016
    Posts:
    95
    Getting this error when we downgraded unity from 2021 to 2020:
    upload_2021-4-21_11-2-12.png

    Can't seem to resolve this, please help.
     
  17. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    573
    @SaltwaterAssembly it is in general never safe to downgrade Unity projects to an older version. You could try to remove the .meta files and let Unity re-generate those files. But be aware that your edited data will be lost.
    What is the reason for the downgrade in the first place?
     
  18. DepreCats

    DepreCats

    Joined:
    Jun 3, 2016
    Posts:
    39
    Can you allow a certain padding size for reslicing, because otherwise there will be sharp edges when mipmapping, which will introduce unnecessary aliasing.
    Exaggerated effect: upload_2021-4-23_13-42-24.png

    upload_2021-4-23_13-57-53.png



    Also can you add a toggle in the PSDImporter editor to always use the name matching layer id validation? Adding the line
    useOldID = true;
    and saving (then after Unity reverted the file, saving the change again to keep it temporarily) meant that I could add a layer in Affinity Designer without breaking the skinning data:
    upload_2021-4-23_14-5-16.png
     
    EvOne likes this.
  19. PrecisionCats

    PrecisionCats

    Joined:
    Nov 19, 2017
    Posts:
    33
    I wanted to tint specific parts of a character, so I made this to easily transfer skin data from one sprite to another. There are 2 modes:
    • Copy all the data over
    • Similar to Blender's Data Transfer modifier using nearest-face-interpolated: replace each vertex's bone weights with the nearest bone weights in the source sprite.
    It should also be able to transfer skin data across files.

    I think it might be useful for you guys:
    https://github.com/Steffenvy/Sprite-Skin-Transfer

    upload_2021-4-23_23-38-10.png
     
  20. PrecisionCats

    PrecisionCats

    Joined:
    Nov 19, 2017
    Posts:
    33
    Do you plan to implement the 2D equivalent of dual quaternion skinning?
     
  21. MarekUnity

    MarekUnity

    Unity Technologies

    Joined:
    Jan 6, 2017
    Posts:
    80
    @PrecisionCats
    Currently we only support LBS, and don't have dual quaternion skinning on our roadmap. It's a very interesting technique though. Are you looking forward to this kind of skinning in 2D?
     
  22. hawken

    hawken

    Joined:
    Aug 22, 2013
    Posts:
    650
    I find the skinning UI a bit daunting. I'm used to complex animation ui's in 3d software, but when we enter the unity skinning editor, you can't click on any of the sprites, and each icon requires a rollover hover to see what it does, even so with no sprite selected on the sprite sheet, it seems no buttons do anything.

    It's not very user friendly.

    Actually I found the version from a few iterations ago with all the options as text was much more user friendly.

    Even so, the default state is no sprites can be clicked. Feels like it is broken, but one needs to click random buttons to make things spring to life. Would appreciate this being far more verbose in UX, minimalistic has it's place and maybe in a complex animation interface minimalism isn't required.
    Screen Shot 2021-04-27 at 0.10.12.png
     
    EvOne likes this.
  23. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    573
    Hello @hawken,
    Thank you for the feedback, we will capture it for future UX improvements of the skinning editor.
    If you press shift + ` you can switch between icon mode and text mode in the skinning editor. (Link to documentation)
     
    hawken likes this.
  24. hawken

    hawken

    Joined:
    Aug 22, 2013
    Posts:
    650
    Ah ok that explains a lot thanks! Maybe the interface needs an expand button to do the same command? I can't actually do shift + ` on my keyboard, as ` requires shift as it's on the same key as @ (SHIFT-JIS keyboard) - we can't activate text mode on non-us keyboards.
    Screen Shot 2021-04-27 at 13.22.18.png

    (I was able to reassign in shortcuts though :) )
     
    Last edited: Apr 27, 2021
  25. hawken

    hawken

    Joined:
    Aug 22, 2013
    Posts:
    650
    Non-character question;

    Is it possible to assign bones to multiple sprites on the same sprite sheet for different purposes? Like a bunch of trees for example? 3 trees on 1 sprite sheet with their own bones or do they need to be on separate sprite sheets each? I'm trying this and not having much luck.
     
  26. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    573
    Good piece of feedback, thanks! I'm happy that you managed to resolve the issue by re-assigning the shortcut as well.

    Sorry, I dont follow. Could you elaborate?
     
  27. bearcoree

    bearcoree

    Joined:
    Mar 8, 2016
    Posts:
    44
    If you give them different root bones and they're separate layers in photoshop, you should be good to go.
     
    Ted_Wikman likes this.
  28. hawken

    hawken

    Joined:
    Aug 22, 2013
    Posts:
    650
    cc @Ted_Wikman

    Looks like it's fine, I just needed to double click on the sprites!
     
    bearcoree and Ted_Wikman like this.
  29. HuldaGnodima

    HuldaGnodima

    Joined:
    Oct 10, 2016
    Posts:
    95
    I think I have found a bug with the Sprite Resolver.

    This is what happens, I'm using Unity 2020.3.20f1 (+ latest 2DAnimation package):

    1. Manual sprite swap works fine:
    If you change a Sprite Resolver label manually (via editor-clicks) during runtime, the sprite is updated like so:

    (Here you can see me swapping leg-outlines on this creature, and it's working nicely).

    2. Sprite swap via script doesn't update sprite visually:
    If you swap a Sprite Resolver Label via script during runtime, the Sprite Resolver will show that the new label is active, but it won't show up in the actual game, see this example:



    (Here I've made a script that swaps to the "straight" leg-style at Start().
    You can see the leg Sprite Resolver highlights as if the straight one is indeed active after the script is run, but what is shown in the game is the other more dog-like leg-style (as if the swap never happened)). In other words the Sprite Resolver did not update the sprite in game.)


    For some reason changing a Sprite-resolver label via script won't update. Does anyone else have this problem, and knows how to fix it?
    I'm thinking that it might be best if I report this as an official bug.

    Thanks in advance!

    Edit: I filed an official bug-report, you can find the link here:
    https://fogbugz.unity3d.com/default.asp?1339554_016fr9mcm2gk6qml :)
    if anyone knows a temp-fix I would love to know it!
     
    Last edited: May 30, 2021
  30. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    573
    Hello @HuldaGnodima
    I had a look at your fogbugz ticket. It seems like you are using an invalid label that does not exist in your Sprite Library Asset.


    To validate, I created this script and attached it to one of the legs of the puppy, and in playmode pressed space to swap the sprite, which worked as intended.
    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.Experimental.U2D.Animation;
    3.  
    4. public class MyTestScript : MonoBehaviour
    5. {
    6.     static readonly string k_Category = "Leg_F_L_Lines";
    7.     static readonly string[] k_Labels = new[]
    8.     {
    9.         "Ljumix",
    10.         "Tootlet"
    11.     };
    12.    
    13.     SpriteResolver m_Resolver;
    14.     int m_LabelIndex = 0;
    15.  
    16.     void Start()
    17.     {
    18.         m_Resolver = GetComponent<SpriteResolver>();
    19.     }
    20.  
    21.     void Update()
    22.     {
    23.         if (Input.GetKeyDown(KeyCode.Space))
    24.         {
    25.             m_LabelIndex = (m_LabelIndex + 1) % k_Labels.Length;
    26.             m_Resolver.SetCategoryAndLabel(k_Category, k_Labels[m_LabelIndex]);
    27.         }
    28.     }
    29. }
    30.  
     
    APSchmidt, HuldaGnodima and EvOne like this.
  31. HuldaGnodima

    HuldaGnodima

    Joined:
    Oct 10, 2016
    Posts:
    95
    Hello Ted,

    Thank you so much for your quick and detailed reply! I feel embarassed that I reported a bug that was just an error in my code. I apologize for this.

    You were absolutely right, as soon as I swapped the string it works just as intended.


    I think part of why I didn't notice that my code was wrong was because there was no warning message when I used the wrong string. If something like "The label does not exist" popped up in the Console I think I may have spotted it.
    Also I think another part is that in the editor (probably going back to the default sprite) the "Tootlet" label became highlighted, along with its sprite, so it looked like it had worked. This seems like it was just bad luck because I only have 2 sprites, and was trying to change to the first one.


    This mistake/issue may not be common enough to consider adding a warning-message, but I just wanted to share how I missed it in case it's helpful! Adding a warning to make it explicit that an "error" is occurring could possibly alert users.

    Again, I'm so grateful for your help. Thank you so much.
    I'm sorry I reported the bug when it was my own mistake!

    Hope you have a wonderful day! :)
    Hulda
     
    Last edited: May 31, 2021
  32. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    573
    Hello again Hulda,
    No worries, it happens to the best of us! I'm happy that you managed to resolve your issue.

    Re: wrongly highlighted label when the resolver fails, let me check this one. If the Sprite Resolver fails to resolve, the UI should not update and it should stay on the previously selected label. If it doesn't, I would consider this a bug that we should fix.

    Re: warning, I'm not sure about introducing a warning when the Sprite Resolver fails to resolve a string, since it might clutter the console. I do think though that we could introduce a bool as the return type of
    SetCategoryAndLabel
    , so that we can check if we managed to resolve it correctly. Let me bring this back to the team for further discussion, but I think some way of checking that it didn't resolve properly would be good.

    Thank you for the feedback and have a great day over there!
     
    HuldaGnodima likes this.
  33. HuldaGnodima

    HuldaGnodima

    Joined:
    Oct 10, 2016
    Posts:
    95
    Those are some excellent points!

    And indeed that was the thing that made me think it was a bug (that the editor had highlighted the "Label" category and the Sprite corresponding to "Tootlet" in the "Sprite Resolver" script, but these weren't shown in game). You can see it happening in the video I uploaded above (screenshot below):


    Here the dog-like leg is active, but the script shows the straight "Tootlet" leg + highlights the "Tootlet"-sprite as active after the wrong string was passed.

    Running the script with the bad string in the project I uploaded (in the bug-report) should replicate this happening.

    It seems the Sprite Resolver just automatically highlights the "first" option in the Sprite-library if it can't resolve a string? And that the highlight then doesn't update/match what is shown in game? If this behaviour was tweaked (maybe highlights matched what's shown in game for example) I think that would help!

    Also the bool-idea I think also sounds so useful for debugging-purposes (among others applications).

    Thanks again : ) I have a lot of love for this asset!
    Hulda
     
    Last edited: May 31, 2021
  34. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    573
    I see, yes, that feels buggy and we should for sure fix that. Thanks for highlighting it!

    Thanks for your kind words, we are happy that you enjoy the tools!
     
    HuldaGnodima likes this.
  35. HuldaGnodima

    HuldaGnodima

    Joined:
    Oct 10, 2016
    Posts:
    95
    Should I make a new bug-report that more specifically points to that behaviour?
    If it'd be helpful I'll be happy to do so :)
     
  36. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    573
    I have already created a ticket internally for this issue, but thanks!
    We are currently looking into it and will hopefully have a fix in the next version of 2D Animation. :)
     
    HuldaGnodima likes this.
  37. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    573
    bearcoree and HuldaGnodima like this.
  38. HuldaGnodima

    HuldaGnodima

    Joined:
    Oct 10, 2016
    Posts:
    95
    Thanks for putting in a fix so quickly and for informing me, that's awesome!
    The Sprite Swap is such an awesome tool. I'm very happy that I had a part (even though it was a very tiny part) in finding a bug so it could be fixed :)

    Have a great weekend!
     
    Ted_Wikman likes this.
  39. rustum

    rustum

    Unity Technologies

    Joined:
    Feb 14, 2015
    Posts:
    164
    Greetings 2D Animation enthusiasts! Thank you for all the feedback and discussions.

    2D Animation 7.0 is now available with Unity 2021.2 beta! :)

    It seems like a good time to do a little housekeeping, therefore I'm closing this thread, but let's keep talking in the following areas:

    Let's move the discussion for the current release (2D Animation 6.0 in Unity 2021.1) here:
    https://forum.unity.com/threads/2d-animation-6-0-released-for-unity-2021-1.1107548/

    And let's continue the discussion for the 2D Animation 7.0 Release Candidate in Unity 2021.2 beta here:
    https://forum.unity.com/threads/2d-animation-7-0-for-unity-2021-2-beta.1139623/

    Also, feel free to start a new thread if there are specific topics you'd like to highlight or discuss!

    Keep the feedback coming!
     
Thread Status:
Not open for further replies.
unityunity