Search Issue Tracker
Won't Fix
Votes
0
Found in
2021.3.16f1
Issue ID
UUM-23291
Regression
No
An incorrect sub-asset is picked from a sliced PSD atlas when PSD Importer is used
Steps to reproduce:
- Open the attached project
- Check out the somemenu.uxml file
It has two Visual Element items. The bottom one had its icon set via the object picker using the UI Builder. The top one had its icon path specified manually inside the .uxml file:
{color:#c191ff}<ui:VisualElement {color}{color:#85c46c}name{color}{color:#c9a26d}="shop-gem-icon1" {color}{color:#85c46c}picking-mode{color}{color:#c9a26d}="Ignore" {color}{color:#85c46c}style{color}{color:#c9a26d}="width: 100px; height: 100px; background-image: url({color}{color:#ffd49e}'{color}{color:#c9a26d}project://database/Assets/UI_atlas.psd#icon_rarity_01{color}{color:#ffd49e}'{color}{color:#c9a26d}); -unity-background-scale-mode: scale-to-fit;" {color}{color:#c191ff}/>{color}
This path corresponds to the sub-asset name under UI_atlas.psd.
However, upon expanding UI_atlas in the Project Window, we discover that there are two types of assets available under identical names. One set is loaded as GameObjects and the other one as Sprites.
The asset type this .uxml is looking for is Sprite, but it somehow picks up the GameObject version first. It results in the following error:
{quote}{{Assets/somemenu.uxml (line 2): warning: Unsupported type GameObject for asset at path 'Assets/UI_atlas.psd' ; only the following types are supported: Texture2D, RenderTexture, Sprite, VectorImage}}
{{Suggestion: verify the import settings of this asset.}}
{quote}
Note 1: Specifying the type via an an attribute (e.g. type=3) does not fix it.
Note 2: This only reproduces when the .psd file is using the UnityEditor.U2D.PSD.PSDImporter post-processor. Using the default UnityEditor.TextureImporter will work correcly.
Expected result: it either is resolved automatically as a "best guess" or at least force-setting the type works.
Actual result: cannot get the correct sub asset because of how the PSDImporter post-processor sets up sprites.
Reproducible with: 2021.3.16f1, 2023.1.0a26
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- “Default Scene” dropdown field contains a spelling mistake “Default Builtin”
- Editor crashes on PPtr<Mesh> after adding Text Mesh and Cloth Components to the same GameObject
- Previously deleted “DefaultLookDevProfile“ is present when upgrading the Editor version
- [Ubuntu] UI text and buttons are missing spaces in Unity Version Control > New Workspace window
- "Inherit attribute is not supported" warning is shown but attributes are available in VFX Graph Output and Update blocks
Resolution Note:
Thanks for the report. The fix for this issue is too risky to implement at this time. Please adjust asset naming to avoid this particular scenario.