Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

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,050
    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,050
    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:
    20
    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,050
    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:
    20
    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,050
    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:
    20
    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,050
    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 at 11:29 PM
  12. JanusAnderson

    JanusAnderson

    Joined:
    Apr 30, 2013
    Posts:
    20
    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,050
    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.