diff --git a/CHANGELOG.md b/CHANGELOG.md index 25f060f..cccc7f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [3.0.0] - 2019-11-06 +### Changed +- Update version number for Unity 2020.1 +- Update documentation + +## [2.0.6] - 2019-10-18 +### Fixed +- Fixed SpriteRect name clash when Photoshop layer is renamed to the same name as an exisiting user created SpriteRect + ## [2.0.5] - 2019-08-06 ### Fixed - Physics Shape not saved into Sprite when importing with AssetDatabase V2 diff --git a/Documentation~/PSDImporter.md b/Documentation~/PSDImporter.md index f642348..31260bd 100644 --- a/Documentation~/PSDImporter.md +++ b/Documentation~/PSDImporter.md @@ -1,131 +1,162 @@ -# PSD Importer +# Summary -## Summary +The PSD Importer is an Asset importer that is specialized for importing Adobe Photoshop .psb files into Unity and generating a Prefab made of Sprites based on the source file. The .psb file format is functionally identical to the more common Adobe .psd format and can support much larger images than the .psd format (up to 300,000 by 300,000 pixels in size). -The __PSD Importer__ is a custom Asset Importer made to import Adobe Photoshop’s PSB files into Unity. The PSB file format is functionally identical to the more common Adobe PSD format, with the additional ability to support much larger images than the PSD format (up to 300,000 by 300,000 pixels in size). +You can save or convert your Photoshop artwork files into the .psb format and import them into Unity with the PSD Importer. When you import .psb files with the PSD Importer, you can use features such as [Mosaic](#Mosaic) to automatically generate a Sprite sheet from the imported layers; or [Character Rig](#Rig) where Unity reassembles the Sprites of a character as they are arranged in their source files. -Users saving or converting their PSD working files to the PSB format can import their work with the PSD Importer, and take advantage of the additional functionality and features provided by the importer. +## Non-importable Photoshop effects -## Supported Functions and Modes +The PSD Importer only supports two [Texture Modes](https://docs.unity3d.com/Manual/TextureTypes.html): [Default](https://docs.unity3d.com/Manual/TextureTypes.html#Default) and [Sprite](https://docs.unity3d.com/Manual/TextureTypes.html#Sprite). Other Texture Modes might be supported in the future. -The importer currently supports 2 __Texture Modes__ - [Default](https://docs.unity3d.com/Manual/TextureTypes.html#Default) and [Sprite](https://docs.unity3d.com/Manual/TextureTypes.html#Sprite). More Texture Modes will be supported in the future. +The following Photoshop features are not supported by the PSD Importer and it ignores the following layer effects and features while it generates Sprites: -The following Photoshop features are __not__ supported by the PSD Importer __:__ +* Channels -* Channels * Blend Modes + * Layer Opacity + * Effects -You can associate additional Textures to Sprites generated by the PSD Importer, with the Sprite Editor’s [Secondary Textures](https://docs.unity3d.com/Manual/SpriteEditor-SecondaryTextures.html) module. A __Shader__ can then sample these secondary Textures to apply additional effects on the Sprite, such as normal mapping. Refer to Sprite Editor: Secondary Textures](https://docs.unity3d.com/Manual/SpriteEditor-SecondaryTextures.html) for more information. +You can also add additional Textures to the Sprites with the [Sprite Edito](https://docs.unity3d.com/Manual/SpriteEditor.html)r’s [Secondary Textures](https://docs.unity3d.com/Manual/SpriteEditor-SecondaryTextures.html) module. Shaders can sample these Secondary Textures to apply additional effects to the Sprite, such as normal mapping. For more information, see documentation on [Sprite Editor: Secondary Textures](https://docs.unity3d.com/Manual/SpriteEditor-SecondaryTextures.html). -## Inspector settings +## Inspector properties + +After importing a .psb file into your Project, select the Asset file to find the following properties in its Inspector window. ### Texture Type - Default -This is the default __Texture Type__ usage when an image is imported without a specific Texture Type selected. Refer to the documentation on [Texture Types](https://docs.unity3d.com/Manual/TextureTypes.html) for further information and details. +This is the default Texture Type that Unity uses when you import an image without a specific Texture Type selected. For more information, refer to the documentation on [Texture Types](https://docs.unity3d.com/Manual/TextureTypes.html). ### Texture Type - Sprite (2D and UI) -![PSD Importer inspect settings](images/PSDImporter_2.0.5_Inspector.png) - -When importing a PSB file for character animation with the __2D Animation__ package, set the __Texture Type__ to __Sprite (2D and UI)__. +![](images/propertysettings.png)
_Importer Inspector properties_ -Property settings that are specific to the __PSD Importer__ are marked by an *. +Set the Texture Type to __Sprite (2D and UI)__ when you want to import a .psb file with character graphics on multiple layers. The following property settings are available: -| Property      | Function | +| Property | Function | | ------------------------------------------------------------ | ------------------------------------------------------------ | -| __Texture Type__ | Select __Sprite (2D and UI)__ to import the Texture as a [Sprite](https://docs.unity3d.com/Manual/Sprites.html). This is required to begin using the imported images with the 2D Animation package. | +| __Texture Type__ | Select [Sprite (2D and UI)](https://docs.unity3d.com/Manual/TextureTypes.html#Sprite) to import the Texture as a [Sprite](https://docs.unity3d.com/Manual/Sprites.html). This is required to begin using the imported images with the [2D Animation](https://docs.unity3d.com/Packages/com.unity.2d.animation@latest/) package. | | __Sprite Mode__ | Use this property to specify how Unity extracts the Sprite graphic from the image. The default option is __Multiple__. | -|         Single | Select this option if there is only a single element in the imported image. | -|         Multiple | Select this option if there are multiple elements in the imported image. Select this option when importing a character meant for animation with the 2D Animation package. | -| __Pixels Per Unit__ | The number of pixels that equal 1 Unity unit. | -| __Mesh Type__ | This defines the __Mesh__ type that is generated for the __Sprite__. This is set to __Tight__ by default. | -|         [Full Rect](https://docs.unity3d.com/Documentation/ScriptReference/SpriteMeshType.FullRect.html) | The Sprite is mapped onto a mesh generated as a quad. | -|         [Tight](https://docs.unity3d.com/Documentation/ScriptReference/SpriteMeshType.Tight.html) | This generates a Mesh based on pixel alpha value of the image, generating a shape that follows the shape of the Sprite. Note that any Sprite that is smaller than 32x32 pixels is generated on a quad Mesh, even if Tight is specified. | -| __Extrude Edges__ | Use the slider to determine how much area to leave around the Sprite in the generated Mesh. | -| __Import Hidden__ | Enable this property to include hidden layers when importing the PSB. This produces the same import result as unhiding all layers in the source file before importing it into Unity. Clear this option to only import visible layers. | -| __Mosaic__ | This option is only available if Texture Type is set to __Multiple__. Enable this to have Unity generate a Sprite from each imported layer and arrange them into a Sprite Sheet layout. | -| __[Character Rig](#CharRig)__ | Enable this property to generate a Prefab from the imported source file for a multi-Sprite character. | -| __Use Layer Grouping__ | Enable this setting to have Unity generate a Prefab that follows the layer and grouping hierarchy of the imported PSB file. | -| __Pivot__ | Select the pivot point of the Sprite from the dropdown menu options. | -|         Custom | Define the X and Y coordinates of a custom __Pivot__ location. | -| __[Reslice](#Reslice)__ | Available only when __Mosaic__ is enabled. Select this to clear away any usermade changes to the Sprite previous Sprite metadata and recreate the Sprite from the imported PSB layers. | -| __Experimental__ | This feature is experimental and may be changed or removed in the future. It is only available for the following Editor and package versions:
- __Unity 2019.2__: 2D PSD Importer version 1.2.0-preview.4 onwards
- __Unity 2019.3__: 2D PSD Importer version 2.0.5 onwards | -|         [Keep Duplicate Name](#Duplicate) | Enable this to have Unity generate Sprites from the source files with the exact same name as their source Layers, even when there are multiple Layers with the same exact name. | +|     Single | Choose this option if the imported image contains a single element. | +|     Multiple | This is the default option. Choose this option if the imported image contains multiple elements. Choose this option when importing artwork meant for animation with the [2D Animation](https://docs.unity3d.com/Packages/com.unity.2d.animation@latest/) package. | +| __Pixels Per Unit__ | The number of pixels that equal to one Unity unit. | +| __Mesh Type__ | This defines the __Mesh__ type that Unity generates for the __Sprite__. This is set to __Tight__ by default. | +|     [Full Rect](https://docs.unity3d.com/Documentation/ScriptReference/SpriteMeshType.FullRect.html) | Unity maps the Sprite onto a rectangular Mesh. | +|     [Tight](https://docs.unity3d.com/Documentation/ScriptReference/SpriteMeshType.Tight.html) | Unity generates a Mesh based on the outline of the Sprite. If the Sprite is smaller than 32 x 32 pixels, Unity always maps it onto a __Full Rect__ quad Mesh, even if you select __Tight__. | +| [__Extrude Edges__](https://docs.unity3d.com/Manual/Glossary.html#ExtrudeEdges) | Use the slider to determine how much to extend the Mesh from the edge of the Sprite. | +| __Import Hidden__ | Enable this property to include the hidden [layers](https://helpx.adobe.com/photoshop/using/layer-basics.html#layers_panel_overview) of the .psb file in the import. This produces the same import result as making all layers visible in the source file unhiding all layers in the source file before you importing it into Unity. Clear this option if you want to only import the visible layers in the .psb file. | +| __Mosaic__ | This setting is only available if you set the __Texture Type__ to __Multiple__. Enable this setting to make the PSD Importer generate Sprites from the imported layers and combine them into a single Texture in a Sprite sheet layout. | +| [__Character Rig__](#Rig) | Enable this property to make the importer generate a [Prefab](https://docs.unity3d.com/Manual/Prefabs.html) based on the imported source file. The PSD Importer generates Sprites from the imported layers of the source file, and the Sprites’ [hierarchy](https://docs.unity3d.com/Manual/Hierarchy.html) and positions are based on their [layer hierarchy](https://helpx.adobe.com/photoshop/using/layer-basics.html#layers_panel_overview) and their positions in the .psb file. | +| __Use Layer Grouping__ | This setting is only available when you enable __Character Rig__. Enable this setting to make the importer generate a Prefab that follows the layer and grouping hierarchy of the imported .psb. file. | +| __Pivot__ | Choose the pivot point of the Sprite. | +|      Custom | Define the X and Y coordinates of a custom __Pivot__ location. | +| [__Reslice__](#Reslice) | Available only when you enable __Mosaic__. Enable this setting to regenerate the Sprite from the imported layers and clear any changes you have made to the Sprite and its metadata. | +| __Experimental__ | The following feature is experimental and might be changed or removed in the future. It is only available for the following Editor and package versions:
- __Unity 2019.2__: 2D PSD Importer version 1.2.0-preview.4 or newer.
- __Unity 2019.3__: 2D PSD Importer version 2.0.5 or newer. | +|      [Keep Duplicate Name](#Duplicate) | Enable this setting to make the PSD Importer generate Sprites from the source files with the exact same name as their source layers, even when there are multiple layers with the same name. | -## SpriteRect data -The __PSD Importer__ can store 4 possible sets of SpriteRect data, depending on the properties selected when importing an image. -The 4 sets are created by enabling the following property combinations: +## Property details -1. Sprite Mode: Single +### Character Rig -2. Sprite Mode: Multiple +The __Character Rig__ setting makes the PSD Importer generate a Prefab that contains [Sprites](https://docs.unity3d.com/Manual/Sprites.html) it generates from each layer of the imported source file. The PSD Importer automatically gives the Sprites an [Order in Layer](https://docs.unity3d.com/Manual/2DSorting.html#sortlayer) value that sorts them according to the layer hierarchy in the source file. This ensures that Unity recreates the character artwork in the correct order in the Prefab. -3. Sprite Mode: Multiple + Mosaic +The name of each Sprite in the Prefab is the same as their respective source layer, unless a [name collision error](#NameCollision) occurs, which is usually due to duplicate names in the source layers. -4. Sprite Mode: Multiple + Mosaic + Character Rig +If the Sprite contains bone or weight data, the PSD Importer automatically adds the __Sprite Skin__ component to it. This happens if the Sprite has been [rigged](https://docs.unity3d.com/Packages/com.unity.2d.animation@3.0/manual/CharacterRig.html) with bones and weights in the [Skinning Editor](https://docs.unity3d.com/Packages/com.unity.2d.animation@3.0/manual/SkinningEditor.html) already and the source file is being reimported, or you have manually [copied and pasted](https://docs.unity3d.com/Packages/com.unity.2d.animation@3.0/manual/CopyPasteSkele.html) the bone and weight data onto the Sprites. -#### User defined SpriteRect +Refer to the examples below of a character designed in Photoshop with its various parts and limbs separated onto different layers. -When the user manually creates a SpriteRect in the Sprite Editor window, the SpriteRect persists even when the Asset has changed. It persists until the user manually deletes the SpriteRect or reimports it with the __Reslice__ option. The position of the SpriteRect does not change even when the size the __Mosaic__ texture changes. +![](images/PhotoshopSetup.png)
_Character artwork in Photoshop with different parts separated into different Photoshop layers._ -#### Modifying the SpriteRect in the Sprite Editor window +![](images/LayerHierarchy.png)
_The generated Prefab with Sprites sorted according to the source file’s layer hierarchy._ -Any modification to a SpriteRect generated from an imported layer will persist and follow wherever the layer is placed in a Mosaic texture, even if it is reimported. +![](images/LayerGrouping.png)
_The Prefab with the Layer Grouping setting enabled._ -| ![](images/PSDImporter_SpriteRect1.png) | ![](images/PSDImporter_SpriteRect2.png) | -| ------------------------------------------------------------ | ---------------------------------------------------------- | -| A generated SpriteRect with an imported Layer Sprite that has been modified. | The modified SpriteRect follows where the layer is placed. | +### Reslice -If the name of the generated SpriteRect is changed, the changed name persists and changes to the layer in the source file are not reflected. +Enable this setting to discard all user modifications for the current set of SpriteRect data and regenerate all SpriteRects based on the current source file. Extra SpriteRect metadata (such as weights and bones data) persist if they remain valid with the regenerated SpriteRects. -If the generated SpriteRect is deleted, it is regenerated when its source layer is reimported, and the source layer both exists and is visible in the source file. -### Effect on SpriteRect when source files are modified -| Modification | Effect | -| ----------------------------------------------- | ------------------------------------------------------------ | -| **New layer added /Layer visibility turned on** | A new Sprite is automatically generated from the new layer. | -| **Layer deleted /Layer visibility turned off** | The Sprite and SpriteRect that was generated from the layer are deleted. | -| **Layer name changed** | The changed layer name is copied to the generated SpriteRect, if the SpriteRect's original name has not been modified by the user. | -| **Layer or canvas size changed** | The SpriteRects size does not change reflect changes made to the layer or canvas size in the source file. regardless if it was modified by the user. To have the SpriteRect reflect the changed size, manually edit the size or select the [Reslice](#Reslice) option. | +## How the PSD Importer uses SpriteRect data +The PSD Importer can store four separate sets of [SpriteRect](https://docs.unity3d.com/ScriptReference/Sprite-rect.html) data, with a set for each of the four combinations of importer property settings below: +1. __Sprite Mode__ set to __Single__. -## Property Details +2. __Sprite Mode__ set to __Multiple__. -### Character Rig +3. __Sprite Mode__ set to __Multiple,__ and __Mosaic__ enabled. -Enable this setting to generate a Prefab containing a Sprite GameObject with the SpriteRenderer component when importing the source file. If the Sprite contains bone and skin data, the __Sprite Skin__ component is added as well. The name of the GameObject is the same as the name specified in its SpriteRect. +4. __Sprite Mode__ set to __Multiple__, and both __Mosaic__ and __Character Rig__ enabled. -### Reslice +Each set of data is persistent, and does not affect or overwrite the data of other sets. This means you can save different SpriteRect data for different importer settings for the same source file. The SpriteRect data persists even if you modify the dimensions and position of images in the source file, as long as the original [Layer ID](https://github.com/adobe-photoshop/generator-core/wiki/Understanding-Layer-IDs-and-Layer-Indices) of the source layers remain the same. + + + +### Modifying the SpriteRect data + +The SpriteRect defines the location of the Sprite on the Texture that Unity generates from the imported source file. You can modify the location and size of each SpriteRect in the Sprite Editor. + +![](images/SpriteRect1.png)
_Original SpriteRect location of the ‘head’ Sprite on the combined Sprite sheet Texture._ + +![](images/SpriteRect2.png)
_Drag the corners of the SpriteRect to modify its dimensions and location, or enter the coordinates and dimensions in the Sprite panel._ + +A SpriteRect’s modified dimensions and location on the Texture is reflected for its respective Sprite in the Scene view. + +| ![](images/SpriteRect_table1.png) | ![](images/SpriteRect_table2.png) | +| ------------------------------------------------------------ | ------------------------------------------------------------ | +| _Original character prefab and its ‘head’ Sprite with unmodified SpriteRect data._ | _Character prefab with its ‘head’ Sprite’s SpriteRect data modified._ | + + +When you enable the [Mosaic](#Mosaic) importer setting, the PSD Importer arranges the different layers of the source file together to form a single combined Texture when you import it. The importer generates a SpriteRect for each of these imported layers, and follows the position of its associated layer wherever it is placed in the Mosaic Texture. + +![](images/MovedSpriteRect.png)
_The SpriteRect of the ‘head’ layer. The SpriteRect has been moved from its original position._ + +![](images/SpriteRect_following.png)
_The source file reimported after hiding several layers. The SpriteRect follows the ‘head’ layer’s placement in the new Texture._ + +However, a SpriteRect’s size and position remains the same if you change the image or canvas size of its source layer in the source file. You must manually edit the size and position of the SpriteRect in the Sprite Editor, or select and apply the [Reslice](#heading=h.i7pxu2xdxrji) option to regenerate it from the source file. + +![](images/OriginalSpriteRect.png)
_Original position and size of the SpriteRect for the generated ‘head’ Sprite._ + +![image alt text](images/IncreaseSize.png)
_Position and size of the SpriteRect remains the same after increasing the image size of its source layer._ + +SpriteRect data persists until you manually delete the SpriteRect, or select the [Reslice](#heading=h.i7pxu2xdxrji) option and apply it in the importer settings. When you do this, Unity discards all user modifications for the current set of SpriteRect data and regenerates all the SpriteRects from the current source file. + +### Summary of source file modifications and their effects on SpriteRect data + +| __Modification to the source file__ | __Effect on SpriteRect data__ | +| ----------------------------------------------- | ------------------------------------------------------------ | +| __New layer added /layer visibility turned on__ | The PSD importer automatically generates a new Sprite from the new layer, or newly visible layer, with its associated SpriteRect. | +| __Layer deleted /layer visibility turned off__ | The Sprite and SpriteRect that the PSD Importer generated from the deleted or previously visible layer are also deleted from the Project file. | +| __Layer is renamed__ | By default, the SpriteRect copies the new name of its source layer. However if you rename the SpriteRect in the Sprite Editor, then it retains its modified name and does not copy the source layer’s new name. | +| __Layer or canvas size changed__ | When a source layer is resized, the size and position of its related SpriteRect remains the same and does not reflect the changes made to its source layer. To make the SpriteRect reflect the changes made to its source layer, manually edit the SpriteRect’s dimensions in the Sprite Editor or select and apply the [Reslice](#Reslice) option in the PSD Importer settings. | -When this is selected, all user modification is discarded and SpriteRects are regenerated based on the current source file data. Extra SpriteRect meta data (e.g. Weights, Bones) persist if they remain valid after the SpriteRects are regenerated. -### (Experimental) Keep Duplicate Names -Enable this feature to have Unity generate Sprites with exactly the same name as their source Layer, even when there are multiple Layers in the source file with the same names. This replaces the default import behavior where Unity appends “_[number]” to each Sprite when generating them from multiple source Layers with the same name. +## Name collision errors -## Name collision errors +A name collision error can happen due to the following : -A name collision can occur in the following ways: +1. Two or more layers in the imported source file have the same name. However, Photoshop [group layers](https://helpx.adobe.com/photoshop/using/selecting-grouping-linking-layers.html#group_and_link_layers) with the same names do not cause this issue. -1. 2 or more layers in the Asset has the same name. This does not affect Photoshop group name. +2. A new layer that the PSD Importer creates in the source file has the same name as a SpriteRect you have created or modified. -2. A new layer created in the Asset has the same name as a user created SpriteRect. +3. A layer is renamed to the same name as a SpriteRect you have modified. -3. A layer renamed to the same name as user created SpriteRect. +4. A previously hidden layer is made visible and imported, and it has the same name as an existing SpriteRect. -4. A previously hidden layer is imported and has the same name as an existing SpriteRect. +When a name collision occurs, one SpriteRect retains the original name while the other is appended with a running number. Which SpriteRect retains their original name is based on the following priority: -When a name collision occurs, one SpriteRect retains the original name while the rest will be appended with a running number. Which SpriteRect retains their original name is based on the following priority order: +1. A SpriteRect you have created or modified. -1. A user created SpriteRect. +2. The first layer in the source file, starting from the bottom of the layer stack. -2. The first layer in the file, starting from the bottom of the stack. +3. Currently existing SpriteRects in the Project. -3. Currently existing SpriteRects. +### Experimental feature: Keep duplicate names +Unity’s default import behavior when there are duplicate names is to append "_[number]" to Sprites and SpriteRects it generates from source layers with identical names. Enable this experimental feature to instead have Unity give both Sprites/SpriteRects the exact same name as their source layer even if they have duplicate names. diff --git a/Documentation~/images/IncreaseSize.png b/Documentation~/images/IncreaseSize.png new file mode 100644 index 0000000..69f840f Binary files /dev/null and b/Documentation~/images/IncreaseSize.png differ diff --git a/Documentation~/images/LayerGrouping.png b/Documentation~/images/LayerGrouping.png new file mode 100644 index 0000000..83f6570 Binary files /dev/null and b/Documentation~/images/LayerGrouping.png differ diff --git a/Documentation~/images/LayerHierarchy.png b/Documentation~/images/LayerHierarchy.png new file mode 100644 index 0000000..a9bcda0 Binary files /dev/null and b/Documentation~/images/LayerHierarchy.png differ diff --git a/Documentation~/images/MovedSpriteRect.png b/Documentation~/images/MovedSpriteRect.png new file mode 100644 index 0000000..4219cb3 Binary files /dev/null and b/Documentation~/images/MovedSpriteRect.png differ diff --git a/Documentation~/images/OriginalSpriteRect.png b/Documentation~/images/OriginalSpriteRect.png new file mode 100644 index 0000000..d812723 Binary files /dev/null and b/Documentation~/images/OriginalSpriteRect.png differ diff --git a/Documentation~/images/PhotoshopSetup.png b/Documentation~/images/PhotoshopSetup.png new file mode 100644 index 0000000..98be6d1 Binary files /dev/null and b/Documentation~/images/PhotoshopSetup.png differ diff --git a/Documentation~/images/SpriteRect1.png b/Documentation~/images/SpriteRect1.png new file mode 100644 index 0000000..6139da5 Binary files /dev/null and b/Documentation~/images/SpriteRect1.png differ diff --git a/Documentation~/images/SpriteRect2.png b/Documentation~/images/SpriteRect2.png new file mode 100644 index 0000000..eb19e2e Binary files /dev/null and b/Documentation~/images/SpriteRect2.png differ diff --git a/Documentation~/images/SpriteRect_following.png b/Documentation~/images/SpriteRect_following.png new file mode 100644 index 0000000..3b47786 Binary files /dev/null and b/Documentation~/images/SpriteRect_following.png differ diff --git a/Documentation~/images/SpriteRect_table1.png b/Documentation~/images/SpriteRect_table1.png new file mode 100644 index 0000000..e6b89b4 Binary files /dev/null and b/Documentation~/images/SpriteRect_table1.png differ diff --git a/Documentation~/images/SpriteRect_table2.png b/Documentation~/images/SpriteRect_table2.png new file mode 100644 index 0000000..7e6fab0 Binary files /dev/null and b/Documentation~/images/SpriteRect_table2.png differ diff --git a/Documentation~/images/propertysettings.png b/Documentation~/images/propertysettings.png new file mode 100644 index 0000000..29a8b2a Binary files /dev/null and b/Documentation~/images/propertysettings.png differ diff --git a/Documentation~/images/table1.png b/Documentation~/images/table1.png new file mode 100644 index 0000000..e8ba1a5 Binary files /dev/null and b/Documentation~/images/table1.png differ diff --git a/Documentation~/images/table2.png b/Documentation~/images/table2.png new file mode 100644 index 0000000..c4ed0a3 Binary files /dev/null and b/Documentation~/images/table2.png differ diff --git a/Editor/PSDImporter.cs b/Editor/PSDImporter.cs index 5407650..f1ba4ea 100644 --- a/Editor/PSDImporter.cs +++ b/Editor/PSDImporter.cs @@ -440,6 +440,14 @@ void ImportFromLayers(AssetImportContext ctx, Document doc) { spriteImportData.RemoveAll(x => removedLayersSprite.Contains(x.spriteID)); + // First look for any user created SpriteRect and add those into the name hash + foreach (var spriteData in spriteImportData) + { + var psdLayer = psdLayers.FirstOrDefault(x => x.spriteID == spriteData.spriteID); + if (psdLayer == null) + spriteNameHash.Add(spriteData.name.GetHashCode()); + } + foreach (var spriteData in spriteImportData) { var psdLayer = psdLayers.FirstOrDefault(x => x.spriteID == spriteData.spriteID); diff --git a/package.json b/package.json index cc294c2..f7c3710 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "com.unity.2d.psdimporter", - "version": "2.0.5", - "unity": "2019.3", - "unityRelease": "0b3", + "version": "3.0.0", + "unity": "2020.1", + "unityRelease": "0a10", "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.", "keywords": [ @@ -12,16 +12,16 @@ ], "category": "2D", "dependencies": { - "com.unity.2d.common": "2.0.2", - "com.unity.2d.animation": "3.0.5", + "com.unity.2d.common": "3.0.0", + "com.unity.2d.animation": "4.0.0", "com.unity.2d.sprite": "1.0.0" }, "relatedPackages": { - "com.unity.2d.psdimporter.tests": "2.0.5" + "com.unity.2d.psdimporter.tests": "3.0.0" }, "repository": { "type": "git", "url": "git@github.cds.internal.unity3d.com:unity/2d.git", - "revision": "32fbfc4d3040a10e35abd2efee35086c77b66837" + "revision": "b8688c8a88e8066298fc5f686b999b70d457883e" } }