Skip to content

Commit

Permalink
com.unity.2d.animation@9.1.0
Browse files Browse the repository at this point in the history
## [9.1.0] - 2023-12-14
### Fixed
- Blend weight vertex attribute is added only when sprite has bones. (case DANB-520)
- Sprite Library editor drag and drop interactions. (case DANB-535)
- Sprite Library editor drag and drop blocked by labels. (case DANB-558)
- Adjust the copy-paste logic to not paste sprite mesh to the same sprite twice. (case DANB-530)
- Sprite Library Asset is selected on creation. (case DANB-542)
- Sprite Resolver previews not visible after editor regained focus. (case DANB-564)

### Added
- SpriteSkin's Auto Rebind property can now be accessed from scripts. (case DANB-490)
- Sprite Library public API to save an asset as a .spriteLib SpriteLibrarySourceAsset.
  • Loading branch information
Unity Technologies committed Dec 14, 2023
1 parent 6c308e3 commit cbf2d6b
Show file tree
Hide file tree
Showing 29 changed files with 746 additions and 348 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## [9.1.0] - 2023-12-14
### Fixed
- Blend weight vertex attribute is added only when sprite has bones. (case DANB-520)
- Sprite Library editor drag and drop interactions. (case DANB-535)
- Sprite Library editor drag and drop blocked by labels. (case DANB-558)
- Adjust the copy-paste logic to not paste sprite mesh to the same sprite twice. (case DANB-530)
- Sprite Library Asset is selected on creation. (case DANB-542)
- Sprite Resolver previews not visible after editor regained focus. (case DANB-564)

### Added
- SpriteSkin's Auto Rebind property can now be accessed from scripts. (case DANB-490)
- Sprite Library public API to save an asset as a .spriteLib SpriteLibrarySourceAsset.

## [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)
Expand Down
4 changes: 2 additions & 2 deletions Editor/Assets/SpriteLibraryEditor/CategoriesTab.uxml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<ui:UXML xmlns:ui="UnityEngine.UIElements" eui="UnityEditor.UIElements" aui="UnityEditor.U2D.Animation.SpriteLibraryEditor">
<UnityEditor.U2D.Animation.SpriteLibraryEditor.CategoriesTab name="CategoriesTab">
<Style src="CategoriesTab.uss"/>
<Style src="CategoriesTab.uss" />
<ui:Template name="EditorTabHeader" src="EditorTabHeader.uxml" />
<ui:Instance template="EditorTabHeader" name="EditorTabHeader"/>
<ui:Instance template="EditorTabHeader" name="EditorTabHeader" pickingMode="Ignore" />
<ui:ScrollView name="CategoryListsScrollView">
</ui:ScrollView>
</UnityEditor.U2D.Animation.SpriteLibraryEditor.CategoriesTab>
Expand Down
4 changes: 2 additions & 2 deletions Editor/Assets/SpriteLibraryEditor/EditorTabHeader.uxml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<ui:UXML xmlns:ui="UnityEngine.UIElements" eui="UnityEditor.UIElements" aui="UnityEditor.U2D.Animation.SpriteLibraryEditor">
<UnityEditor.U2D.Animation.SpriteLibraryEditor.EditorTabHeader name="EditorTabHeader">
<ui:VisualElement name="TopBar" class="sprite-library-editor-window__top-bar">
<UnityEditor.U2D.Animation.SpriteLibraryEditor.EditorTabHeader name="EditorTabHeader" pickingMode="Ignore" >
<ui:VisualElement name="TopBar" class="sprite-library-editor-window__top-bar" pickingMode="Ignore" >
<ui:Button name="AddButton" class="sprite-library-editor-window__add-button"/>
<ui:Label text="Label"/>
</ui:VisualElement>
Expand Down
2 changes: 1 addition & 1 deletion Editor/Assets/SpriteLibraryEditor/LabelsTab.uxml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<UnityEditor.U2D.Animation.SpriteLibraryEditor.LabelsTab name="LabelsTab">
<Style src="LabelsTab.uss"/>
<ui:Template name="EditorTabHeader" src="EditorTabHeader.uxml" />
<ui:Instance template="EditorTabHeader" name="EditorTabHeader" />
<ui:Instance template="EditorTabHeader" name="EditorTabHeader" pickingMode="Ignore" />
<ui:VisualElement name="LabelsContainer" />
</UnityEditor.U2D.Animation.SpriteLibraryEditor.LabelsTab>
</ui:UXML>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<ui:Template name="EditorMainWindow" src="EditorMainWindow.uxml" />
<ui:Template name="EditorBottomToolbar" src="EditorBottomToolbar.uxml" />
<ui:VisualElement name="EditorWindowRoot" >
<ui:Instance template="EditorTopToolbar" name="EditorTopToolbar" />
<ui:Instance template="EditorTopToolbar" name="EditorTopToolbar" pickingMode="Ignore" />
<ui:Instance template="EditorMainWindow" name="EditorMainWindow" />
<ui:Instance template="EditorBottomToolbar" name="EditorBottomToolbar" />
</ui:VisualElement>
Expand Down
6 changes: 5 additions & 1 deletion Editor/SkinningModule/CopyTool.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEditor.U2D.Common;
using UnityEditor.U2D.Layout;
Expand Down Expand Up @@ -317,17 +318,20 @@ public void OnPasteActivated(bool shouldPasteBones, bool shouldPasteMesh, bool s
pastedBonesToSelect.Add(newBone);
}

var pastedToSprites = new List<SpriteCache>();
foreach (var copySpriteData in skinningCopyData.copyData)
{
SpriteCache sprite = null;
if (selectedSprite != null && !doesCopyContainMultipleSprites)
sprite = selectedSprite;
if (sprite == null && !string.IsNullOrEmpty(copySpriteData.spriteName))
sprite = FindSpriteWithName(sprites, copySpriteData.spriteName);
sprite = FindSpriteWithName(sprites.Except(pastedToSprites).ToList(), copySpriteData.spriteName) ?? FindSpriteWithName(sprites, copySpriteData.spriteName);

if (sprite == null)
continue;

pastedToSprites.Add(sprite);

var boneMapping = new Dictionary<string, string>();
if (shouldPasteBones && !replaceCharacterSkeleton)
{
Expand Down
19 changes: 19 additions & 0 deletions Editor/SpriteLib/SpriteLibraryEditor/DragAndDropData.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using UnityEngine;

namespace UnityEditor.U2D.Animation.SpriteLibraryEditor
{
internal enum SpriteSourceType
{
Sprite,
Psb
}

internal struct DragAndDropData
{
public SpriteSourceType spriteSourceType;
public string name;
public List<Sprite> sprites;
}
}
256 changes: 0 additions & 256 deletions Editor/SpriteLib/SpriteLibraryEditor/DragAndDropHandler.cs

This file was deleted.

Loading

0 comments on commit cbf2d6b

Please sign in to comment.