Search Unity

Official 2D Animation 6.0 released for Unity 2021.1

Discussion in '2D' started by rustum, May 10, 2021.

  1. rustum

    rustum

    Unity Technologies

    Joined:
    Feb 14, 2015
    Posts:
    190
    2D Animation 6.0 released for Unity 2021.1

    2D Characters.png

    What’s new?
    With the release of Unity 2021.1, 2D Animation 6.0 has been verified. Here are some of the improvements 2D Animation 6.0 comes with:

    Sprite Swap improvements
    • Sprite Swap is now a part of the general sprite workflow (and not just for skinning within the Sprite Editor for 2D animation).
    • UI for the Sprite Library component has been improved to clearly display Categories and the Labels within them.
    • Sprite Library now supports drag and drop to simplify adding additional Sprites.
    • Make sure to read the section on changing the keyframe tangent to make animation work well for Sprite Swaps.
    Skeleton sharing with 2D PSD Importer
    • The Main Skeleton property allows the user to assign a Skeleton Asset to indicate that the asset will be using a bone hierarchy structure previously setup from another asset.
    • When this property is assigned, the Skinning Module will use the bone hierarchy provided by the reference Skeleton Asset for rigging.
    • If this property is not assigned, a Skeleton Asset will be generated as a sub-asset for the source asset file that can be used later for other assets to reference.
    See the full changelog here.

    About 2D Animation
    The 2D Animation package adds tooling for rigging a sprite for skeletal animation. This package includes a Skinning Editor module in the Sprite Editor window for creating and editing bones, manual & automatic mesh tessellation as well as skin weights generation and painting. The Sprite Skin runtime component ties this all together to drive sprite deformation.

    This also includes support for Multiple Sprite Single Character rigging workflows through 2D PSD Importer Package.

    Getting Started
    In an existing project in Unity 2021.1:
    1. Open Package Manager by going to Window > Package Manager
    2. Select Unity Registry in the Packages drop-down menu.
    3. Choose 2D Animation from the list and click on Install at the bottom right of the Package Manager window. 2D Animation Package.png
    Creating a new project in Unity 2021.1 by selecting the 2D Template in Unity Hub will also install 2D Animation 6.0 by default.

    Explore the Samples
    2D Animation comes with Samples showing the features in action.

    To get the samples:
    1. Open Package Manager by going to Window > Package Manager
    2. Select Unity Registry in the Packages drop-down menu.
    3. Expand the Samples section.
    4. Click the Import button next to the sample you want to import. 2D Animation Samples.png

    What can you do?

    Try it out and let us know what you think of the package. We want to know what works as expected, what doesn’t and what is missing.
     
  2. rustum

    rustum

    Unity Technologies

    Joined:
    Feb 14, 2015
    Posts:
    190
    Additional Information
    Optional Performance Boost
    You can improve the performance of the animated Sprite’s deformation at runtime by installing the Burst and Collections package from the Package Manager. This allows the 2D Animation package to use Burst compilation to speed up Unity’s processing of Sprite mesh deformation.

    The Burst package is visible by default in the Package Manager. To install the Collections package, follow these steps:
    1. Open the Package Manager.
    2. Press the + in the top left corner and select Add package by name...
    3. Input com.unity.collections and press Add.
    Add Package by Name A.png Add Package by Name B.png
    Once these steps are completed the Collections package will be available in the project.

    With both packages installed, the Enable batching setting becomes available in the Sprite Skin component. As the implementation of the performance boost might contain bugs, you may switch back to the previous implementation by clearing the Enable batching option.

    Enable Batching.png

    The package has been tested with Burst version 1.3.3 and Collections version 0.9.0-preview.6.

    Note that if you do not have the required packages installed, the option will be disabled, with a notification to install the required packages.

    Install Burst and Collections.png

    SpriteSkinEntity deprecation
    The SpriteSkinEntity component was introduced in the 2D Animation preview package to leverage the performance provided by Unity’s Entities package. However, since 2D Animation is a verified package, and the Entities package is still in preview, we have decided to drop the support for the time being.

    In 2D Animation 6.0, we have not removed the SpriteSkinEntity component to ensure that older projects that were using the preview version of 2D Animation are able to upgrade successfully without any compile errors. However, if your project is using the SpriteSkinEnity component, you will see the following warning in the console:

    "SpriteSkinEntity will be removed in 2D Animation 7.0"

    If you click the warning message, the GameObject with the SpriteSkinEntity component will be highlighted in the Hierarchy window.

    As stated in the warning message, we will fully remove the SpriteSkinEntity component in 2D Animation 7.0. Make sure to remove the component for a smoother upgrade to future 2D Animation versions.
     
  3. Deleted User

    Deleted User

    Guest

    Installing Collections will install Burst automatically. :)

    Not only is it available but it's also enabled by default after the packages have been installed.
     
    Ted_Wikman likes this.
  4. Deleted User

    Deleted User

    Guest

    Hi,

    I have a request. I recently reworked my textures mainly by reducing their size, making the limbs thinner and so on. On importing the new sprites, it appears that the geometry didn't update automatically in the Skinning Editor, I had to do it manually.

    Is there any possibility we could have an update function that would affect only the outline, respecting the customizations we made to the geometry, once?

    Thanks for the great work anyway !
     
    hidingspot, EvOne and Ted_Wikman like this.
  5. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    916
    Thank you for the feedback and your kind words, @APSchmidt. I'll note this down in list of feedback for future 2D Animation improvements.
     
    Deleted User likes this.
  6. EvOne

    EvOne

    Joined:
    Jan 29, 2016
    Posts:
    173
    "Inconvenient" question about SpriteSwap. Again.

    I (and not only I) - have already asked about it, long ago
    (#383 , #211)
    when the 2D Animation package was still quite small.
    Now he has grown to the 6th version, got a new feature and improvements of old, but ...

    -Why still Sprite Swap still works like this?
    (I really do not understand :D)
    u2021_t01-1.gif

    Despite the "answer" and the closing of the report in FogBugz and "Explanations" about Meshes, Bones and Pivots...

    -Just look - after completing the import of PSB-file, the Importer had ALL information about all Layers - the exact location and size!
    And the 2D Animation package itself, before Sprite Swap - can use this information!
    But it is necessary to include this Sprite Swap - and everything shifts to hell.

    Then how is it offered to use this functionality?
    Does it really need to track the actual size in the pixels drawn on the graphics layer?
    So for all interchangeable parts, this size was the same?

    No, it can not be that you offer something as a real workflow of the artist and an animator!
    -I do not believe...:confused:

    -But then what is the advantage of using the importer in this case?

    The information about ALL the layers and drawings on them - was relevant, but correctly automatically positioned the replaceable parts - it is impossible ... Why?

    (and this is just one of many "why" that appear when trying to work with 2D Animation and PSB Importer)

    P.S. About Reply on FogBugs:
    2021-05-30_11-30-34.png
    "Relative" - yes, for sure.
    And also - the location of all replaceable parts relative to each other and relative to the entire file - also known.
    But this information is lost and not used.
     
    Last edited: May 31, 2021
  7. berdanka

    berdanka

    Joined:
    Sep 29, 2015
    Posts:
    24
    Just upgraded 2D Animation and noticed that Sprite Swap related instruments were removed from Skinning Editor, so I have a few important questions.
    1. What should I do with objects of the same category when I add Sprite Resolver components to game objects inside of a not unpacked prefab? Let's say I have a category "Hat" with 3 sprites, "Red", "Blue", and "Green". I have similar 3 objects inside of a PSB prefab. I add a sprite resolver comp to one of 3 objects, then what should I do with other two objects? Disable them won't brake the prefab, but it creates a lot of visual garbage in a hierarchy window if I have many such objects. I can't delete them without unpacking a prefab. Before 2D Animation was updated it was possible to convert groups into categories and the prefab you get would only contain one game object per category.
    2. What we are supposed to do with manually added Sprite Resolver components when we update a PSB prefab now (reskin, edit layers, reslice, etc)? Will they persist? I did a few tests and it seems they persist when I edit the source, but I learned on my own mistakes that it's better to not add components to objects inside of a PSB prefab if I don't want to lose these components.
    3. I guess there is no simple way to convert folders into Sprite Swap categories with the new workflow?
     
    Last edited: May 31, 2021
    deura and EvOne like this.
  8. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    916
    The issue you are seeing is because you are swapping two Sprites with each other that has different sizes and are not using their pivot points to account for this. We have noticed that this is an issue that some users using the Sprite Swap feature are wrangling with. In 2D Animation 7.x (for Unity 2021.2) we have added a section in the documentation to explain a bit more how you can fix the pivots of your Sprites to create better swaps. I will link it once it is available.

    Regarding us making an auto solution for setting pivot points on import, we have looked into this but currently we haven't found a good solution that works for the general use cases. We have the positions of the pieces in the PSB file, but we do not know by just looking at the positions where the piece want its pivot point. An arm would want it's pivot point closer to the top center position, while a left foot might want its pivot point center left. Currently, we haven't found a good data point we make these assumptions on. It is a feature we would like to have in the solution, but we cannot promise if/when we can deliver it.

    While you wait, there are ways to create great looking swaps:
    - Tweak the pivot per Sprite so that all the Sprites that are going to swap end up on the same location.
    - Show/Hide GameObjects with the different SpriteRenderers and Sprites to "Sprite Swap".
    - Generate a mesh and skin the Sprites to a bone inside the Skinning editor.
     
    Deleted User likes this.
  9. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    916
    1. You can either unpack the prefab and update it to the hierarchy you would like to work with, or create one .PSB per outfit, so you would have MyCharacter_Green.psb, MyCharacter_Blue.psb, etc. The nice thing with using multiple files is that you allow yourself to only load in the assets you need, rather than having all of the customisations in one big file that has to be kept in memory at all times.

    2. The .psb file in Unity can be seen as a "view" into the file. If you drag the .psb file into your scene, add components onto one of the GameObject children and then remove that child inside Photoshop, the GameObject will then disappear in Unity. My advice is to create a prefab using the .psb file, and then add your components in that prefab to make sure its structure will stay intact while you iterate.

    3. Not whole folders, but you can select multiple Sprites and drop them into a Sprite Library Asset to quickly populate a category or create multiple categories with the selection.

    And now a question for you @berdanka, how would you like to work with the tools? How does your pipeline look like and are there any places we could improve the tooling to streamline your process?
     
  10. berdanka

    berdanka

    Joined:
    Sep 29, 2015
    Posts:
    24
    1. create one .PSB per outfit works well when your problem is just outfits. What about frame animations? Let's say I have 10 eyes, and 5 mouths, and 6 different hands. Creating a PSB per every state of every body part is just... not the best option.
    2. Yeah, I store my components 'outside' now.
    3. I can live with that. But please, let us reset groups converted into categories in a previous version of package. All my old PSBs stuck with undeletable Sprite Library Assets now, and child objects stuck with Sprite Resolvers.
    Well, my workflow is mostly dictated by tools I have at my disposal. I just trying to minimize using of external software. I hate baking animations and for awhile I used Spine for rigging and animating my rig in Unity later. It was pure hell. If it isn't simple to make edits to a source file with 2D Animation package, you can imagine how hard it was with Spine and its runtime. Now I can work mainly in Unity and explore new options. First time I studied Anima 2D, I really enjoyed Unity chan demo. Since then, I started using complicated rigs with physics, transforms that deform rig's scale by inertia, etc. Most of all, I wish the Unity team would think of their end users as maniacs who create rigs with 100 sprite layers or more. As anyone, I prefer batching to manual work. And I prefer PSB metadata to be foolproof and package-upgrade-proof. Losing a huge rig of bindings is just straight painful.
    • Please give us a way to edit PSB layers names in Skinning Editor. Expecting you (or your artist) can name everything right from the beginning is too much. And, when mapping is done by layer names, you can't just edit the source without suffering.
    • Let us to flag layers we want to see converted into game objects inside of a PSB prefab. Please? It's going to solve the visual garbage problem. All rigged layers are still going to be available for Sprite Swap workflow, but only those layers you marked as visible should get to the scene when prefab is instantiated.
    • Consider resetting the Reslice toggle to false in PSB importer after reslice is performed. It gives me anxiety every time I see it ON after changes were applied already.
    • Please give us an option to decide how much we want to trim our sprites in PSD importer. It doesn't matter how much you extrude your edges, automatic slicer will always trim sprites. Edges around sprites in atlas are not only good against bleeding, sometimes you want to create vertex outside of visible sprite, but sprite bounds won't let you do so. Sure I can edit sprite bounds manually just to be overwritten again after reslicing.
    • Binded vertexes could show pie charts (optionally) when you edit weights.
    • Auto Geometry outline detail 0 is still too detailed. Sometimes you have just one bone per mesh and auto geometry creates tons of vertexes when it's cheaper to have just two or four triangles. I don't use Burst and in my case every additional vertex costs me FPS. Even if most of them are bind to one bone. It'd be great If you could give us a way to limit a total vertex count for Auto Geometry generator.
    • I wish I could have FFDs to speed up my workflow. Instead of binding 999 version of different eyes and mouths I can parent them to a rigged FFD mesh named 'Head' and forget about their existence. The easiest way to implement them is... to let us create empty meshes without sprites or convert PSD groups into such meshes. Every child mesh can be binded to its parent, maybe optionally. FFDs should be controlled by bones, potentially by pins, and vertexes.
    • I also want something like a rotation weight slider for bones. A way to limit bones' influence to movement only, without rotation. Or with some amount of it. The reason is that when you animate a bone, sometimes you get unwanted deformations depending on how far influenced vertexes located from the animated bone. A small rotation of a bone can result in far away vertexes moving trough the whole screen. Well, I can combat it with hacks to a degree.
    • I also wish we could have pins. Pins are basically... same bones but with weighted tangents controlling how straight the bone connection is. Having option to decide if bone's connection should be linear or curved will be a big help for artists.
    That's what comes to my mind first and what is related to 2D animation package and PSB importer.
     
    Celezt, deura and EvOne like this.
  11. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    916
    Thank you @berdanka for giving us all this feedback. I especially enjoy feedback where we also get to know why a certain change is needed and what it will improve. I have shared this with the 2D team and we will use this feedback as one of the data points to improve future 2D releases.

    One thing I am curious about is your reasoning behind not using Burst in your project. Have you had any bad experiences using it previously?
     
  12. berdanka

    berdanka

    Joined:
    Sep 29, 2015
    Posts:
    24
    I tried to install it once when I still used Unity 2020 or may be even 2019, but it didn't work. I had some errors which content I can't remember and I decided to wait for awhile.
    Thanks to your comment I just did installed Burst and Collections successfully. I should say it really improved the performance of rigs. The more characters I have rendered at the same time the more effective it is. I got about +40 FPS for spending 2 minutes. Thank you. Now I probably can stop wasting my time on editing meshes for every small thing.
     
    EvOne and Deleted User like this.
  13. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    916
    Great, thank you for trying it out. We are looking at making Burst and Collection a mandatory dependency in a future version of 2D Animation, so we are very interested in hearing if any devs have issues/reasons not to use it, so we can fix those issues before rolling it out to everyone.
     
  14. Deleted User

    Deleted User

    Guest

    I was about to ask for this. :)
     
    Ted_Wikman likes this.
  15. jehk27

    jehk27

    Joined:
    Mar 23, 2013
    Posts:
    16
    I only use the 2D animation package for the sprite swap features. What would I need burst or collections for? I'd rather not take on those dependencies not necessary.

    But I have a question related to the Sprite Resolver and Blend Trees. Is there anyway to have 2d blend tree only use the animation node with the highest weight so it doesn't interpolate the sprite key variable?

    upload_2021-6-6_8-59-10.png

    I have some ideas on how to fix this code wise where I pass in animator parameter values that perfectly align to the x and y positions for each motion as seen above. Can anyone think of any alternatives. Maybe some flag that can be passed to a blend tree of animator. Maybe some way to change the weighting system used in blending between nodes?

    Thanks!
     
    Last edited: Jun 6, 2021
    EvOne likes this.
  16. jehk27

    jehk27

    Joined:
    Mar 23, 2013
    Posts:
    16
    Also I'm getting this warning. Not a huge deal but having Unity generated warnings is super annoying.

    No script asset for SpriteLibCombineCache. Check that the definition is in a file of the same name.
     
  17. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    916
    Hello @jehk27
    Collections and Burst will speed up sprite deformation, but will not do anything to your Sprite Swaps, so you can leave those packages out if you do not wish to have them in your project.

    Unfortunately, you cannot in the current versions of 2D Animation. This is a high priority ticket item that we are looking into and hoping to solve in a future version of 2D Animation.

    Solving your issue in code instead of in the animator will most likely be the "cleanest" solution. But you could also solve it in the blend tree. Since the issue is the blend between two states, you could add additional states to make the blend area as small as possible. In a 1D blend it would look something like this:
    Weight 0: Clip 0
    Weight 0.24: Clip 0
    Weight 0.25: Clip 1
    Weight 0.49 Clip 1
    Weight 0.50 Clip 2
    ....
    and so on.

    Thanks for the heads up. We have a fix for this issue in the next version of 2D Animation.
     
    Deleted User and jehk27 like this.
  18. jehk27

    jehk27

    Joined:
    Mar 23, 2013
    Posts:
    16
    So they are optional packages that, when installed, will yield performance benefits for sprite deformation?

    Cool. Good to hear. Animating the sprite key took a bit of getting used to. The closer the workflow is to animating sprites the better. Having said that its really not a big deal once I read over the docs explaining the workflow.

    It ended up being pretty easy to solve in code. I'll play around with this this idea a bit though.

    Also, thanks for the work on the sprite swap functionality. It's seriously going to save us a ton of time. You rock.
     
  19. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    916
    Correct, with those packages we can burst compile the deformation methods and run the deformation threaded instead of on the main thread.

    Great to hear that you managed to solve your issues, and thank you for your kind words!
    Let us know if you encounter any other issues, and if you have any ideas on how we can improve the current 2D toolset, do let us know here.

    Happy devving!
     
  20. berdanka

    berdanka

    Joined:
    Sep 29, 2015
    Posts:
    24
    Can we have an extra solver for IKManager2D which is a simple Controller that only controls one bone (effector)? Its position + rotation + scale to be precise.
    We're able to animate any bone directly, so why we need a solver for that? The reason is simple. Bone structure is ever changing and unreliable because animator depends on object's paths to find animated properties. For example, once I move leg bones from 'torso_1' to 'pelvis', animation stops working. Once I rename any bone it also brakes everything. The more complex your bones structure the more you suffer. Different paths of animated properties also the cause of visual confusion for me during animation. It would be nice to have all animated objects in one place. My solvers are stored like that, but I don't really need inverse kinematics to control every bone.
    Most of other mesh animation programs and assets are featuring such controllers, they indicate them by square gizmos.
    I've attempted to add my own solver for that by extending from the class Solver2D, but it won't show up as a new solver under the solver menu no matter what I do so I gave up trying. Currently I have a simple script that is copying transform values for me, but it doesn't work in editor well because it conflicts with IKManager2D. Undos and default pose restoring is problematic.
     
    EvOne likes this.
  21. berdanka

    berdanka

    Joined:
    Sep 29, 2015
    Posts:
    24
    Controllers Illustration.png
    I drew a simple illustration of what I mean.
    Bonus points for ability to chose between override mode and inherit mode. Extra bonus points for choosing which transform property controller is going to override (position, rotation, scale).
     
    Last edited: Jun 12, 2021
    EvOne likes this.
  22. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    916
    Thanks for the feedback @berdanka
    It seems like the main source of pain comes from the animation system using the (string) path when storing the key information in a clip. Your feedback is valid, and is something we should look into closer.

    In the meantime, there are ways to make this flow a bit better without any changes to the editor:

    1. Rename animated objects in a clip
    In the Animation window, you can select an object on the left side and press enter to rename the object. Once the path and object name is valid, it will connect with the new hierarchy.



    2. Constraints components
    We have a few constraints components in Unity that can do what you are looking for, but "backwards". You can place a Positions Constraint component onto an object and select its target. This object will now follow the selected target when the selected target is moving.

    Finally, you mention that you tried to extend Solver2D, if you still have your implementation, do share so we can see if we need to update the documentation/API to improve this.
     
  23. berdanka

    berdanka

    Joined:
    Sep 29, 2015
    Posts:
    24
    I know we can edit animated properties' names in the Animation window. Though I don't think it's easier than to edit the animation files directly in any text editor of your choice. Especially when you have to edit many properties at once.
    Yeah, it's useful, but you can't reset pose easily with constraints components. The problem is not how to manipulate bones with something outside of rig prefab, but how to befriend your solution with IKManager2D.
    Last, I don't have a code to show, but my problem was that IKManager2D was ignoring my class for some reason. I did a test by fully copying the Limb class and renaming a few parts, but nothing. A simple code example of extending Solver2D would help a lot.
    Anyway, thanks for always helping.
     
    EvOne and Ted_Wikman like this.
  24. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    916
    Thanks for clarifying your need. I tested the Solver2D flow which we describe in our 2D Animation package manual, and got the same issue you experienced. I have created an internal bug report for this so we can fix this issue. Thank you for highlight this.
    Once fixed, I agree that having some IK examples would be good. The documentation page is a bit sparse when it comes to custom solver implementations.
     
    berdanka and Deleted User like this.
  25. deura

    deura

    Joined:
    Jun 7, 2018
    Posts:
    4
    Hello, can I ask a question?

    When I use 2D Animation 6.0.3, Sprite Library Asset is not created automatically. Is there a way to create Sprite Library Asset manually?

    Status:
    Install Unity 2021 1.11 f1 in Windows 10 environment.
    → Import PSB using 2D PSD Importer 5.0.3.
    → Edited with Skining Editor of 2D Animation 6.0.3. Bone, mesh , and weights work fine. Visibility > Sprite doesn't have the ability to set categories and can't be tagged.
    → Apply in Skining Editor.
    → Sprite Library Asset was not created.
    → Place the PSB Prefab in the scene and manually set the Sprite Library and Sprite Resolver.
    → Sprite Library Asset is left blank.

    Due to the above situation of Sprite Library Asset, I cannot prepare the asset to replace.

    Also, the imported PSB data cannot be overwritten on Unity, so data that is not easy to use will be created.
    When I manually create the Sprite Library, it's full of plus marks.
    When I manually add the sprite resolver, the layers aren't automatically grouped like in previous versions, leaving some layers that I want to hide.
    (I think it is very important for work efficiency to be able to modify the PSB Prefab while keeping the package.)

    The new category setting method is easy to understand, but I would like you to keep the function of setting categories in Skining Editor and the function of grouping layers in Sprite Resolver.

    I'm using Google Translate. I'm sorry if it's hard to understand.
    Thank you for your cooperation.
     
  26. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    916
    Hello @deura,
    Correct, we have removed the creation of Sprite Library Assets from the Skinning editor in 2D Animation 6.x / PSD Importer 5.x (Unity 2021.1). We have done this to unify the way Sprite Library Assets are created and worked with, no matter the starting file type. This change also encourages using multiple image files to create your Sprite Library Assets, rather than trying to fit everything into one PSB file.

    Please see our Sprite Library Asset chapter in the 2D Animation documentation on instructions on how to create and work with Sprite Library Assets. Also see our Sprite Swap samples, to see how you can work with Sprite Swap in your project.

    Once you have gone through our documentation and Samples, do let us know your feedback on how we could improve Sprite Swap for future versions of 2D Animation. A great way to let us know how the current flow is failing you is to walk us through your workflow and point out areas that prevents you from reaching your outcome/causes you to lose valuable time.
     
    deura likes this.
  27. hidingspot

    hidingspot

    Joined:
    Apr 27, 2011
    Posts:
    87
    I'd also love for this to be implemented. We're wanting to make our character sprites a bit bigger (increase their resolution since we are now zooming in the camera at times), but it breaks all of the rigging we've done. It would be an infeasable amount of work for us to go through and re-rig, and even more time consuming re-weight the geometry for all of our characters.

    That being said, do you have any tips on how to achieve this? Or any tips on where I can look in the code or even in the .meta files to be able to resize the rigs and weightings programmatically?
     
  28. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    916
    Thanks for the feedback @hidingspot
    Are you working in .PSBs or any other texture format?

    Would lowering the Pixels per Unit value help you in any way with your issue? This would size up the art, but it might cause the Sprite to be rendered less clear.

    So to give some more color to this issue, every "slice" in a texture (we call them SpriteRects) are stored with texel positions. These SpriteRects contain all the data used to later generate a Sprite asset. We chose texel positions as the way to define a SpriteRects position on a texture so that we could support sprite sheet size ups (e.g. adding one more row/column to a sprite sheet). So when a texture is being scaled up, these SpriteRects will not move/scale according to the new size of the texture, which is why you are seeing the breakage.

    It is an interesting problem, and it is great to hear your reasons for wanting this functionality in the 2D toolset. We'll add all of this feedback to our backlog so that we can further discuss solutions to the problem.
     
    Deleted User likes this.
  29. Deleted User

    Deleted User

    Guest

    Doing this has less on the image clarity than reducing it in an image editor anyway. :)

    Changing the ppu doesn't affect the bones rigging but it completely destroys reverse IK. I've learnt it at my expense. :p
     
  30. hidingspot

    hidingspot

    Joined:
    Apr 27, 2011
    Posts:
    87
    We're using PSBs for all of our rigged characters.

    I tried this, and as @APSchmidt noted, this doesn't solve the problem.

    So, I created a temporary solution by reverse-engineering the meta file. It's a simple javascript file that scales up/down all bone and vert positions in the metafile according to a specified scale. I would have much rather done it by editing the package code, but to be honest, after looking at the code it felt simpler to just edit the meta file. It took longer than I'd hoped due to the Unity yaml format not being standard (I thought Unity exposed a yaml API for this but couldn't find it).

    It was several hours of work, but will save days if not weeks of re-rigging/weighting/animating.

    This feels like a very pretty common use case. My suggestion for the Unity side would be a scaling tool in the sprite editor similar to the move tool that already exists: being able to scale group-selected bones and group-selected verts.

    Anyway, thanks for the replies and info @Ted_Wikman and @APSchmidt !
     
    Ted_Wikman and EvOne like this.
  31. EvOne

    EvOne

    Joined:
    Jan 29, 2016
    Posts:
    173
    You can't say it better!

    Almost all changes that I see in the 2D Animation package since 2017 - lead to the fact that more and more should be done manually. No automation. Only manually. Only hardcore!

    A last Update and removal of the Sprite Library from the Sprite Skinning Editor - is already apotheosis... :confused:
    -Many many monotonous drags&drops, as well as assignments of names manually (potentially leading to errors and typos) instead of one operation "convert groups to category" - It is strategically wrong.

    I am glad for you that you have found a solution to the problem, and with your own way!

    P.S. Sorry for google-translate
     
    Last edited: Jun 17, 2021
  32. berdanka

    berdanka

    Joined:
    Sep 29, 2015
    Posts:
    24
    Actually I don't mind that one. Storing sprite swapping-related stuff inside of PSB metafile was the main source of most problems for me. Can't see, can't batch edit without writing code, corrupts data when handled roughly, etc. Dragging and dropping might be longer but external swapping gives me more confidence in data's safety.
    What I really need now... is a Spriteresolver manager to store resolvers outside of PSB prefab. That will make it more comfortable to animate resolvers (you can see every resolver at the same time). And also will give me a way to see if any of animated (by resolvers) objects were destroyed after PSB source editing.
    And maybe we need a way to feed PSB into the Sprite Library to auto generate the library data from folder's structure.
     
    EvOne likes this.
  33. hidingspot

    hidingspot

    Joined:
    Apr 27, 2011
    Posts:
    87
    Is there a way to call ResetBindPose programmatically? I've once again run into the issue of not being able to do a simple thing with SpriteSkin due to the rampant use of internal scoping. If not for that, it would be a simple matter of using SpriteSkinUtility to call ResetBindPose on all children of the rig root. I'd really rather not have to go through all of them and individually click the ResetBindPose button. Surely there's a way to do this that I'm missing.
     
  34. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    916
    Thanks for the feedback @EvOne and @berdanka. We are currently working on improvements to the Sprite Library experience to easier work with larger sets of Sprites were we hope to address some of these issues.

    Regarding the Sprite Resolver Manager you suggested @berdanka, could you expand a bit on what you envision there? Is it a new editor window that shows all the Sprite Resolvers in the scene (like the light explorer)? or do you see it popping up somewhere else?

    Onwards to your question @hidingspot, currently the ResetBindPose is only internal, as you have already discovered. We tend to set every method's access modifier as restrictive as possible and increase the access once we have good reasons to do so. This is to combat API bloating and to reduce the testing surface of a component.

    Do share what you want to achieve, but are currently unable to, and we will take it into account when updating the package.
     
    EvOne likes this.
  35. EvOne

    EvOne

    Joined:
    Jan 29, 2016
    Posts:
    173
    Tell me, please - in the description of the beta 2021.2 it is said:

    "* Please Note That At Time of Writing, The 2D Packages for the Unity 2021.2 Beta Are Not Yet Publicly Available. This Is a Temporary Situation and Will Be Rectified Shortly. Several URP / 2D Renderer Improvements Can Be Found in This Release."


    And I do not quite understand... -Changes in the packages about which is described below - are it included in this version of the beta, or it is just that "not yet"?

    "2D PSD Importer has new UX improvements, better control over the Photoshop layers, and Sprite name mapping. There’s a new option to flatten layer groups in Unity, and the tool can now autogenerate physics shapes, which can be convenient when you import scene elements that are not characters.

    2D Animation updates include bone colors, which can now be set in the visibility panel. This setup can help you to better differentiate colors or organization. UX improvements include shortcuts visible in the tooltips of the skinning editor’s tools, and a new tool to see sprite influences over bones."


    A little funny question I understand... :D
    -Install Beta and see everything yourself! But...
    Something I'm slightly tired of the permanent reinstallation of every new version of 2021.1
    (and I still have no benefit from them yet)
    And this time... -Can I find out what is waiting for me there? :oops:
    (and what not to hope)

    GoogleTranslate... sorry

    UPD: Hmmm...
    -Ok. I installed it. And, it does not even start... Error editor at startup... :D
    Well, - "beta", what else to say...:rolleyes:
     
    Last edited: Jun 26, 2021
  36. berdanka

    berdanka

    Joined:
    Sep 29, 2015
    Posts:
    24
    We have sprite resolvers to help us animate, right? That's the whole point of the 2D animation package. So as I stated before, once we have a completed rig, everything that is used by animation is better to be kept in one place. For example, I like how IKManager2D is looking right now, it helps you to keep things organized and always at hand. It also makes it easier to copy-paste my IKs between characters. I wish it could do more, but the core idea is right in my opinion.
    Now, the sprite resolvers aren't quite what I expect. The downsides are as follows:
    • I have to attach them to random places in the rig. After that, I can't have them visually organized for animation workflow (I can search by components but still...).
    • There is no way to know if something broke in my rig. Misspelled category name? Broken animation key? Wrong library? Something else? I have to dive into my rig to check every sprite object with sprite resolver one by one.
    • I can't share my resolvers with other rigs. If I have animation that depends on resolvers, there is no way to share it until the other character has the exact same sprite structure and resolver IDs. There are common animations between vastly different creatures. Like blinking. There are more. And no way to share them without hacks.
    When I tried the updated workflow for the first time I was kind of disappointed to find that, after attaching a sprite library component to instantiated PSB rig, I can't control sprite resolvers inside of the rig trough it. I can't even debug them, it just isn't aware of their existence. Despite having interactive buttons (kind of useless and misleading on the instantiated rig). Though I can understand the reason, it's impossible to animate array of components inside another component. But it's not impossible to do the same thing you did for IKManager2D, right? Just give us a way to create a bunch of empty objects, let's call them... sprite resolver relays. And a way to reference rig parts in them. We will be able to animate these components the same way we animate IK components.
    The easiest solution I see now is to alter a sprite resolver component a little. Instead of always working with object it placed on, give us an option to chose (to reference) a specific object with mesh renderer we want to animate. Then we'll be able to have a number of empty objects with sprite resolvers parented to an object with a sprite library component anywhere we want. All we have to do is to manually reference mesh renderers from somewhere for each of them, just once. Even when we forced to update a PSB prefab, we are not going to lose anything besides some references.
    Also, if you feel generous, consider making a sprite library component more useful for debugging. For example, it can show which sprites are currently in use by resolvers.
     
    EvOne likes this.
  37. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    916
    The 2D packages for Unity 2021.2 were a bit delayed, but are now out. We are currently preparing our beta release posts which will be available in the 2D Experimental Preview section on the forum in a few days.

    To check if you are using the latest packages make sure you have the following setup:
    - Unity 2021.2
    - 2D Animation 7.0.0-pre.2
    - 2D PSD Importer 6.0.0-pre.3
     
    EvOne likes this.
  38. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    916
    Per usual, thank you for the in-depth feedback. I fully agree with you that the way to animate Sprite Resolvers is not ideal. However, I don't think the solution lies in modifying the different components and introduce some Sprite Resolver manager flow and more game objects. I think the issue lies in how we currently author keyframes, that this step is not intuitive and introduces many limitations (among others, the hierarchy has to be identical to share clips). Currently, authoring simple data is pretty straight forward, but as soon as the data is more complex, the animation window is not a great working space. Improving this would improve the general animation experience in my mind, no matter if you animate Sprite Resolver components, or any other component.

    Regarding improved debugging tools for Sprite Resolvers, that is a good point.

    As always, we will take this feedback with us when designing the future versions of the editor and packages.
     
  39. sportifsisman

    sportifsisman

    Joined:
    Jul 17, 2020
    Posts:
    20
    Hi Everyone, I just installed 2DAnimation, 2DIK and PSDImporter bu ı got this errors.
    - I use 2020.3.10f1 version of unity.
    - 2DAnimation 5.0.6
    - 2DIK 3.0.2
    - PSDImporter 4.0.2
    SS is here.
    Thanks advance.
     

    Attached Files:

  40. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    916
    The 2D IK package is now baked into the 2D Animation package. If you remove the 2D IK package those errors should go away.
     
  41. EvOne

    EvOne

    Joined:
    Jan 29, 2016
    Posts:
    173
    Unfortunately, I could not even go through this quest even further than the first step :D
    -Beta 2021.2 is simply not started. Popup window with: "Error starting editor" without any explanations and details.
    It is impossible to send a report to the standard way. - Nothing started.
    At the same time, 2021.1 - worked perfectly.

    While I postponed it ... Maybe the next version of the beta will correct everything by itself :rolleyes::D
    If not - I will write to the support.
     
  42. EvOne

    EvOne

    Joined:
    Jan 29, 2016
    Posts:
    173
    Yes! -New beta...:rolleyes:
    But even if I could launch a new beta version...

    "Known Issues in 2021.2.0b3
    • 2D: 2D Animations crash when entering Play Mode (1338523)"
    Well... Not today ... (c) :D
     
    NotaNaN likes this.
  43. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    916
    Thanks for highlighting this issue @EvOne. I had a look at the case and a dev is currently working on resolving it.
     
    EvOne likes this.
  44. Deleted User

    Deleted User

    Guest

    Good to know! :) I won't waste time and bandwidth then. ;)
     
    EvOne likes this.
  45. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    916
    @EvOne & @APSchmidt the issue should have been resolved in 2021.2 beta 2. We had a hiccup with this particular bug not syncing up with our known issues post.

    If you are using 2021.2 beta 2 or 2021.2 beta 3 and you are experiencing this issue, please file a bug report and post the bug ID in this thread so we can triage the issue as soon as possible. Thank you!
     
    NotaNaN and EvOne like this.
  46. josguerra99

    josguerra99

    Joined:
    Feb 14, 2018
    Posts:
    8
    Hey, I'm having this weird behavior when destroying a GameObject that uses SpriteSkin and using Deep Profile, so after destroying the GameObject the profiler show this and never stops showing it after that:



    And this behavior is also present when using Profile Analyzer





    I'm using Unity 2021.1.11f1
    2D Animation 6.0.4
    Burst 1.5.4
    Collections 1.0.0-pre.5
     
  47. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    916
    Not sure what is going on here. Could you share your project or a minimal repro project in a private message with me? Then I can take a closer look.
    Thanks!
     
  48. zakirferhad

    zakirferhad

    Joined:
    May 2, 2020
    Posts:
    1
    3x performance increase. thank you very much
     
    Ted_Wikman likes this.
  49. kyuskoj

    kyuskoj

    Joined:
    Aug 28, 2013
    Posts:
    56
    Hello, I am still having this issue. Unity 2021.1.24 / 2D Animation 6.0.7.
    But in 2021.2.0b16 / 2D Animation 7.0.0, it works without any problems.

    [6.0.7] - 2021-09-21
    Fixed
    • Fixed an issue where IK Solvers would not be updated when previewing an animation clip. (1364313)
     
    Last edited: Oct 21, 2021
  50. Ted_Wikman

    Ted_Wikman

    Unity Technologies

    Joined:
    Oct 7, 2019
    Posts:
    916