Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
## [6.0.8] - 2023-10-25
### Fixed
- Fixed an issue where PSDImporter atlas size does not follow PVRTC compression format for the iOS platform
  • Loading branch information
Unity Technologies committed Oct 25, 2023
1 parent 8cf1940 commit 3481609
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Changelog
## [6.0.8] - 2023-10-25
### Fixed
- Fixed an issue where PSDImporter atlas size does not follow PVRTC compression format for the iOS platform

## [6.0.7] - 2022-12-01
### Fixed
- Fixed an issue where the amount of alpha removed from layers would not be re-applied as final position offset of the layers.
Expand Down
7 changes: 5 additions & 2 deletions Editor/PSDImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,10 @@ void ImportFromLayers(AssetImportContext ctx)

var layerIndex = new List<int>();
var spriteNameHash = new UniqueNameGenerator();


var platformSettings = GetPlatformTextureSettings(ctx.selectedBuildTarget);
bool requireSquarePOT = (TextureImporterFormat.PVRTC_RGB2 <= platformSettings.format && platformSettings.format <= TextureImporterFormat.PVRTC_RGBA4);

var oldPsdLayers = GetPSDLayers();
List<PSDLayer> psdLayers = null;
try
Expand Down Expand Up @@ -562,7 +565,7 @@ void ImportFromLayers(AssetImportContext ctx)
}

const int padding = 4;
ImagePacker.Pack(layerBuffers.ToArray(), layerWidth.ToArray(), layerHeight.ToArray(), padding, out output, out int width, out int height, out RectInt[] spriteData, out Vector2Int[] uvTransform);
ImagePacker.Pack(layerBuffers.ToArray(), layerWidth.ToArray(), layerHeight.ToArray(), padding, out output, 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)
Expand Down
15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.unity.2d.psdimporter",
"version": "6.0.7",
"version": "6.0.8",
"unity": "2021.2",
"unityRelease": "7f1",
"displayName": "2D PSD Importer",
Expand All @@ -12,20 +12,23 @@
],
"category": "2D",
"dependencies": {
"com.unity.2d.animation": "7.0.9",
"com.unity.2d.common": "6.0.6",
"com.unity.2d.animation": "7.0.13",
"com.unity.2d.common": "6.0.7",
"com.unity.2d.sprite": "1.0.0"
},
"relatedPackages": {
"com.unity.2d.psdimporter.tests": "6.0.7"
"com.unity.2d.psdimporter.tests": "6.0.8"
},
"_upm": {
"changelog": "### Fixed\n- Fixed an issue where PSDImporter atlas size does not follow PVRTC compression format for the iOS platform"
},
"upmCi": {
"footprint": "7d4f681e80410f174a7f368ce8f1ca173091ba92"
"footprint": "26fb4e88d2fa9a182c2864b9a45d88ce5d1477a5"
},
"documentationUrl": "https://docs.unity3d.com/Packages/[email protected]/manual/index.html",
"repository": {
"url": "https://github.cds.internal.unity3d.com/unity/2d.git",
"type": "git",
"revision": "911204bb63dcf2da80b6063d54c4ec8737ad13dc"
"revision": "681660f0ddc6412f1c6ffdc2f6433c5cc5adbe06"
}
}

0 comments on commit 3481609

Please sign in to comment.