2D Animation 2.2.0-preview.4 for 2019.2 is out

2D Animation 2.2.0-preview.4 for 2019.2 is now available!

  • The sprite swapping workflow has been improved by making Sprite Resolvers more robust for animation by replacing indices with labels.
  • In the Skinning Editor, bone association now picks up the nearest bone when no bones are overlapping the Sprite.

Important Note:
Because we redesigned the way we implement Sprite Library, previous assets and components will not work. Please use the new APIs and redo your Sprite Swap setup.

Getting Started:

  1. Install latest Unity 2019.2.

  2. Open Package Manager by going to Window > Package Manager

  3. In Package Manager display preview packages by going to Advanced > Show preview packages
    4817717--461594--Preview Packages.png

  4. Choose 2D Animation preview.4 - 2.2.0 from the list and click on Install at the bottom right of the Package Manager window.

Here’s more details on this release:

What’s New

  • BoneGizmos will only show in selected hierarchies.
  • Associate nearest Bone to Sprite instead of root Bone when no Bones are overlapping the Sprite
  • SpriteResolver will assign Sprite to SpriteRenderer even it resolves to a missing Sprite
  • Add visual feedback in SpriteResolver Inspector for missing Sprites

Changed

  • Update documentation
  • Backport changes from Animation 3.0.2
  • Make Size property field in Weight Brush draggable for changing brush size
  • Change string hash for Category and Label name. This might break existing animation usage with SpriteResolver.
  • Rename SpriteLibraryAsset::GetCategorylabelNames to SpriteLibraryAsset::GetCategoryLabelNames
  • BoneGizmos can be toggled in the SceneView Gizmos dropdown
  • Scrollbar does not show for toolbar when required to scroll
  • Change Sprite Library implementation.
  • APIs redesigned. This will cause compilation errors if previous APIs are used
  • Data serialization change. Previous Asset and Component data will not be compatibl

Fixed

  • Fixed Amount slider not working in Weight Slider Panel
  • Fixed exception when changing size to less than 0 in SpriteLibraryAssetInspector
  • Fixed Sprite Library Asset Inspector Property Field text clipping
  • Fixed Sprite not showing after it is being culled due to bone animation
2 Likes

To clarify: Does this mean all of the previously created 2D rigs and animations will be broken and have to be redone? Is there no upgrade path to convert the old data to the new system? That sounds really rough, even for a preview package.

Edit: After doing some tests with the new version, it looks like in general all animations still work. I was worried, because yesterday everything everything was broken when I tried upgrading from 2019.1 to 2019.2 but with the updated 2D animation package it looks normal again.

My project from 2019.1 which was running smoothly (200fps) now struggles to stay above 30 in the latest versions of these packages. My frame time in the editor has exploded thanks to what looks to me like a SpriteSkin.LateUpdate() call for every single layer of every skinned sprite, each clocking in around 0.1ms. Submitted my project with case 1174167, hopefully this isn’t how its supposed to perform going forward, otherwise it’s useless.

1 Like

Thanks, we will take a look at the case and investigate.

1 Like

Any chance this works with 2019.3 alpha?

It’s already works :slight_smile:
4827017--463091--2019-08-06_19-01-35.png

2 Likes

Are there any known issues with the new 2D renderer or LWRP and 2D animations? Since I started using LWRP to take advantage of the new 2D lights in Unity it has broken the connection between the bones and the sprites (as shown in video provided)

https://drive.google.com/open?id=1acnA_M7RVa61dC4g0Q3OoswK7mVhAS9M

Here are the packages that I’m currently using

I also tried

  • updating burst to 1.1.2
  • changing “Asset Pipeline” to v2 in ProjectSettings
    but they both didn’t help.

Should I make a bug report?

Just added a new character to the game and after rigging the IKs are moving the sprites no problem. So it seems the ones already in the project during the transition to LWRP they lost their connections from bone to sprite.

Making a bug report will help us to debug the issues faster.

Are you on 2019.3?

Could you try to use “Asset Pipeline” to v1 in ProjectSettings?
Workaround: Did you try to Re-import the individual character psb files?
There are some known related issues here:
https://issuetracker.unity3d.com/issues/assetdatabase-v2-does-not-save-assets-modified-during-assetpostprocess
https://issuetracker.unity3d.com/issues/2d-character-bones-are-deatached-from-body-when-project-is-upgraded-to-newer-realeased-2d-psd-importer-version

No using 2019.2.0f1

I am currently using V1, I switched to V2 to see if that would help. But neither versions so.

I did try that yea, but unfortunately didn’t help.

It seems to be related to the second issue you linked thought I have different reproduction steps.

