Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
## [5.0.4] - 2021-06-08
### Fixed
- Fixed changing PSD Importer inspector fields causes UnityEditor.ObjectPreview errors. (Case 1335593)
- Fixed PSDImporter always reimports .psb files when switching build platforms. (Case 1330376)
- Fixed inconsistency while importing
  • Loading branch information
Unity Technologies committed Jun 8, 2021
1 parent 293e2c1 commit 790a7c7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 15 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [5.0.4] - 2021-06-08
### Fixed
- Fixed changing PSD Importer inspector fields causes UnityEditor.ObjectPreview errors. (Case 1335593)
- Fixed PSDImporter always reimports .psb files when switching build platforms. (Case 1330376)
- Fixed inconsistency while importing

## [5.0.3] - 2021-03-28
### Fixed
- Fixed package description
Expand Down
19 changes: 11 additions & 8 deletions Editor/PSDImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace UnityEditor.U2D.PSD
/// <summary>
/// ScriptedImporter to import Photoshop files
/// </summary>
[ScriptedImporter(5, "psb")]
[ScriptedImporter(5, "psb", AllowCaching = true)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.2d.psdimporter@latest")]
[MovedFrom("UnityEditor.Experimental.AssetImporters")]
public class PSDImporter : ScriptedImporter, ISpriteEditorDataProvider
Expand Down Expand Up @@ -768,7 +768,11 @@ void BuildGroupGameObject(List<PSDLayer> psdGroup, int index, Transform root)
}

if (psdGroup[index].gameObject != null)
{
psdGroup[index].gameObject.transform.SetParent(root);
psdGroup[index].gameObject.transform.SetSiblingIndex(root.childCount-1);
}

}
}

Expand Down Expand Up @@ -971,6 +975,7 @@ GameObject OnProducePrefab(string assetname, Sprite[] sprites, SpriteLibraryAsse
var currentCharacterData = characterData;
var spriteImportData = GetSpriteImportData();
root = new GameObject();
root.transform.SetSiblingIndex(0);
root.name = assetname + "_GO";
if (spriteLib != null)
root.AddComponent<SpriteLibrary>().spriteLibraryAsset = spriteLib;
Expand Down Expand Up @@ -1479,9 +1484,7 @@ SpriteLibraryAsset ProduceSpriteLibAsset(Sprite[] sprites)
{
if (!characterMode || m_SpriteCategoryList.categories == null)
return null;
var sla = ScriptableObject.CreateInstance<SpriteLibraryAsset>();
sla.name = "Sprite Lib";
sla.categories = m_SpriteCategoryList.categories.Select(x =>
var categories = m_SpriteCategoryList.categories.Select(x =>
new SpriteLibCategory()
{
name = x.name,
Expand All @@ -1495,11 +1498,11 @@ SpriteLibraryAsset ProduceSpriteLibAsset(Sprite[] sprites)
};
}).ToList()
}).ToList();
sla.categories.RemoveAll(x => x.categoryList.Count == 0);
if (sla.categories.Count > 0)
categories.RemoveAll(x => x.categoryList.Count == 0);
if(categories.Count > 0)
{
sla.UpdateHashes();
return sla;
// Always set version to 0 since we will never be updating this
return SpriteLibraryAsset.CreateAsset(categories, "Sprite Lib", 0);
}
return null;
}
Expand Down
2 changes: 0 additions & 2 deletions Editor/PSDImporterEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,6 @@ protected override void Apply()
AnalyticFactory.analytics.SendApplyEvent(evt);
m_TexturePlatformSettingsHelper.Apply();
base.Apply();
Selection.activeObject = null;
Unsupported.SceneTrackerFlushDirty();
PSDImportPostProcessor.currentApplyAssetPath = ((PSDImporter) target).assetPath;
}

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.psdimporter",
"version": "5.0.3",
"version": "5.0.4",
"unity": "2021.1",
"displayName": "2D PSD Importer",
"description": "A ScriptedImporter for importing Adobe Photoshop PSB (Photoshop Big) file format. The ScriptedImporter is currently targeted for users who wants to create multi Sprite character animation using Unity 2D Animation Package.",
Expand All @@ -12,18 +12,18 @@
"category": "2D",
"dependencies": {
"com.unity.2d.common": "5.0.0",
"com.unity.2d.animation": "6.0.3",
"com.unity.2d.animation": "6.0.4",
"com.unity.2d.sprite": "1.0.0"
},
"relatedPackages": {
"com.unity.2d.psdimporter.tests": "5.0.3"
"com.unity.2d.psdimporter.tests": "5.0.4"
},
"upmCi": {
"footprint": "5aba28318664e28475f9e448bb3d02a1eed2fca5"
"footprint": "1da681dad3757f9f1df6c28bb61147f39f94e47c"
},
"repository": {
"url": "https://github.cds.internal.unity3d.com/unity/2d.git",
"type": "git",
"revision": "8752f08cdd2aa2a0153c9c70e2affdb28ccfe4bd"
"revision": "c6acc0f0e19f89c41e384fa1a602555072cbb8cc"
}
}

0 comments on commit 790a7c7

Please sign in to comment.