Skip to content

Commit

Permalink
com.unity.2d.animation@9.0.4
Browse files Browse the repository at this point in the history
## [9.0.4] - 2023-09-05
### Fixed
- Fixed an issue where the FK doesn't blend correctly with the IK if solver solves from the bind pose. (case DANB-482)
- Added correct help documentation link to Sprite Library Asset. (case DANB-486)
  • Loading branch information
Unity Technologies committed Sep 5, 2023
1 parent 9b5c8cf commit 6c308e3
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 16 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [9.0.4] - 2023-09-05
### Fixed
- Fixed an issue where the FK doesn't blend correctly with the IK if solver solves from the bind pose. (case DANB-482)
- Added correct help documentation link to Sprite Library Asset. (case DANB-486)

## [9.0.3] - 2023-04-18
### Fixed
- Fixed Sprite Resolver inspector not able to set category to 'No Category' if it contains the old hash value. (case DAB-395)
Expand Down
2 changes: 1 addition & 1 deletion Documentation~/AssetUpgrader.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The 2D Animation Asset Upgrader tool eases the transition and upgrade of older a

- Upgrades [Sprite Library Asset](SL-Asset.md) files ending in `.asset` to Sprite Library Source Asset files ending in `.spriteLib`.
- Moves Sprite Library Assets baked into `.psb` files created in Unity 2019 and Unity 2020 out into their own separate Sprite Library Source Asset files ending in `.spriteLib`.
- Upgrades [Animation Clips](https://docs.unity3d.com/Manual/AnimationClips.html) that animate Sprites based on the [Sprite Resolver component](https://docs.unity3d.com/Packages/com.unity.2d.animation@latest/index.html?subfolder=/manual/SLAsset.html%23sprite-resolver-component)'s [Category and Label](https://docs.unity3d.com/Packages/com.unity.2d.animation@latest/index.html?subfolder=/manual/SLAsset.html%23category) hash in Unity 2019 and Unity 2020, to Sprite Resolver's new **Sprite Hash** property from Unity 2022 onwards.
- Upgrades [Animation Clips](https://docs.unity3d.com/Manual/AnimationClips.html) that animate Sprites based on the [Sprite Resolver component](https://docs.unity3d.com/Packages/com.unity.2d.animation@latest/index.html?subfolder=/manual/SL-Resolver.html)'s [Category and Label](SL-Editor.md) hash in Unity 2019 and Unity 2020, to Sprite Resolver's new **Sprite Hash** property from Unity 2022 onwards.
- Upgrades Animation Clips animating the Sprite Resolver component's **Sprite Key** property in Unity 2021, to Sprite Resolver's new Sprite Hash property from Unity 2022 onwards.

## Getting Started
Expand Down
2 changes: 1 addition & 1 deletion Documentation~/SLAsset.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ Similarly, any Labels in the same Category that have the same names are merged.
When a Sprite Library Asset is removed from the **Sprite Library Asset** property, any changes that were made to the current Sprite Library Asset remain.

## Sprite Resolver component
The Sprite Resolver component is attached to each GameObject in the Prefab. The component pulls information from the [Sprite Library Asset](SLAsset.md) (assigned to the [Sprite Library component](#sprite-library-component) at the root of the Prefab). The component contains two properties - [Category](#category) and [Label](#entry) - and a visual Variant Selector that displays thumbnails of the Sprites contained in the Sprite Library Asset.
The Sprite Resolver component is attached to each GameObject in the Prefab. The component pulls information from the [Sprite Library Asset](SL-Asset.md) (assigned to the [Sprite Library component](SL-component.md) at the root of the Prefab). The component contains two properties - [Category](#category) and [Label](#entry) - and a visual Variant Selector that displays thumbnails of the Sprites contained in the Sprite Library Asset.

![](images/2D-animation-SResolver-properties.png)<br/>Inspector view of Sprite Resolver component.

Expand Down
6 changes: 3 additions & 3 deletions Documentation~/SpriteSwapIntro.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ The following are technical limitations which you should keep in mind when using
If you want to [animate your actor](Animating-actor.md) and use Sprite Swap with skeletal animation, both sprites that are swapped must have an identical skeleton. Use the [Copy and Paste tools of the Skinning Editor](SkinEdToolsShortcuts.md#copy-and-paste-behavior) to duplicate the bone and skeleton data from one sprite to another to ensure they will swap correctly.

### Animator limitations
In a single [Animator Controller](https://docs.unity3d.com/Manual/AnimatorControllers.html), you can't have one [Animation Clip](https://docs.unity3d.com/Manual/AnimationClips.html) animating the [Sprite Renderer’s](https://docs.unity3d.com/Manual/class-SpriteRenderer.html) assigned sprite while another [Animation Clip](https://docs.unity3d.com/Manual/AnimationClips.html) animates the [Sprite Resolver’s](SLAsset.html#sprite-resolver-component) sprite hash. If these two clips are in the same [Animator Controller](https://docs.unity3d.com/Manual/AnimatorControllers.html), they will conflict with each other and cause unwanted playback results.
In a single [Animator Controller](https://docs.unity3d.com/Manual/AnimatorControllers.html), you can't have one [Animation Clip](https://docs.unity3d.com/Manual/AnimationClips.html) animating the [Sprite Renderer’s](https://docs.unity3d.com/Manual/class-SpriteRenderer.html) assigned sprite while another [Animation Clip](https://docs.unity3d.com/Manual/AnimationClips.html) animates the [Sprite Resolver’s](SL-Resolver.md) sprite hash. If these two clips are in the same [Animator Controller](https://docs.unity3d.com/Manual/AnimatorControllers.html), they will conflict with each other and cause unwanted playback results.

Use the following recommended methods to resolve this issue.

1. The first method is to separate the [Animation Clips](https://docs.unity3d.com/Manual/AnimationClips.html) into separate [Animator Controllers](https://docs.unity3d.com/Manual/AnimatorControllers.html) that contain only clips that animate either a [Sprite Renderer’s](https://docs.unity3d.com/Manual/class-SpriteRenderer.html) sprite or the [Sprite Resolver’s](SLAsset.html#sprite-resolver-component) sprite hash but not both types in the same [Animator Controller](https://docs.unity3d.com/Manual/AnimatorControllers.html).
1. The first method is to separate the [Animation Clips](https://docs.unity3d.com/Manual/AnimationClips.html) into separate [Animator Controllers](https://docs.unity3d.com/Manual/AnimatorControllers.html) that contain only clips that animate either a [Sprite Renderer’s](https://docs.unity3d.com/Manual/class-SpriteRenderer.html) sprite or the [Sprite Resolver’s](SL-Resolver.md) sprite hash but not both types in the same [Animator Controller](https://docs.unity3d.com/Manual/AnimatorControllers.html).
<br/>

2. The second method is to update all [Animation Clips](https://docs.unity3d.com/Manual/AnimationClips.html) to the same type so that they can all remain in a single [Animator Controller](https://docs.unity3d.com/Manual/AnimatorControllers.html). To do so, convert all clips animating a [Sprite Renderer’s](https://docs.unity3d.com/Manual/class-SpriteRenderer.html) sprite to animating a [Sprite Resolver’s](SLAsset.html#sprite-resolver-component) sprite hash, or vice versa.
2. The second method is to update all [Animation Clips](https://docs.unity3d.com/Manual/AnimationClips.html) to the same type so that they can all remain in a single [Animator Controller](https://docs.unity3d.com/Manual/AnimatorControllers.html). To do so, convert all clips animating a [Sprite Renderer’s](https://docs.unity3d.com/Manual/class-SpriteRenderer.html) sprite to animating a [Sprite Resolver’s](SL-Resolver.md) sprite hash, or vice versa.

## Additional resources
- [Animation](https://docs.unity3d.com/Manual/AnimationSection.html)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace UnityEditor.U2D.Animation
/// A ScriptedImporter that imports .spriteLib extension file to generate
/// SpriteLibraryAsset
/// </summary>
[HelpURL("https://docs.unity3d.com/Packages/com.unity.2d.animation@9.0/manual/SL-Asset.html")]
[ScriptedImporter(22100000, "spriteLib", AllowCaching = true)]
public class SpriteLibrarySourceAssetImporter : ScriptedImporter
{
Expand Down
4 changes: 2 additions & 2 deletions IK/Runtime/Solver2D.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,11 @@ public void UpdateIK(List<Vector3> targetPositions, float globalWeight)
if (!isValid)
return;

Prepare();

if (finalWeight < 1f)
StoreLocalRotations();

Prepare();

DoUpdateIK(targetPositions);

if (constrainRotation)
Expand Down
2 changes: 1 addition & 1 deletion Runtime/SpriteLib/SpriteLibrary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace UnityEngine.U2D.Animation
[AddComponentMenu("2D Animation/Sprite Library")]
[IconAttribute(IconUtility.IconPath + "Animation.SpriteLibrary.png")]
[MovedFrom("UnityEngine.Experimental.U2D.Animation")]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.2d.animation@latest/index.html?subfolder=/manual/SLAsset.html%23sprite-library-component")]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.2d.animation@9.0/manual/SL-component.html")]
public class SpriteLibrary : MonoBehaviour, IPreviewable
{
struct CategoryEntrySprite
Expand Down
2 changes: 1 addition & 1 deletion Runtime/SpriteLib/SpriteLibraryAsset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ internal void ValidateLabels(bool log = true)
/// Sprites are grouped under a given category as categories. Each category and label needs to have
/// a name specified so that it can be queried.
/// </Description>
[HelpURL("https://docs.unity3d.com/Packages/com.unity.2d.animation@latest/index.html?subfolder=/manual/SLAsset.html")]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.2d.animation@9.0/manual/AssetUpgrader.html#upgrading-sprite-libraries")]
[MovedFrom("UnityEngine.Experimental.U2D.Animation")]
[Icon(IconUtility.IconPath + "Animation.SpriteLibrary.png")]
public class SpriteLibraryAsset : ScriptableObject
Expand Down
2 changes: 1 addition & 1 deletion Runtime/SpriteLib/SpriteResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace UnityEngine.U2D.Animation
[AddComponentMenu("2D Animation/Sprite Resolver")]
[IconAttribute(IconUtility.IconPath + "Animation.SpriteResolver.png")]
[DefaultExecutionOrder(-2)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.2d.animation@latest/index.html?subfolder=/manual/SLAsset.html%23sprite-resolver-component")]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.2d.animation@9.0/manual/SL-Resolver.html")]
[MovedFrom("UnityEngine.Experimental.U2D.Animation")]
public class SpriteResolver : MonoBehaviour, ISerializationCallbackReceiver, IPreviewable
{
Expand Down
2 changes: 1 addition & 1 deletion Runtime/SpriteSkin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ internal struct PositionTangentVertex
[AddComponentMenu("2D Animation/Sprite Skin")]
[IconAttribute(IconUtility.IconPath + "Animation.SpriteSkin.png")]
[MovedFrom("UnityEngine.U2D.Experimental.Animation")]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.2d.animation@latest/index.html?subfolder=/manual/SpriteSkin.html")]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.2d.animation@9.0/manual/SpriteSkin.html")]
public sealed class SpriteSkin : MonoBehaviour, IPreviewable, ISerializationCallbackReceiver
{
static class Profiling
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.unity.2d.animation",
"version": "9.0.3",
"version": "9.0.4",
"unity": "2022.2",
"displayName": "2D Animation",
"description": "2D Animation provides all the necessary tooling and runtime components for skeletal animation using Sprites.",
Expand All @@ -17,7 +17,7 @@
"com.unity.modules.uielements": "1.0.0"
},
"relatedPackages": {
"com.unity.2d.animation.tests": "9.0.3",
"com.unity.2d.animation.tests": "9.0.4",
"com.unity.2d.common.tests": "8.0.1",
"com.unity.2d.psdimporter": "8.0.2"
},
Expand All @@ -29,15 +29,15 @@
}
],
"_upm": {
"changelog": "### Fixed\n- Fixed Sprite Resolver inspector not able to set category to 'No Category' if it contains the old hash value. (case DAB-395)\n- Fixed Sprite Resolver inspector not updating its previews when the category is set externally to 'No Category'. (case DANB-389)\n- Fixed an issue where the Limb IK solver will become unstable when the child bones have different Z position. (case DANB-413)\n- Fixed an issue where changing Sprite Library reference in the Inspector will result in an exception. (case DANB-426)\n- Fixed an issue where the CCD and Fabrik solvers will become unstable when the child bones have different Z position. (case DANB-418)\n\n### Added\n- Updated IK parameter names and comments in public APIs."
"changelog": "### Fixed\n- Fixed an issue where the FK doesn't blend correctly with the IK if solver solves from the bind pose. (case DANB-482)\n- Added correct help documentation link to Sprite Library Asset. (case DANB-486)"
},
"upmCi": {
"footprint": "3a8b9a0f9c3ca22a7acffc1463d98cc4191430a2"
"footprint": "b06b0b1c49fb0066fee85044da1fa6436badeae8"
},
"documentationUrl": "https://docs.unity3d.com/Packages/com.unity.2d.animation@9.0/manual/index.html",
"repository": {
"url": "https://github.cds.internal.unity3d.com/unity/2d.git",
"type": "git",
"revision": "7d8e0c5910334b5bcf7795fe32bcde0a11d57109"
"revision": "be60dd1716d39b00d03d87668a09a4fc1d4102b6"
}
}

0 comments on commit 6c308e3

Please sign in to comment.