Search Unity

Sprite Asset workflow is broken (2019.1.2f1 + TMP 2.0.0)

Discussion in 'UGUI & TextMesh Pro' started by Heckmouse, May 12, 2019.

  1. Heckmouse

    Heckmouse

    Joined:
    Nov 7, 2014
    Posts:
    27
    The workflow shown in this video:
    (around the 13:40 minute mark) where you can add icons to a file and then continue to update the sprite asset is broken.

    There are two issues, the first--If you alter the sprite reference file at all while unity is running, the sprites used by that asset will disappear in view. You can see this by opening the Default Sprites in Photoshop and saving any change. This is not workflow breaking as you can simply restart Unity and it will fix itself.

    The bigger problem is that you cannot add new icons to a file and regenerate the sprite asset (by overwriting the previous file) any longer. The create Sprite Asset command overwrites the old file, but it does not add any of the new sprites.
     
  2. Heckmouse

    Heckmouse

    Joined:
    Nov 7, 2014
    Posts:
    27
    Ah, I found the new solution is to use the gear icon and the new 'Update Sprite Asset' function.
     
  3. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    When I have time, I'll update that old video to reflect the latest changes / improvements related to Sprite Assets.

    I just added the "Update Sprite Asset" option in the header of the Sprite Asset Inspector. This should help with discoverability and sort of mirrors a similar option to update atlas textures.

    upload_2019-5-12_14-24-7.png

    In terms of this option:
    (1) It will pickup newly added sprites provided you have added them in the Unity Sprite Editor.

    (2) It will not automatically delete Sprite Characters and Sprite Glyphs when you remove the via the Unity Sprite Editor. To remove these, you can simply delete the Sprite Character in the Sprite Asset Inspector / Sprite Character Table.

    (3) It will update the Glyph Rect data when modified via the Unity Sprite Editor

    (4) Glyph Metrics will not be altered since these don't exists in the Unity Sprite data and could have been manually edited by the user.

    (4) Pivot adjustments are also ignored for the same reason as (4).

    Note:
    - Deleting a Sprite Glyph in the table will also remove the Sprite Character.
    - Deleting a Sprite Character does not remove the Sprite Glyph as it may be referenced by several Sprite Characters.
     
    Last edited: May 12, 2019
    MrLucid72 likes this.
  4. Heckmouse

    Heckmouse

    Joined:
    Nov 7, 2014
    Posts:
    27
    Thanks for the thorough reply Stephan. That new button for visibility seems like a good addition.

    Before you check this off your list though--There is still an issue that isn't fixed by the Update Sprite Asset command, where if you edit the reference image and save it, the sprites disappear from view until you restart unity.
     
  5. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I'll do further testing on that but this is an issue internal to Unity where it looses the reference to the texture. Entering playmode normally resolves that.
     
    MrLucid72 likes this.
  6. MrLucid72

    MrLucid72

    Joined:
    Jan 12, 2016
    Posts:
    992
    Nice! Looking forward to the update~
     
  7. bachtik_cz

    bachtik_cz

    Joined:
    Nov 15, 2014
    Posts:
    1
    Any idea when that feature might be coming? Just spent an hour trying to add one symbol without discarding the chamges made to the original asset and it's an incredible pain adding it manually.
     
  8. MAWMatt

    MAWMatt

    Joined:
    Nov 10, 2016
    Posts:
    77
    This Update Sprite Asset feature doesn't work completely, at least not in Unity 2020.3.27f1.

    1. The lists are updated correctly, so the base functionality of that feature is great.
    2. The sprite asset refuses to save the changes to disk. Close and re-open Unity, it's back to the old asset.
    3. When I make changes to that file, it won't even recognize within Plastic SCM that the file is changed.

    So the inspector will tell me everything is great, but under the hood, the asset itself has none of these changes made. Has anyone found a work around to this?

    I can't simply create a new asset because I've had to tweak offsets for these sprites so they actually line up in my texts. If I don't change BX from -32 to 0, or BY from 32 to 50ish (these are 64x64 icons) then the icon is waaaaay off from the text.

    I realize this may be a necro, though it's completely relevant. Either way, I'll post this elsewhere because I really do need a solution to this.
     
    Heckmouse likes this.
  9. Heckmouse

    Heckmouse

    Joined:
    Nov 7, 2014
    Posts:
    27
    I'm seeing something similar in 2021.3.0f1. When I updated to this version, my sprite asset was broken. So I clicked 'Update Sprite Asset'. I went along thinking this fixed it but upon restart of Unity, the sprite asset is broken again.
     
  10. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Please test with the latest release of the TMP package which is version 3.2.0-pre.3 for Unity 2020.3 or newer.

    If the issue persists, please provide the steps to reproduce or submit a bug report with project and steps.

    If you do submit a bug report please provide the case # once you have it.
     
  11. chrismarch

    chrismarch

    Joined:
    Jul 24, 2013
    Posts:
    472
  12. chrismarch

    chrismarch

    Joined:
    Jul 24, 2013
    Posts:
    472
    adding new sprites does not work https://issuetracker.unity3d.com/is...s-are-not-detected-when-a-new-sprite-is-added