I’ll make a bug report and post id here. thanks

Helo, quick question

does this system support bone gravity/stiffness/elasticity eg physics, say can i attach colliders to bones and react with other colliders, like grass collisions for character walking through the grass, or is there a simple way to achieve this, and how?

EDIT: i was unable to make the generated joints work with rigidbody/colliders. Also, 2D joints - will there be a support for this in the autogenerated Animation2D gameobject? The closest that i came to was to completely unpack the prefab, insert rigidbody and some colliders, but the joints are stiff, and there seems to be no way to enable physics for them. I guess im asking if the system will allow to add friction/elasticity et al, for the added joints.

Sorry it took longer than I thought to get back.
As I was making a new project to reproduce the bug I discovered I could not, everything works fine.
Then I discovered in the project that has the broken bone → sprite connections that the PSD file was actually fine. I could drag it into the scene and the bones move the sprites as usual. So something must’ve happen to the prefab and/or IK connections when the update was happening. Luckily its only 2 characters that are affected so redoing the IK isn’t a massive job so still an annoyance. I guess this is the pit fall to working with preview packages :sweat_smile:

Is there any new info on this topic. Can only animate 4 rigged 2d gameobject before the framerate drops under 30. The problem is in SpriteSkin.LateUpdate(). Iam using 2019.2.1f1

1 Like

We are looking into the problem now.

3 Likes

A user from another thread made me come back to the same question asked in #11. Can somebody please answer it? If there is no such support, or no such support coming/planned/whatever, just say so. Cheers!

Also, how about FFD (free-form deformation) for sprite-based parts (which can also be swapped out?)

Weirdly, it seems like this is being overlooked… Are you guys waiting for DOTS or something?

This was discussed like a year ago, as i also requested it shortly after Anima2D integration into Animation2D-Experimental (its an old thread). Reply from Unity was something like “we would like to consider it later when we have basics bug-free and running” (at that time, there was not even Sprite-Swapping, so stuff like that). Their reply also suggested that they will consider it, meaning whatever they implemented since, would be compatible with it.

However i wouldn’t expect it for another year or two (or more). Thats why at that time i also had to choose a 3rd party alternative with FFD support, looking forward for in-engine integration later.

My suggestion is, if you really need FFD for production, go 3rd party, or there are some assets that do it in-engine (but afaik none of them hassle-free). Not even the Animation2D is stable atm (preview), so you’ll avoid some issues from that as well. I myself will avoid Animation2D for production for another year at least (not even talking FFD here)

I remember that back-and-forth actually. I was just curious because it seems like sprite-swapping would have needed FFD to have already been implemented (if they planned to support FFD on swapped-parts).
FFD not being mentioned in such a long time by anyone (including users) means that it may not be on the roadmap, as I don’t recall anyone from Unity even making the mention that they would actually (for sure) include it…

Technically, the (free) Unity Sprites and Bones did all of this (even FFD) and was (and probably is) still stable, but it wasn’t hyped much (probably because of timing and DragonBones being released, etc.) and suffered from next to no documentation and was just much less visually-nice (interface-wise) than Unity’s version since many of its functions were hidden or not very easy to discover. It, however, was very usable. It was unfortunately made way before the conception of ECS/DOTS, so it could do better in terms of performance now probably. The author (that took over the project) was going to make a better-organized version, but I’ve not heard anything in some time on this front. No idea if it ever took off, but the old version is probably still floating about someplace.

FFD is on our roadmap though we haven’t started working on it yet. There are still some fundamental work that needs to be done before we can start on it but rest assure that it’s a feature we want to have in our tool.

2 Likes

That’s great!! – Maybe now is the best time to request that FFD also supports real-time swapped (in-place) sprite parts?

For example, if I have a human head that I use FFD to animate the mouth talking, but after being hit in the face with magic or something, I will swap the human head with a monster character’s head (with two mouths, both positioned strangely.) I want to then be able to use that new head’s FFD double-mouth animation in place of the human head (perhaps even with the same keys/timing – but in other cases, I might have a whole other set of animations for that head where it is, where, for example, it is looking down at its feet in shame as either a monster or a human). The obvious use-case is equipment swapping for most people, but flexible use of FFD in sprite-swaps for cutscene animation is just as important.

Do you think you guys will be able to work this into the design, @Leo-Yaik ?

Maybe this is future-stuff, but perhaps some parts could maybe also have a pivot offset (for example – a human turning into a monster might have slightly different proportions, so the animation would be relatively the same, except for a slight offset from the shoulder/torso/head pivot origins.) This could be getting into the modular-rigging territory for 2d animation, so maybe that’s future-stuff, but it would still be really REALLY useful for games…