Search Unity

TextMesh Pro Migrating from Legacy / Asset Store to Package Manager Releases

Discussion in 'Unity UI (uGUI) & TextMesh Pro' started by Stephan_B, Jan 9, 2018.

  1. trainyard

    trainyard

    Joined:
    Sep 15, 2013
    Posts:
    6
    No matter what I try, following the upgrade steps fails for our project (repeated 3x now) and doesn't find any files to remap even though I'm seeing the following matching GUID values in the files themselves.

    Anonymous Pro SDF.asset:

    %YAML 1.1
    %TAG !u! tag:unity3d.com,2011:
    --- !u!114 &11400000
    MonoBehaviour:
    m_ObjectHideFlags: 0
    m_PrefabParentObject: {fileID: 0}
    m_PrefabInternal: {fileID: 0}
    m_GameObject: {fileID: 0}
    m_Enabled: 1
    m_EditorHideFlags: 0
    m_Script: {fileID: -667331979, guid: b5bd0d848a86e48409fe56688d66ecb5, type: 3}
    m_Name: Anonymous Pro SDF
    m_EditorClassIdentifier:
    hashCode: -1168836081

    PackageConversionData_Assets.json:

    {
    "referencedResource": "TMP_FontAsset.cs",
    "target": "fileID: -667331979, guid: b5bd0d848a86e48409fe56688d66ecb5",
    "replacement": "fileID: 11500000, guid: 71c1514a6bd24e1e882cebbe1904ce04"
    },

    GUID remapping finds no files to change even though I can see it evaluating the SDF files. The files themselves all show "The associated script cannot be loaded" error, but I don't see any related errors in the console.

    No idea if it's related, but I do see two of this error in the console:

    NotImplementedException: The method or operation is not implemented.
    System.Environment.FailFast (System.String message) (at <a8ed250850854b439cedc18931a314fe>:0)
    <Module>.o*k-lj.nkm+nl--lm*.
    nl-,*nj*nj
    ,no-. (System.String ) (at <d7d768327f4f40bfa66e8d37bff64fd0>:0)
    <Module>.l+nml.o-,jol*l
    n++
    n*-j+n-k-
    n.,. (System.Object ) (at <d7d768327f4f40bfa66e8d37bff64fd0>:0)
    System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) (at <a8ed250850854b439cedc18931a314fe>:0)
    System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <a8ed250850854b439cedc18931a314fe>:0)
    System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <a8ed250850854b439cedc18931a314fe>:0)
    System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) (at <a8ed250850854b439cedc18931a314fe>:0)
    System.Threading.ThreadHelper.ThreadStart (System.Object obj) (at <a8ed250850854b439cedc18931a314fe>:0)
    UnityEngine.UnhandledExceptionHandler:<RegisterUECatcher>m__0(Object, UnhandledExceptionEventArgs)

    I'm not sure what else to try. I've re-run the process several times very carefully and end up stuck at this step no matter what.

    Any help would be much appreciated.
     
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,348
    What version of Unity and TextMesh Pro are you upgrading TO and FROM?

    Based on the GUID of your font assets, it looks like your project was using the Editor GUID instead of the runtime ones. These means you will need to use the alternative conversion files linked / described in the Updated Notes #7 near the bottom of that first post.
     
  3. trainyard

    trainyard

    Joined:
    Sep 15, 2013
    Posts:
    6
    Thanks for the Sunday reply!

    I'm upgrading from Unity 2017.4.22f1 to 2019.2.0f1, and TextMesh Pro 1.0.55 to 2.0.1.

    I tried upgrading from a fresh clone of our repo again. I replaced the GUID conversion files before running it the first time and that seemed to get it to recognize them, which is progress! Not sure why that didn't work before, but that likely solves my TextMesh Pro issues.

    After fixing a few other broken things (minor PostProcessing API changes, DoTween and Zenject had a couple errors and needed an upgrade), it seems I'm still stuck on those DLL errors (NotImplementedException) so all my TextMesh Pro components still show as "The associated script cannot be loaded". I'll keep fighting with that next in the hope of seeing my TextMesh Pro components updated.
     
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,348
    Errors in the project will affect this process.

    If you have prefab in the project, be sure to check #2 in the top list as that would leave you with some text object with missing scripts.

    Keep me posted.
     
  5. JanusAnderson

    JanusAnderson

    Joined:
    Apr 30, 2013
    Posts:
    22
    Hi Stephan, I have a live game (Storm Wars) published on 5 platforms, it's been live for a few years and is currently running on Unity 2017.4.30. Because of the new Android requirements for 64-bit builds, I am being forced to update the engine. Anyway, I have tried migrating to 2018.2.21 using this process and everything went well except for one serious problem - although the GUID remapping tool seemed to successfully identify and remap all the fonts and assets and the game is running fine, every font I have in the game now uses the default emojione sprite sheet instead of the custom ones that were assigned to the prefab. I have probably several hundred places in the game where I will need to go and reassign the sprite sheets manually unless I can find a solution to this - do you have any idea what might be happening here?

    Thanks for any help!
     
  6. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,348
    Was your Sprite Asset assigned to these individual text objects in the Extra Settings or had you changed the Default Sprite Asset in the TMP Settings to point to your Sprite Asset?

    When you upgraded to the latest TMP release most likely the TMP Settings were reset so if you had assigned a Sprite Asset there it would have been change. So just re-assign your custom Sprite Asset.
     
  7. JanusAnderson

    JanusAnderson

    Joined:
    Apr 30, 2013
    Posts:
    22
    Thanks Stephan, I believe that was mostly the issue. I did for whatever reason have to regenerate my text sprites because they were missing a material(?) and will have to readjust the kerning for them, but everything else looks ok. Appreciate the fast response!
     
    Stephan_B likes this.
  8. knobby67

    knobby67

    Joined:
    Aug 30, 2015
    Posts:
    331
    Can anyone point me in the direction of how I change font on the fly in code please?
    After a lot of searching I found this
    <code>
    TMP_Text tmp = this.GetComponent< TMP_Text >( );


    TextMeshProFont m_FontAsset = Resources.Load("Fonts & Materials/ARIAL SDF", typeof(TextMeshProFont)) as TextMeshProFont;
    tmp.font = m_FontAsset;
    </code>

    However I think this might be for an old build of tmpro as I get the below error. I should add I got using "TMPro"

    The type or namespace name 'TextMeshProFont' could not be found (are you missing a using directive or an assembly reference?)

    Thanks
     
  9. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,348
    See the following post and script. Also take a look at the using statement in that script.
     
    knobby67 likes this.
  10. JanusAnderson

    JanusAnderson

    Joined:
    Apr 30, 2013
    Posts:
    22
    Hi again Stephan, really appreciate the ongoing support. I love TMP but i'm still having a lot of headaches upgrading my game through successive unity versions. I did make it through 2018.2 and 2018.3 though I had to go through every single text object in the game and strip the inline graphics objects (wishing this was done automatically with the migration tool). After that, things looked great in 2018.3.1 but due to some issues with audio on Android I'm trying to upgrade again. I went to 2018.4.6f1 and now all of the fonts in the game are aligned incorrectly. Even stranger, when looking in the inspector the alignment for every font in the game shows upper left, though it's displaying like center right until I touch one of the alignment controls. I can of course go through the thousands of TMP objects and adjust them but I'm hoping there's a workaround. Has anyone else seen this problem?
     
  11. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,348
    The alignment issue most likely stems from the old style alignment that was used in the pre package manager versions of TextMesh Pro.

    This issue was reported to me recently and I have resolved it by adding back the old style conversion.

    In the next release, alignment will be changing to split horizontal from vertical alignment. This is to allow changing one without the other to minimize prefab changes. The conversion from the previous alignment to the newer split will be handled automatically including conversion of the old style which will no longer be an issue after that.

    I would like to test these changes to make sure I have not overlooked anything. It would be great if you could provide me with some sample / repro to test.

    Separate from this, I'll see if I can get you the changes needed to get around the current behavior in the version you are currently using.

    UPDATE
    Add the following file in the "TextMesh Pro/Scripts/Runtime/..." folder. You have to make this change in the global package cache located in "...\AppData\Local\Unity Cache\cache\packages\packages.unity.com\com.unity.textmeshpro@1.4.1\Scripts\Runtime\..."

    Then make the following changes in the TMP_Text.cs in the LoadDefaultSettings() function which is to add the green parts.

    upload_2019-8-15_15-27-41.png

    These changes should resolve your current alignment issues.
     

    Attached Files:

    Last edited: Aug 15, 2019
  12. JanusAnderson

    JanusAnderson

    Joined:
    Apr 30, 2013
    Posts:
    22
    Ok I made the changes you suggested above (the code change and added the TMP_Compatibility file) but they didn't seem to have any effect at all. Do I need to make these changes first and then try upgrading the project again from 2018.3.1->2018.4.6? Also, I would be happy to share a sample to test but I don't really know how, my assets folder alone for this game is >3.5 GB and the project folder is 14.5 GB.
     
  13. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,348
    The changes need to be in place prior to the upgrade from 2018.3 to 2018.4.

    In terms of submitting your project, the easiest way is via the Unity bug reporter. I get projects that sometimes are over 100GB compressed.

    Alternatively, you can zip the whole thing and provide me with a private link via PM if that is more convenient for you. If providing via private link, you can delete the Library folder from the project (backup) as this will greatly reduce the size of this.
     
  14. Starbox

    Starbox

    Joined:
    Sep 17, 2014
    Posts:
    45
    Hi,

    Okay, I followed your tutorial. This piece got me slightly confused:

    Seems contradictory?
    I just moved on and deleted that folder anyway.

    You were not kidding when saying the updater tool would be a memory hog. I made the mistake of running it on Assets and I had to kill Unity halfway through the scan as it stalled when it reached my Scenes folder, but my computer is not very powerful either.
    So I isolated the latest scene, the one I'd work from, and put it in its own folder to target it.
    I'll complete further updates ad hoc if I spot issues but it seems okay, my GUI TMP is back. I'm satisfied.
    Thank you.

    Other subtopics now.
    Must I can keep serialization to 'force text'? It seems to be a better choice if done early in a project. I'm not doing any version control though.
    Also, when preparing the scene and player settings in 2017, I had switched to .NET 4.x, which was marked as experimental.
    In 2019, it's back to .NET 2 standard 2.0. I also use IL2CPP. For the info, with this parameter, TMP does display the text.

    Is it obligatory? Are all mobile devices capable of handling it? I ask because I'm not knowledgeable enough on this.
     
  15. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,348
    Switching to .Net 4.x is required as .Net 3.5 was deprecated in Unity 2018.x and will be removed in Unity 2020.

    I would recommend leaving Asset Serialization as Force Text and would most certainly recommend using some type of Source Control like Github or something.
     
  16. TobyKaos

    TobyKaos

    Joined:
    Mar 4, 2015
    Posts:
    157
    Hello,

    I use I2 localization to localize text with Text Mesh Pro. But all GameObject using both are not converting to new TMP.
    Others with only TMP have been converted.

    I2 localization 2.8.10f1
    TMP 1.4.1
    Unity 2018.4.8f1

    What I can do to solve this? I will not reassign manually and rollback to Unity 2017 if not possible.


    [EDIT]
    does not seems to be related to I2 Loclization.

    I have include Prefabs folder in the search (because my game menus are Prefabs) and the converting tools convert prefabs that .unity contains instance.

    But some text have a missing script instead of the new TMP_Text :( . Think I must reassign manually

    [EDIT 2] I will try to delete prefabs of my menus before migrating.
     
    Last edited: Sep 16, 2019
  17. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,348
    As per the instructions (#2) on the first page, special handling of Prefabs is required as a result of a change that occurred in 2018.3. See the following note.

     
  18. justtime

    justtime

    Joined:
    Oct 6, 2013
    Posts:
    305
    Hi there! I'am trying to upgrade from 2017.4.32f to 2018.4.9f.
    I've done all steps from 1st post, but can't pass through 6 point. On every "using TMPro;" i got "The type or namespace name 'TMPro' could not be found (are you missing a using directive or an assembly reference?)" error.
     
  19. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,348
    Do you get any other errors in the console?

    Make sure you perform all of the above on a backup of the project.

    It is possible the project solution or compilation of the package assemblies got confused.

    First, I presume you have closed and re-opened Unity to see if that clears the confusion?

    Second, I would suggest to deleting the global package cache and the restarting Unity to see if that clears it.

    Third, delete the Library folder as well as all project solution files at the root of the project and let those get re-created when you first access any of the scripts. Depending on the size of the project this is more painful / slow.
     
  20. justtime

    justtime

    Joined:
    Oct 6, 2013
    Posts:
    305
    There are no other errors, except these two:"The type or namespace name 'TMPro' could not be found" and "'The type or namespace name TextMeshProUGUI' could not be found". I've done every point:close editor, delete cache folders, delete library and sln files and errors still here.
     
  21. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,348
    Just confirming that you deleted to global package cache? Make sure Unity is closed when doing these things.

    Assuming you did the above, see if you get the same behavior creating a new project.

    What code editor are you using? Make sure if it is Visual Studio that you are using the latest release and at least Visual Studio 2017.

    There has been a few posted related to this initially but those types of issues eventually went away with improvements to assembly definition compilation, etc. Make sure you don't have any other plugin that might affect compilation as some of those might not be playing nice with assembly definitions which all packages use now.
     
  22. justtime

    justtime

    Joined:
    Oct 6, 2013
    Posts:
    305
    I deleted two global cache subfolders form your link. With new project tmp works fine. I'am using Rider.
    I've tried with 2018.2, 2018.1 and 2019.2 today and got the same result.
     
    Last edited: Sep 27, 2019
  23. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,348
    Are you using any addons in your project that have something to do with script compilation? I know there were some trying to speed up compilation, etc. Something is affecting either the project solution or confusing the assemblies.

    If you can't isolate the issue, can you submit a bug report with the project so we can take a look?
     
  24. justtime

    justtime

    Joined:
    Oct 6, 2013
    Posts:
    305
    I have a bunch of assets...so how i should fill bug report info so that you can identify him?
     
  25. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,348
    Submit the bug reporter via the Help menu. Once you have received the confirmation email with the Case #, please provide it to me so I can more quickly go look at the project.
     
  26. OneGiantPanda333

    OneGiantPanda333

    Joined:
    Dec 13, 2013
    Posts:
    4
    I had the issue that the script GUID can not be fixed by mapping tool. And it is solved by new PackageConversionData.json now.

    In case no one has mentioned, I spent some time to figure out that replacing the files in AppData/Local/Unity/.. may not be enough. If you already opened your Unity project with the new TextMeshPro, you has the cache in your project/PackageCache/com.unity.textmeshpro. And you need to update the two json files in that folder.

    I know it's a dumb mistake, and but I don't want anyone to waste time on this.
     
  27. Danoli

    Danoli

    Joined:
    Feb 20, 2017
    Posts:
    5
    I've had a problem updating and here is my solution.

    For most of the TMP files the GUID System worked. I used the Alternative GUID Mapper as well and that even did work for a few so I'm guessing the problem in my project was related to this sort of issue with Runtime GUID bound.

    What I looked at in Git was the files that did convert over went from:
     m_Script: {fileID: 1453722849, guid: 89f0137620f6af44b9ba852b4190e64e, type: 3} 

    GUID Mapper changed to this:
      m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}


    My project still had many prefabs and scenes with missing script errors where Text Mesh Pro UGUI's were before. When opening the problematic .prefab's with a text editor such as sublime I noticed this:
     m_Script: {fileID: 1453722849, guid: b5bd0d848a86e48409fe56688d66ecb5, type: 3}
    using the same fileID:1453722849 as the TMP script that was converted before.

    Knowing that 100% the original working converted prefab was using the same Text Mesh Pro UGUI I used Sublime Text to Find and Replace all instances of
    m_Script: {fileID: 1453722849, guid: b5bd0d848a86e48409fe56688d66ecb5, type: 3}

    With the working code:
      m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
    Save All and Reopen project

    This fixed the problem!