Search Unity

TextMesh Pro TMPro Sprite Asset corrupts every time Unity Editor is launched?

Discussion in 'UGUI & TextMesh Pro' started by Meorge, May 22, 2021.

  1. Meorge

    Meorge

    Joined:
    Feb 10, 2017
    Posts:
    21
    In my game project, I have a TextMesh Pro Sprite Asset file that stores controller prompt icons. Every time I open the Unity Editor and run the game, it seems like the file corrupts, with the names of sprites getting mixed up with each other (and in some cases, names disappearing entirely). To fix it, I simply have to open the Sprite Asset and click "Update Sprite Asset" in the Inspector window, and then everything shows up fine... until I close and open the project again, at which point this whole process repeats.

    One of my labels after opening the project:

    TMPSpriteBug_BeforeUpdateSpriteAsset.png

    Immediately after clicking "Update Sprite Asset" in the Inspector, it's fixed:
    TMPSpriteBug_AfterUpdateSpriteAsset.png

    ...but again, this only persists until I close the project.

    Is this a known issue, and/or is there a solution to this problem? It's been really frustrating having to do this every time, so it'd be great if there was a way to stop it.
     
    Ali_V_Quest likes this.
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Can you export the sprite asset with dependency (the texture) and provide it to me via a private message for me to take a look at?
     
  3. Meorge

    Meorge

    Joined:
    Feb 10, 2017
    Posts:
    21
    Thank you for the response! I just sent a zipped file with the sprite asset and texture/sprite data.

    Interestingly, as I was preparing it, I noted that while I have several icons with "mouse" in the name, which appear in the Inspector after I click Update Sprite Asset...
    Screen Shot 2021-05-22 at 8.18.59 AM.png

    ...the asset file itself never seems to be updated - there are no instances of those icons in the file itself.
    Screen Shot 2021-05-22 at 8.19.36 AM.png

    Perhaps Unity is updating its internal representation of the sprite asset data correctly, but just never saving it to the serialized file for some reason?
     
  4. Meorge

    Meorge

    Joined:
    Feb 10, 2017
    Posts:
    21
    Is there an update on this bug? I just upgraded my project to TextMeshPro 3.0.6 and am still experiencing this issue.

    Edit: It seems I was able to fix this bug by exporting a fresh copy of the spritesheet and creating a fresh Sprite Asset from that - the issue was continuing to persist with the old Sprite Asset, so maybe it had something to do with the old spritesheet it was using?
     
    Last edited: Dec 22, 2021
    Ali_V_Quest likes this.
  5. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    That is possible. Old sprite assets had to be converted to the newer format so maybe something was not working correctly.

    P.S. The latest release is version 3.2.0-pre.2 for Unity 2020.3 or newer. Will try to release preview 3 within the next few days.
     
  6. Ali_V_Quest

    Ali_V_Quest

    Joined:
    Aug 2, 2015
    Posts:
    138
    Thanks, duplicating the sprite and creating a new sprite asset from it fixed it for me