Skip to content

Commit

Permalink
com.unity.2d.animation@9.0.0-pre.1
Browse files Browse the repository at this point in the history
## [9.0.0-pre.1] - 2022-03-21
### Added
- Added the ability to cancel mesh generation in the Skinning Editor.

### Changed
- 2D Animation now depends on the Collections package.
- Sprite Skin's AutoRebind can now swap between all bones underneath the rootBone.
- Updated Visibility Tab documentation page.
- Sprite Skins are now registered/deregistered in batches for improved instatiation/destroy performance.
- Updated ListView event listeners to use new selection API.

### Fixed
- Fixed an issue where the animation window's preview of IK targets would not be the same as in Play Mode. (case 1391590)
- Sprite Library cannot reference itself in the Main Library field or any asset that references it. (case 1401464)
- Fixed an issue where moving vertices in the Skinning Editor might result in invalid edges. (case 1386153)
- Fixed an issue where the SpriteSkin components would not get initialized on editor launch. (case 1401139)
- Fixed an issue when Skinning Editor will lose reference after exiting Play mode. (case 1405289)
- Fixed an issue where the Skinning Editor's copy/paste tool would fail if two bones shared the same name. (case 1405028)
  • Loading branch information
Unity Technologies committed Mar 21, 2022
1 parent ca34b67 commit 6f6de6b
Show file tree
Hide file tree
Showing 459 changed files with 43,006 additions and 45,323 deletions.
24 changes: 18 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
# Changelog
## [8.0.1] - 2022-03-21

## [9.0.0-pre.1] - 2022-03-21
### Added
- Added the ability to cancel mesh generation in the Skinning Editor.

### Changed
- 2D Animation now depends on the Collections package.
- Sprite Skin's AutoRebind can now swap between all bones underneath the rootBone.
- Updated Visibility Tab documentation page.
- Sprite Skins are now registered/deregistered in batches for improved instatiation/destroy performance.
- Updated ListView event listeners to use new selection API.

### Fixed
- Fixed an issue where moving vertices in the Skinning Editor might result in invalid edges. (case 1402636)
- Sprite Library cannot reference itself in the Main Library field or any asset that references it. (case 1402649)
- Fixed an issue where the SpriteSkin components would not get initialized on editor launch. (case 1403568)
- Fixed an issue when Skinning Editor will lose reference after exiting Play mode. (case 1405325)
- Fixed an issue where the animation window's preview of IK targets would not be the same as in Play Mode. (case 1391590)
- Sprite Library cannot reference itself in the Main Library field or any asset that references it. (case 1401464)
- Fixed an issue where moving vertices in the Skinning Editor might result in invalid edges. (case 1386153)
- Fixed an issue where the SpriteSkin components would not get initialized on editor launch. (case 1401139)
- Fixed an issue when Skinning Editor will lose reference after exiting Play mode. (case 1405289)
- Fixed an issue where the Skinning Editor's copy/paste tool would fail if two bones shared the same name. (case 1405028)

## [8.0.0] - 2022-01-25
### Changed
Expand All @@ -13,7 +26,6 @@
### Fixed
- Sprite Skin's help button now leads to the correct documentation page. (case 1383765)
- Fixed the isolate behavior in the Sprite tab in the Visibility panel. (case 1387184)
- Fixed an issue where the animation window's preview of IK targets would not be the same as in Play Mode. (case 1396081)

## [8.0.0-pre.4] - 2021-11-24
### Added
Expand Down
3 changes: 0 additions & 3 deletions Documentation~/Animating-actor.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,5 @@ Aside from this method, there are other ways that you can animate with the 2D An
## Sprite Swap
The 2D Animation package allows you to use the [Sprite Swap](SpriteSwapIntro.md) feature to swap to different Sprites at runtime, from [swapping only a single part](CharacterParts.md) of an actor to [swapping the entire Sprite Library Asset](SLASwap.md) it refers to.

### Frame-by-frame animation
By using [Sprite Swap](SpriteSwapIntro.md), you can create frame-by-frame style animations by swapping to different Sprites on each frame at runtime. Refer to the [Frame-by-frame Animation](FFanimation.md) documentation for more detailed information on how you can achieve this animation style.

