Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
## [8.0.3] - 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 80ef6dc commit 432fb13
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 2 additions & 2 deletions Documentation~/PSD-importer-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ The Settings tab allows you to customize how the PSD Importer imports a file. Th
</tr>
<tr>
<td rowspan="1"><strong>Extrude Edges</strong></td>
<td colspan="2">Select <a href="https://docs.unity3d.com/Manual/TextureTypes.html#Sprite"> Sprite (2D and UI)</a> to import the Texture as a <a href="https://docs.unity3d.com/Manual/Sprites.html">Sprite</a>. The is required to begin using the imported Texture with the <a href="https://docs.unity3d.com/Packages/com.unity.2d.animation@latest/">2D Animation</a> package.</td>
<td colspan="2">Use the slider to determine how much to extend the Mesh from the edge of the Sprite.</td>
</tr>
<tr>
<td rowspan="1"><strong>Generate Physics Shape</strong></td>
<td colspan="2">Select <a href="https://docs.unity3d.com/Manual/TextureTypes.html#Sprite"> Sprite (2D and UI)</a> to import the Texture as a <a href="https://docs.unity3d.com/Manual/Sprites.html">Sprite</a>. The is required to begin using the imported Texture with the <a href="https://docs.unity3d.com/Packages/com.unity.2d.animation@latest/">2D Animation</a> package.</td>
<td colspan="2">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</td>
</tr>
<tr>
<td rowspan="1"><strong><a href="#automatic-reslice">Automatic Reslice</a></strong></td>
Expand Down
7 changes: 5 additions & 2 deletions Editor/PSDImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,10 @@ TextureGenerationOutput ImportFromLayers(AssetImportContext ctx)

var layerIndex = new List<int>();
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<PSDLayer> psdLayers = null;
try
Expand Down Expand Up @@ -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)
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -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.",
Expand All @@ -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/[email protected]/manual/index.html",
"repository": {
"url": "https://github.cds.internal.unity3d.com/unity/2d.git",
"type": "git",
"revision": "fc4212736e8bcb753039f1a18964b98d929e4093"
"revision": "b7537404d2cb8ef24b567ac4733b4c586fb25b44"
}
}

0 comments on commit 432fb13

Please sign in to comment.