Search Unity

TextMesh Pro Update an existing Sprite Asset

Discussion in 'Unity UI (uGUI) & TextMesh Pro' started by K1kk0z90_Unity, Jul 11, 2018.

  1. K1kk0z90_Unity

    K1kk0z90_Unity

    Joined:
    Jun 2, 2013
    Posts:
    83
    Hello,
    Is it possible to update an existing Sprite Asset after the source texture atlas has been modified, without having to create a brand new Sprite Asset each time?
    Thank you in advance for your answer! :)
     
    FernandoHC likes this.
  2. w34edrtfg

    w34edrtfg

    Joined:
    Nov 23, 2014
    Posts:
    35
    Try right clicking on the updated sprite and selecting create new sprite. If the old sprite is in the same folder, it will be updated.
     
    Adrien-Ninpo likes this.
  3. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,168
    I have made some improvements to this workflow which will be available in the next release of TMP.

    I'll try creating a video that explains the changes / improvements.
     
  4. MrLucid72

    MrLucid72

    Joined:
    Jan 12, 2016
    Posts:
    632
    EDIT: Wait! The quote below works! It was just a visual bug (that's repro'd every time, annoyingly enough :p)
    1. I set my TexturePacker settings trim mode to "Crop, keep position". I don't know if this is the best one, but it works.
    2. I export TexturePacker to the same dir as the earlier-generated TMPro Sprite Asset from TP.
    3. I right click >> TMP >> Create Sprite Asset
    4. ALL of your <sprite> sprites will poof. You need to leave the scene and return (Unity 2018.3). This is only a visual bug.
    5. Return to your scene >> All my values remain and nothing's broken, except the new stuff is there!
    --

    All this did was duplicate the old with the new :(

    --

    What's the latest on this? I have a horrible workflow for this, currently, that I'm sure can be improved:

    https://www.reddit.com/r/gamedev/comments/bpos6n/texturepacker_how_the_heck_to_efficiently_update/
     
    Last edited: May 17, 2019
  5. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,168
    See the following post as it includes additional insight on some of the recent changes I made.
     
  6. LesBloom

    LesBloom

    Joined:
    Feb 2, 2017
    Posts:
    66
    Hello @Stephan_B

    Are you saying that that post has information for updating the texture contents of an existing TMP_SpriteAsset?

    Because it seems to only refer to updating an existing TMP_FontAsset.

    Am I missing something?

    Thank you for your time
    Les
     
  7. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,168
    The texture content itself cannot be updated inside of Unity but the texture itself via the Unity Sprite Editor contains the definition of the sprites contained in the texture. That part can be edited via the Unity Sprite Editor which is what TMP Sprite Asset use to define the Sprite Characters and Sprite Glyphs.

    It refers to updating of Sprite Assets. The image / red arrow shows the Update Sprite Asset button which I explain in that post.
     
  8. LesBloom

    LesBloom

    Joined:
    Feb 2, 2017
    Posts:
    66
    Hello @Stephan_B

    I think I must be confused about something.

    This is what I am working with in Unity 2018 LTS and the current-verified version (1.3) of TMP.

    upload_2019-8-13_12-54-23.png

    I don't see the "Update Sprite Asset" button or any option under the gear either.

    Also, that other thread shows info about glyphs, font sizes, etc. None of that type of info is part of my TMP_SpriteAsset.

    Thank you
    Lester
     
  9. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,168
    Latest release is 1.4.1 which includes the new Dynamic System. See the following top sticky post for more details.

    As a result of the introduction of the new dynamic system, Sprite Asset structure has changed to include Sprite Character and Sprite Glyph tables. This mirrors the structure of Font Assets which is explained in the video linked in that sticky post.

    In the next release, the Update Sprite Asset option will be available to make it easier to update Sprite Assets when the content of the texture and includes sprites has changed.

    Sprite Assets will also gain Face Info where instead of inheriting the metrics of the currently used font asset will now be able to optionally have their own metrics. See the following post which is sort of the catalyst for this new functionality.
     
    FernandoHC likes this.
  10. LesBloom

    LesBloom

    Joined:
    Feb 2, 2017
    Posts:
    66
    I see. Thank you.