### Other Sample projects
[Sample projects ](Examples.md) are distributed with the 2D Animation package and available for import. These projects include examples of the different ways you can animate with the package features, such as the [Flipbook Animation Swap](ex-sprite-swap.md#flipbook-animation-swap) and [Animated Swap](ex-sprite-swap.md#animated-swap) and so on. Refer to the respective Sample documentation pages for more information.
1 change: 0 additions & 1 deletion Documentation~/Examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ The following is the list of Sample projects and their respective documentation.

- [Simple](ex-simple.md) - a single Sprite rig with simple bone hierarchy and rigging.
- [Single Skinned Sprite](ex-single-skinned-sprite.md) - a more advance single Sprite actor.
- [Multiple Skinned Sprites](ex-multiple-skinned-sprites.md) - Multiple Sprites from a single Texture
- [Character](ex-psd-importer.md) - Imported with the PSD Importer
- [Sprite Swap](ex-sprite-swap.md) - - Contains examples of the many different ways that Sprite Swap can be used.
- [Flipbook Animation Swap](ex-sprite-swap.md#flipbook-animation-swap)
Expand Down
17 changes: 0 additions & 17 deletions Documentation~/FFanimation.md

This file was deleted.

11 changes: 2 additions & 9 deletions Documentation~/SpriteSkin.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ After [preparing and importing](PreparingArtwork.md) your artwork into Unity, br

The Sprite Skin deforms a Sprite by using GameObject Transforms to represent the bones that were added to the Sprite in the Skinning Editor module.

![](images/2D-optional-perf-boost-enabled.png)<br/>Sprite Skin component settings.
![](images/2D-spriteskin-component.png)<br/>Sprite Skin component settings.

Property | Function
--------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Expand All @@ -15,8 +15,6 @@ Property | Function
**Bones** | This shows the list of bones that are being set up for the Sprite in the Skinning Editor module. Each Sprite’s **Bone** entry must have a GameObject Transform associated with it for correct deformation.
**Create Bones** | The button lets you create GameObject Transform(s) to represent the Sprite’s Bone and assign them to the **Root Bone** property and the individual Bones entry. The Root Bone that is created is placed as a child of the GameObject of the Sprite Skin. The button is only enabled if the Root Bone property isn't assigned.
**Reset Bind Pose** | The button resets the GameObject Transforms assigned in the Bones entry to the bind pose value set up for the Sprite in the Skinning Editor module.
**Enable Batching** | If enabled, the Sprite Skin deforms the Sprite in batches for [optimization purposes](#optional-performance-boost). This option is only available when the Burst and Collections packages are installed. If either of them are missing, the checkbox is disabled and the Inspector displays the following message.
- |![](images/2D-optional-perf-boost-disabled.png)

## Auto Rebind
When you enable **Auto Rebind**, Sprite Skin attempts to automatically locate the GameObject Transform that is needed for the current Sprite assigned to the Sprite Renderer. This is triggered when the Sprite in the Sprite Renderer property is changed.
Expand All @@ -31,9 +29,4 @@ For the Sprite Skin component to automatically locate the bones successfully, Ga

![](images/2d-anim-sprite-skin-root-bone.png)

By setting the Sprite Skin’s **Root Bone** property to the correct GameObject Transform, Sprite Skin will then map the GameObject Transform to the Sprite’s rigged bone of the same name. For the **Auto Rebind** to be successful, the name and the hierarchy of the rigged bones and the GameObject Transforms must match. This means that changing the name of the bones in the Skinning Editor will require you to update the names of the GameObject Transforms to match as well.

## Optional performance boost
When animating your characters, you can improve the runtime performance of the animated Sprite’s deformation by installing both the [Burst](https://docs.unity3d.com/Packages/com.unity.burst@latest) and [Collections](https://docs.unity3d.com/Packages/com.unity.collections@latest) packages from the [Package Manager](https://docs.unity3d.com/Manual/upm-ui.html). This allows the 2D Animation package to use Burst compilation to speed up Unity’s processing of Sprite mesh deformation.

The package has been tested with [Burst](https://docs.unity3d.com/Packages/com.unity.burst@latest) version 1.4.1 and [Collections](https://docs.unity3d.com/Packages/com.unity.collections@latest) version 0.9.0-preview.6. However if you encounter any bugs, you can turn the optional performance boost off by disabling the __Enable batching__ option.
By setting the Sprite Skin’s **Root Bone** property to the correct GameObject Transform, Sprite Skin will then map the GameObject Transform to the Sprite’s rigged bone of the same name. For the **Auto Rebind** to be successful, the name and the hierarchy of the rigged bones and the GameObject Transforms must match. This means that changing the name of the bones in the Skinning Editor will require you to update the names of the GameObject Transforms to match as well.
2 changes: 1 addition & 1 deletion Documentation~/SpriteSwapIntro.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Sprite Swapping
__Sprite Swap__ is a feature that enables you to change a GameObject’s rendered Sprite at runtime. This has a number of uses, such as easily creating multiple characters which [share a skeleton](ex-skeleton-sharing.md) (requires the [PSD Importer package](https://docs.unity3d.com/Packages/com.unity.2d.psdimporter@latest)) or [reuse existing bone and Mesh data](SkinEdToolsShortcuts.md#copy-and-paste-behavior) while looking visually different.

Using Sprite Swap to change the rendered Sprites on each frame at runtime, you can even simulate a [frame-by-frame animation](FFanimation.md) style. The 2D Animation package comes with several Sample projects of the other different ways you can use Sprite Swap to achieve different effects and features, refer to the [Sample documentation here](ex-sprite-swap.md) for more information about these examples.
The 2D Animation package comes with several Sample projects of different ways you can use Sprite Swap to achieve different effects and features, refer to the [Sample documentation here](ex-sprite-swap.md) for more information about these examples.

## Sprite Swap Assets and components
Sprite Swap requires the following Assets and components, which are all included with the 2D Animation package:
Expand Down
6 changes: 2 additions & 4 deletions Documentation~/SpriteVis.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ The panel appears on the right-side of the editor window. It has two sliders at

The **Bone** tab displays the [Bone hierarchy](#bone-tab-and-hierarchy-tree) of the character Prefab. The **Sprite** tab displays the names of the Sprites and their grouping hierarchy.

<!-- Is it still relevant for the following note to be here? -->
**Note:** You cannot create or define a [Sprite Library Asset](SLAsset.md) within the Skinning Editor module from 2D Animation version 6.0 onwards, and the **Category** and **Label** columns have been removed from the Sprite Visibility panel. Please refer to the [Sprite Library Asset documentation](SLAsset.md) for more information.

## Bone tab and hierarchy tree

![](images/bone_tree.PNG)<br/>The Bone tab selected.
Expand All @@ -23,12 +20,13 @@ Select the __Bone__ tab to view the list of bones in the character Prefab. The l
| Property | Function |
| ------------------------------- | ------------------------------------------------------------ |
| ![](images/visibility_icon.png) | Toggle the visibility of each bone by selecting this icon next to the bone. |
| ![](images/visibility_icon.png) +Alt (macOS: +Option) | Toggle the visibility of a bone and its children by selecting this icon while holding Alt (macOS: holding Option). |
| __Bone__ | The name of the Bone. |
| __Depth__ | Displays the Z-value of bones that are influencing the same Sprite Mesh. The parts of the Mesh that is influenced by a bone with higher **Depth** value will render in front of the Mesh influenced by bones with lower **Depth** value. <br/>A bone’s **Depth** value is 0 by default. |
| __Color__ | The color of the Bone. |

## Sprite tab

Select the __Sprite tab__ to see the list of Sprites that make up the character Prefab in the Skinning editor window. The names and order of the Sprites mirror their names, layer and grouping order in the original source file.
Select the __Sprite tab__ to see the list of Sprites that make up the character Prefab in the Skinning editor window. The names and order of the Sprites mirror their names, layer and grouping order in the original source file. Toggle the visibility of a Layer by selecting the ![](images/visibility_icon.png) icon next to it. Hold Alt (macOS: hold Option) to view it in isolation and hide every other Layer.

![](images/2D-animation-v7-sprite-tab.png)
2 changes: 0 additions & 2 deletions Documentation~/TableOfContents.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@
* [Setting up Sprite Swap](SpriteSwapSetup)
* [Swapping individual Sprites](CharacterParts)
* [Swapping Sprite Library Assets](SLASwap)
* [Frame-by-frame Animation](FFanimation)
* [Importing Samples](Examples)
* [Simple](ex-simple)
* [Single Skinned Sprite](ex-single-skinned-sprite)
* [Multiple Skinned Sprites](ex-multiple-skinned-sprites)
* [Character](ex-psd-importer)
* [Sprite Swap examples](ex-sprite-swap)
* [Skeleton Sharing](ex-skeleton-sharing)
Expand Down
26 changes: 0 additions & 26 deletions Documentation~/ex-multiple-skinned-sprites.md

This file was deleted.

4 changes: 2 additions & 2 deletions Documentation~/ex-psd-importer.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Rigging a character imported with the PSD Importer
This sample demonstrates how to rig an actor that is made from multiple Sprites, when its source file is imported with the [PSD Importer](https://docs.unity3d.com/Packages/com.unity.2d.psdimporter@latest/). This example requires the PSD Importer to be installed.
This sample demonstrates how to rig an actor that is made from multiple Sprites, imported with the [PSD Importer](https://docs.unity3d.com/Packages/com.unity.2d.psdimporter@latest/).

![](images/2D-animation-samples-character-sample.png)

Open the Asset `Assets/Samples/2D Animation/[X.Y.Z]/Samples/4 Character/Sprites/Fei.psb` in the [Skinning Editor](SkinningEditor.md) module to examine how the Sprite is rigged.
Open the Asset `Assets/Samples/2D Animation/[X.Y.Z]/Samples/3 Character/Sprites/Fei.psb` in the [Skinning Editor](SkinningEditor.md) module to examine how the Sprite is rigged.

![](images/2D-animation-samples-character-skinning-module.png)

Expand Down
6 changes: 3 additions & 3 deletions Documentation~/ex-runtime-swap.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ This sample demonstrates how you can use the Sprite Library API to override a sp
![](images/2D-animation-samples-runtimeswap.png)
The graphic Assets are located in `Assets/Samples/2D Animation/[X.Y.Z]/Samples/5 SpriteSwap/Sprites`:

- `Primary.psb`
- `Knight.psb`
- `Skeleton.psb`

The `Skeleton.psb` uses the [.skeleton Asset](https://docs.unity3d.com/Packages/com.unity.2d.psdimporter@latest/index.html?subfolder=/manual/PSD-importer-properties.html%23main-skeleton) from the `Primary.psb` for its rigging. It also references the `Primary.spriteLib` Sprite Library Asset located in `Assets/Samples/2D Animation/[X.Y.Z]/Samples/5 SpriteSwap/Sprites`.
The `Skeleton.psb` uses the [.skeleton Asset](https://docs.unity3d.com/Packages/com.unity.2d.psdimporter@latest/index.html?subfolder=/manual/PSD-importer-properties.html%23main-skeleton) from the `Knight.psb` for its rigging. It also references the `Knight.spriteLib` Sprite Library Asset located in `Assets/Samples/2D Animation/[X.Y.Z]/Samples/5 SpriteSwap/Sprites`.

## Runtime Swap script
A custom MonoBehaviour script called the `RuntimeSwap` is attached to the `KnigtboyRig` GameObject. The script is located in `Assets/Samples/2D Animation/[X.Y.Z]/Samples/5 SpriteSwap/Scripts/Runtime/RuntimeSwap.cs`
Expand All @@ -18,7 +18,7 @@ Pressing a button (in the sample Scene) with a Sprite from the `Skeleton.psb` ca
m_SpriteLibraryTarget.AddOverride(entry.sprite, entry.category, entry.entry);
```

Pressing a button with a Sprite from the `Primary.psb` causes the script to use the override rest API from the Sprite Library to remove the Sprite Entry override.
Pressing a button with a Sprite from the `Knight.psb` causes the script to use the override rest API from the Sprite Library to remove the Sprite Entry override.

```c++
m_SpriteLibraryTarget.RemoveOverride(entry.category, entry.entry);
Expand Down
Loading

0 comments on commit 6f6de6b

Please sign in to comment.