Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by DustyScreen · Jul 04, 2019 at 02:15 PM · updatefonttextmesheditorscript

Updating All TextMesh Pro FontAssets with editorscript

I have a lot of fonts in my project and using TextMesh Pro (Build-In, 1.3.0). For all of the FontAssets I use "Character Set: Character from File" and they are sharing the same textfile.

However if I change the characters in that textfile, I have to do the following for all of the FontAssets:

1) Select the TMP_FontAsset-asset in Project-view

2) Hit the "Update Atlas Texture"-button in the Inspector-view

3) Hit the Generate Font Atlas in the Font Creator-view

4) Wait for around 10 seconds

5) Hit the Save button in the same view

This is time consuming and stupid, so I'm wondering, if I could do a clever editorscript batch, that does all of this for me. I have the following so far:

 #if UNITY_EDITOR
 using UnityEngine;
 using System.Collections;
 using System.Collections.Generic;
 using UnityEditor;
 using TMPro;
 
 public class UnityEditorTools
 {
     [MenuItem ("Tools/Update All TextMesh Pro Atlas Textures")]
     public static void UpdateAllTextMeshProAtlasTextures()
     {
         var tmp_FontAssets = new List<TMP_FontAsset>();
         foreach (string guid in AssetDatabase.FindAssets ("t:TMP_FontAsset"))
         {
             string path = AssetDatabase.GUIDToAssetPath (guid);
             tmp_FontAssets.Add (AssetDatabase.LoadAssetAtPath<TMP_FontAsset> (path));
         }
         foreach (var tmp_FontAsset in tmp_FontAssets)
         {
             //Do 1-5 here...
         }
 
         AssetDatabase.SaveAssets();
         AssetDatabase.Refresh();
         Debug.Log ("Success.");
     }
 }
 #endif

But I don't know how to get to do the 1-5 on the tmp_FontAsset...

Any tips or helps would be most valuable! Thanks! :-)

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image xitheta · Aug 28, 2020 at 09:28 PM 0
Share

Hi!, just wondering if you ever found a solution for this. I too would like to know if there's a way to do this via script.

avatar image DustyScreen xitheta · Sep 01, 2020 at 07:48 AM 0
Share

Unfortunately not. Still doing it manually :-( If you figure out anything please post!

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

111 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Upgrading TextMeshPro font asset is not working 1 Answer

Unity Crashing on Play after updating to 2018.2.1f1 0 Answers

TextMesh Font Materials Not Editable? 1 Answer

Font scale factor of 0.1 when computing TextMesh width 0 Answers

3D Text Mesh produces wrong letters 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges