diff --git a/CHANGELOG.md b/CHANGELOG.md index 5537bad..a08e9e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ # Changelog + +## [8.0.3] - 2023-10-25 +### Fixed +- Fixed an issue where PSDImporter atlas size does not follow PVRTC compression format for the iOS platform + ## [8.0.2] - 2022-12-01 ### Fixed - Fixed an issue where the editor would crash when importing .psd/.psb files with their layers outside of the document canvas. (Case DANB-300) diff --git a/Documentation~/PSD-importer-properties.md b/Documentation~/PSD-importer-properties.md index 18ef391..ff0293c 100644 --- a/Documentation~/PSD-importer-properties.md +++ b/Documentation~/PSD-importer-properties.md @@ -51,11 +51,11 @@ The Settings tab allows you to customize how the PSD Importer imports a file. Th Extrude Edges - Select Sprite (2D and UI) to import the Texture as a Sprite. The is required to begin using the imported Texture with the 2D Animation package. + Use the slider to determine how much to extend the Mesh from the edge of the Sprite. Generate Physics Shape - Select Sprite (2D and UI) to import the Texture as a Sprite. The is required to begin using the imported Texture with the 2D Animation package. + Enable this option to generate a default [Physics Shape](https://docs.unity3d.com/2017.4/Documentation/Manual/SpritePhysicsShapeEditor.html) from the outline of the Sprite, if a [Custom Physics Shape](https://docs.unity3d.com/Manual/CustomPhysicsShape.html) has not be defined Automatic Reslice diff --git a/Editor/PSDImporter.cs b/Editor/PSDImporter.cs index c2c0faf..6181a54 100644 --- a/Editor/PSDImporter.cs +++ b/Editor/PSDImporter.cs @@ -533,7 +533,10 @@ TextureGenerationOutput ImportFromLayers(AssetImportContext ctx) var layerIndex = new List(); var spriteNameHash = new UniqueNameGenerator(); - + + var platformSettings = TextureImporterUtilities.GetPlatformTextureSettings(ctx.selectedBuildTarget, in m_PlatformSettings); + bool requireSquarePOT = (TextureImporterFormat.PVRTC_RGB2 <= platformSettings.format && platformSettings.format <= TextureImporterFormat.PVRTC_RGBA4); + var oldPsdLayers = GetPSDLayers(); List psdLayers = null; try @@ -584,7 +587,7 @@ TextureGenerationOutput ImportFromLayers(AssetImportContext ctx) } } - ImagePacker.Pack(layerBuffers.ToArray(), layerWidth.ToArray(), layerHeight.ToArray(), m_Padding, m_SpriteSizeExpand, out outputImageBuffer, out int width, out int height, out RectInt[] spriteData, out Vector2Int[] uvTransform); + ImagePacker.Pack(layerBuffers.ToArray(), layerWidth.ToArray(), layerHeight.ToArray(), m_Padding, m_SpriteSizeExpand, out outputImageBuffer, out int width, out int height, out RectInt[] spriteData, out Vector2Int[] uvTransform, requireSquarePOT); var packOffsets = new Vector2[spriteData.Length]; for (var i = 0; i < packOffsets.Length; ++i) diff --git a/package.json b/package.json index b5b672c..c0ed010 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.unity.2d.psdimporter", - "version": "8.0.2", + "version": "8.0.3", "unity": "2022.2", "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.", @@ -11,23 +11,23 @@ ], "category": "2D", "dependencies": { - "com.unity.2d.animation": "9.0.1", - "com.unity.2d.common": "8.0.1", + "com.unity.2d.animation": "9.0.4", + "com.unity.2d.common": "8.0.2", "com.unity.2d.sprite": "1.0.0" }, "relatedPackages": { - "com.unity.2d.psdimporter.tests": "8.0.2" + "com.unity.2d.psdimporter.tests": "8.0.3" }, "_upm": { - "changelog": "### Fixed\n- Fixed an issue where the editor would crash when importing .psd/.psb files with their layers outside of the document canvas. (Case DANB-300)\n- Fixed an issue where the amount of alpha removed from layers would not be re-applied as final position offset of the layers.\n- Fixed an issue where the generated GameObjects would be laid out differently from how they appear in the DCC tool. (Case DANB-298)" + "changelog": "### Fixed\n- Fixed an issue where PSDImporter atlas size does not follow PVRTC compression format for the iOS platform" }, "upmCi": { - "footprint": "8ef88654f594021fbcd7ef795e2659378442556f" + "footprint": "ca08b3c5a2d01baceba95f608078f58419ae0893" }, "documentationUrl": "https://docs.unity3d.com/Packages/com.unity.2d.psdimporter@8.0/manual/index.html", "repository": { "url": "https://github.cds.internal.unity3d.com/unity/2d.git", "type": "git", - "revision": "fc4212736e8bcb753039f1a18964b98d929e4093" + "revision": "b7537404d2cb8ef24b567ac4733b4c586fb25b44" } }