From a5f6b307badff845e65984612308d6fc356335fe Mon Sep 17 00:00:00 2001 From: Unity Technologies <@unity> Date: Mon, 31 Aug 2020 00:00:00 +0000 Subject: [PATCH] com.unity.2d.psdimporter@4.0.2 ## [4.0.2] - 2020-08-31 ### Fixed - Fixed importing files with vector layers generates textures incorrectly (case 1266986) - Fixed Sprite Editor Window doesn't show the Sprite when the Inspector is locked and the Sprite is not selected in the Project window --- CHANGELOG.md | 4 ++++ Editor/PSDImporterEditor.cs | 4 ++-- Editor/PSDPlugin/PDNWrapper/PDNDecodeJob.cs | 7 ++++--- package.json | 12 ++++++------ 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 246a3f5..56dddcb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # Changelog +## [4.0.2] - 2020-08-31 +### Fixed +- Fixed importing files with vector layers generates textures incorrectly (case 1266986) +- Fixed Sprite Editor Window doesn't show the Sprite when the Inspector is locked and the Sprite is not selected in the Project window ## [4.0.1] - 2020-07-07 ### Fixed diff --git a/Editor/PSDImporterEditor.cs b/Editor/PSDImporterEditor.cs index 2333abf..825692c 100644 --- a/Editor/PSDImporterEditor.cs +++ b/Editor/PSDImporterEditor.cs @@ -633,7 +633,7 @@ void DoSpriteInspector() dialogText, s_Styles.applyButtonLabel.text, s_Styles.revertButtonLabel.text)) { ApplyAndImport(); - InternalEditorBridge.ShowSpriteEditorWindow(); + InternalEditorBridge.ShowSpriteEditorWindow(this.assetTarget); // We reimported the asset which destroyed the editor, so we can't keep running the UI here. GUIUtility.ExitGUI(); @@ -641,7 +641,7 @@ void DoSpriteInspector() } else { - InternalEditorBridge.ShowSpriteEditorWindow(); + InternalEditorBridge.ShowSpriteEditorWindow(this.assetTarget); } } GUILayout.EndHorizontal(); diff --git a/Editor/PSDPlugin/PDNWrapper/PDNDecodeJob.cs b/Editor/PSDPlugin/PDNWrapper/PDNDecodeJob.cs index 71819ae..76fb3e7 100644 --- a/Editor/PSDPlugin/PDNWrapper/PDNDecodeJob.cs +++ b/Editor/PSDPlugin/PDNWrapper/PDNDecodeJob.cs @@ -513,24 +513,25 @@ private void ApplyPDNMask(int dstStart, int dstStops) var maskAlpha = (0 == Data.HasLayerAlphaMask) ? Data.UserAlphaMask : Data.LayerAlphaMask; var maskStart = 0; { - var c = Data.DecodedImage[dstStart]; while (dstStart < dstStops) { + var c = Data.DecodedImage[dstStart]; c.a = (byte)(Data.DecodedImage[dstStart].a * maskAlpha[maskStart] / 255); Data.DecodedImage[dstStart] = c; + dstStart++; maskStart++; } - } + } } // Apply both masks in one pass, to minimize rounding error else { var maskStart = 0; - var c = Data.DecodedImage[dstStart]; { while (dstStart < dstStops) { + var c = Data.DecodedImage[dstStart]; var alphaFactor = (Data.LayerAlphaMask[maskStart]) * (Data.UserAlphaMask[maskStart]); c.a = (byte)(Data.DecodedImage[dstStart].a * alphaFactor / 65025); Data.DecodedImage[dstStart] = c; diff --git a/package.json b/package.json index 5f4fccf..ad63bd4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.unity.2d.psdimporter", - "version": "4.0.1", + "version": "4.0.2", "unity": "2020.2", "unityRelease": "0a19", "displayName": "2D PSD Importer", @@ -12,19 +12,19 @@ ], "category": "2D", "dependencies": { - "com.unity.2d.common": "4.0.1", - "com.unity.2d.animation": "5.0.1", + "com.unity.2d.common": "4.0.2", + "com.unity.2d.animation": "5.0.2", "com.unity.2d.sprite": "1.0.0" }, "relatedPackages": { - "com.unity.2d.psdimporter.tests": "4.0.1" + "com.unity.2d.psdimporter.tests": "4.0.2" }, "upmCi": { - "footprint": "8f06a9aae8646933a40d67cc3ac738f21194b732" + "footprint": "37d303850b7c31729b17df490e53843ba578aada" }, "repository": { "url": "https://github.cds.internal.unity3d.com/unity/2d.git", "type": "git", - "revision": "7d7470f4ca0ea8353d4c9640b3b6ae9d1ebd9c1d" + "revision": "4e96f68a7587d87b4fee15d6f88a5d86c2afa9aa" } }