Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

TextMesh Pro Change name of default atlas material

Discussion in 'UGUI & TextMesh Pro' started by Epsilon_Delta, Mar 30, 2022.

  1. Epsilon_Delta

    Epsilon_Delta

    Joined:
    Mar 14, 2018
    Posts:
    261
    Hi,
    I wanted to change the font asset in all of the TMPro components, but did not find an easy way to do that. Therefore I decided to change the source font tff file and rename the font asset accordingly. Atlas texture name was changed upon updating it, but the default material (that is not a separate asset, just a subasset) name stayed the same.
    upload_2022-3-30_12-50-33.png
    Is there a way to change the name and/or is there a way to switch font assets on all TMPro components in project?

    I managed to do it by editing the asset in text editor. I also could used grep and sed to switch GUIDs and fileIDs to change font asset references. I just feel there should be a built-in way to do these operations (at least the first one)
     
    Last edited: Mar 30, 2022
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,596
    Since the child Material and Texture are sub objects / assets of the parent font asset, it is not possible to rename those in the Editor like we can for other objects.

    The child material and texture used to be named "default material" and "atlas texture". I recently changed this to add the prefix of the name of the font asset (when they are created).
     
    Epsilon_Delta likes this.
  3. Epsilon_Delta

    Epsilon_Delta

    Joined:
    Mar 14, 2018
    Posts:
    261
    Thanks for the reply. For the sake of tidy project, I like to keep correct naming everywhere. Therefore I would vote to expose a possibility to rename it somehow, but as I said I managed to do that by editing it in the text editor so my OCD is quenched.
     
  4. UDN_5c806b49-d8a0-4f67-a296-c12c91aa7396

    UDN_5c806b49-d8a0-4f67-a296-c12c91aa7396

    Joined:
    Jan 9, 2017
    Posts:
    152
    This. I was finding how to that for over 9 hours. Finally used sublime text editor to change it. Thank you