Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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

Discussion in 'UGUI & TextMesh Pro' started by Stephan_B, Jan 9, 2018.

  1. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    900
    This doesn't seem to work for me. What is the exact syntax for doing this in the asmdef file? When I do this:

    Code (csharp):
    1.  
    2. {
    3.     "name": "mything",
    4.     "references": ["com.unity.textmeshpro.Runtime"],
    5.     "optionalUnityReferences": [],
    6.     "includePlatforms": [],
    7.     "excludePlatforms": [],
    8.     "allowUnsafeCode": false
    9. }
    10.  
    I get the error:
    Code (csharp):
    1.  
    2. Assembly has reference to non-existent assembly 'com.unity.textmeshpro.Runtime'
    3.  
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    If you upgraded or are using version 1.2.1 of the TMP UPM package, the Assembly Definitions have been renamed to comply with new Unity internal naming conventions. The TMP runtime assembly is now "Unity.TextMeshPro" and the editor assembly is "Unity.TextMeshPro.Editor".

    Please let me know if that works for you.

    Note: The source code / location of the TMP UPM package is located in (on windows) "ProgramData\Unity\cache\packages\packages.unity.com\..." in there you will see folders for the different versions of the TMP package. Inside that folder, you can navigate to the scripts folder where you can see the names of those assembly definition files.

    BTW: In order to make it easier for other users to find solutions to these types of issues (which although related to 2018.1 are not specific to project migration itself), please create separate threads in the "Unity UI & TextMesh Pro" section of the forum.
     
  3. alanmthomas

    alanmthomas

    Joined:
    Sep 7, 2015
    Posts:
    197
    I am attempting to use the new version but with limited results. I am using it on a new project (not attempting to convert an old one). In my scripts for previous versions, I had the "using TMPro" line at the top and was then able to access things like "public TMPro_Text variableName" in my declarations. I can't seem to do that now. Is there something that I'm missing?
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Do you mean?
    Code (csharp):
    1. public TMP_Text variableName;
    As there is no type "TMPro_Text".

    Are you using Assembly Definitions for your scripts?
     
  5. alanmthomas

    alanmthomas

    Joined:
    Sep 7, 2015
    Posts:
    197
    Yes. That is what I mean. And I'm not sure how to go about using Assembly Definitions. Sounds like research time.
     
  6. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    See the following post as well as @Claytonious post above as well as my reply since it is related to .asmdef.
     
  7. alanmthomas

    alanmthomas

    Joined:
    Sep 7, 2015
    Posts:
    197
    I'm going to try to ask this again as I've made no progress on this. Let's say that I am starting a new, clean project in the 2018 beta. I do the following:

    1. Import the TextMeshPro package from the package manager.
    2. Create a UI Canvas object.
    3. Create a TextMeshPro Text object.
    4. Create a new script called "TextTest.cs"
    5. In editing that new script, I want to access the TMPro namespace to be able to set set text on the object created in step 3. I can't access the name and hence the components either.

    How can I resolve this? In this scenario, have I created a custom assembly?

    Any help is really appreciated.
     
    Eelee likes this.
  8. alanmthomas

    alanmthomas

    Joined:
    Sep 7, 2015
    Posts:
    197
    Was able to work this out with some assistance. It came down to csproj files. Thanks.
     
    Stephan_B likes this.
  9. hjupter

    hjupter

    Joined:
    Dec 23, 2011
    Posts:
    628
    Any idea why is this happening?... This is a WebGL build made with Unity Cloud Build its only happening there it works fine in the editor and if I make the build myself. I'm using Unity 2018.1.0b13 with TMP 1.2.2 from the Package Manager (also tried with 1.2.1)
     

    Attached Files:

  10. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Looks like a potentially missing font asset, material or shader. Make sure whatever font asset, material you are using is contained in a "Resources/..." whatever name you specific in the TMP Settings file. That is if the material is not directly referenced in the scene.
     
  11. hjupter

    hjupter

    Joined:
    Dec 23, 2011
    Posts:
    628
    Ok I noticed my TMP fonts are not in resources folder so that could be the problem but I found it weird because before it used to work fine but that was Unity versions ago.

    Thanks for you very fast reply Stephan, Ill let you know if Im still having problems.
     
  12. jered_as

    jered_as

    Joined:
    Dec 4, 2015
    Posts:
    3
    Set up a new project in 2018.1.0b13, using the Package Manager to fetch TextMesh Pro 1.2.2, and it looks Libraries\ScriptAssemblies\Unity.TextMeshPro.dll references UnityEngine.CoreModules, which is incorrect if I understand other posts in various places. It sounds like this was fixed in the version on the asset store already, but perhaps it wasn't pushed to the Package Manager version?
     
  13. hjupter

    hjupter

    Joined:
    Dec 23, 2011
    Posts:
    628
    It didnt work I tried everything but it just doesnt work, I assume this an issue of the Unity Cloud since it works fine if I make the buid myself
     
  14. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The package manager version of TextMesh Pro version 1.2.2 is included as source code. The folders that contains these scripts (runtime and editor) include .asmdef files and as such these are compiled using the Assembly Definition feature in Unity.

    I would direct questions related to how references are handled when using Assembly Definitions to the scripting team. I will also ask internally.
     
  15. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I would recommend submitting a bug report and specify the issue only happening on Unity Cloud.

    I'll try to run some tests on my end as well.
     
  16. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,533
    This is following on my previous post a while back.. I've since decided to check things out with the official package at 1.2.2 (having moved the previous TMP package source out of this cloned project) only to find that on 2018.b12 and having the official 1.2.2 package installed I get a ton of missing scripts. One of the reasons for even getting this particular project back to the TMP package version is that I have a bunch issues with TMP bugs that need reporting.

    Anyway it's a damn mess if you try go back to packman.. The guid remapping won't work obviously because it was only designed for helping those from TMP 2017 etc to the new package manager version of TMP... but what makes this really stinking bad is that Unity's just about useless missing mono script window in 2018.1 for remapping scripts to what they should be based on nothing but prior knowledge of what was used (because like who cares about actually showing any sort of human readable file/component name with that 'missing script' error that might help in the future)/. Well that missing script window won't actually show the components of scripts that are from packages... like the TMP package so I can't even remap the missing scripts one by one with TMP package text component scripts on these prefabs/gameobjects to get it working that way... Nope I'm literately stuck on this path of ripping out the TMP package source and copying it into the project assets, removing the asmdef etc...which is a blunder to discover and not very convenient at all considering packages are meant to be an improvement yet you can't work with them in a project very easily when it comes to source code in editor. Too much behind the scene voodoo gluing this currently not great system together.. Even the project assets window should ideally show installed an packages section and let you work with package files/source that way where modified variations for the project are stored a little differently.

    I'm not sure if that gaping hole of missing functionality in the editor of not supporting packages properly for the missing scripts window, even though they are are used in the project, and can be seen the 'Add Component' menu is ever going to be sorted but it sure would be helpful right?.. Along with an improved guid remapping tool for TMP....

    Because it would be nice if the project guid remapping tool could be further extended to provide support for reassigning missing scripts for TMP components to and from having TMP as a package or for those who like me prefer to use TMP source in the project and work with it that way.

    And it might be wishful thinking on my part for Unity to ever bother making the whole missing mono script stuff actually less annoying to sort out and easier to fix and remap for entire projects -preferably with actual last human readable used file/component names of those missing scripts.
     
  17. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Do you get missing scripts after importing version 1.2.2 or after going through the conversion with the Project File GUID Remapping tool?

    I have converted probably 50 projects by now and without issues so if you could submit a bug report with your project before conversion, I can do the conversion on my end to see if I run into any issues.

    Make sure you followed the steps listed on page one.
     
  18. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,533
    I'm using an earlier package manager version of TMP source in the project, then moving that package manager TMP source out the project, then importing the 1.2.2 TMP version from package manager.. this is where the missing scripts are not matching with the newer package manager TMP version because of the different guid.. the guid remapping tool isn't working at fixing it either.. The guid remapping tool has worked before but that was going from the 2017 TMP project to the package manager version.

    The crash bug project reported is No# 1021483
     
  19. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    What do you mean by moving the source in / out of the project? Do you mean you copied the source code from the package cache location into the local project? When you did that did you copy the .meta files as well?

    If you didn't copy those meta files, it means that all these scripts would have had some random new GUIDs assigned to them thus making those become incompatible with previous and new package versions.

    P.S. I can't access the project files with that case # right since that server is down for maintenance. I'll look at it once the file becomes available.
     
    Last edited: Apr 4, 2018
  20. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,533
    Yeah and the .meta files were copied along them aswel...also just checked now and the previously copied TMP package source that was used in the project before does actually match with the guid's of the same files from 1.2.2 package source.. guess nothing for the guid remapping tool to work but at the time with errors going on it seemed like the issue.

    So that reported crash bug had some weird stuff that happened in that process of trying to switch it TMP 1.2.2, the point about the missing monoscripts and the window for that not showing package manager script/components is still an issue. I don't have that sent bug report project to recheck it, and the steps taken since.. but I've gotten the project working with the ugui text and the TMP packaged version.. inbetween a few script recompiles and a couple of unity restarts with the project, things have finally loaded up properly without the missing scripts errors or ugui tmp text looking completely out of size and not displaying correctly (even after re importing the TMP essential stuff into the project), it seems only restarting unity and opening the scene got it working.
     
  21. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The copying of the package content into the local project is something that I certainly have not tested nor do I believe was expected.

    I have no doubt that when importing the new package, you would end up with lots of errors as you now have the local scripts / .asmdefs and resulting DLLs still loaded while the new package also tries to load its own DLLs which I believe might result in GUID conflicts where the incoming scripts might end up with new / random GUIDs being assigned. For certain, a restart of Unity would be required for the old DLLs to get unloaded.

    This is something that I will definitely need to test and provide guidance as to some potential smoother way to handle this or to simply avoid it.

    Update
    I had a chance to reproduce what you did. Here are the steps I took.
    (1) I created an empty project.
    (2) Copied the com.unity.textmeshpro@1.2.2 folder from the package cache into my local project.
    (3) Renamed the com.unity.textmeshpro@1.2.2 folder to "TextMesh Pro".
    (4) Added the TMP Essential Resources and the Examples & Extras.

    At this point everything worked as expected.

    (5) I imported the TextMesh Pro package using the Package Manager UI.
    (6) As I suspected, because the new incoming package files use the same GUID as the current files in my local project. New random GUIDs were assigned to this new package and as such making it incompatible with previous versions.

    Here is an image of the warnings I received about all the GUIDs being changed.

    upload_2018-4-3_23-34-6.png

    Trying to undo this is pretty messy since the local package cache now has a version of TextMesh Pro that is using random GUIDs. The following steps seemed to work.
    (1) Remove the TMP package from the project using the Package Manager UI.
    (2) Close Unity.
    (3) Delete the com.unity.textmeshpro folders in the local cache "npm" folder and in the "packages" folder. There are sub folders in there which also contain references to the package which need to be deleted as well.
    (4) Restart Unity and import the new version of the package using the Package Manager UI.
    (5) In theory, everything should be working fine again. You might need to add the TMP Essential Resources and Examples & Extras if you removed those.

    In conclusion, let's avoid copying the package into the local project as this will make future upgrade potentially very painful.

    Even if the package is located in the package cache, you can still make changes to the source code. If that present issues, you can also embed the package by instead of copying the package in the local project. Copy the com.unity.textmeshpro (or whatever version) inside the "packages" folder at the root of the project. You can remove the @1.2.2 from that folder name.

    Lastly, I recommend keeping the package in the package cache to make life easier. Otherwise, just remember all these pitfalls when it is time for the next upgrade ;)
     
    Last edited: Apr 4, 2018
  22. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    @Player7 Out of curiosity, can you provide some insight as to why you initially copied the package into the local project?
     
  23. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,533
    I pretty much mentioned why in my first post on this thread.. but summarize it again.. the documentation of TMP is lacking in general for anything but the basic usage, also the pure convenience of just being able to visit the source and see how the methods are being used and get a bit more insight into that and surrounding parts...Still I should also mention that since that last post, MS have somewhat seen the light and have actually made it possible to just peek and decompile individual scripts to view source, it's still no good in comparison to Monodev's built in assembly browser, but I guess it's now possible to use VS2017 and not entirely have need for a package source being in the assets folder as you can just goto and peak a used method and browse that particular source file directly in the editor now.

    Also as I had previously made some minor edits to the TMP source prior to the package version, it was just more useful to have the source in the assets folder where it would still be easily accessible for changes and debugging directly. That is really the main reason. And because I had made adjustments to TMP source in another project, this project is just getting back to the original source to report a few issues with TMP that I couldn't find an easy fix for myself and would be better seen and improved on your side.

    Anyway you don't get any of those conveniences with the packages, its abstract, its like 2 steps forward 1 step backwards in terms of Unity going towards providing source code for more of the things they do, but then bury it in this package system where it's generally outside of your project with all the inconveniences that brings and most the editor still hasn't catched up with the functionality of supporting it better.. like the missing monoscript window remapper, or the project assets window.. it seems only code editors like VS will understand it because of the linked compiled assemblies but that isn't useful as far debugging or code editing.

    Personally think the entire package system should have a built in way of bringing in a particular package into a working projects assets folder, so its more exposed for more 'hands on' work with it..and if gets modified and changed then if its ever taken back out and put into the global packages area it can be seen as that..a modified version of a previously official package so you can use it in other projects that way.

    I also had to remove the .asmdef files from the scripts directories to get it working in the project from the assets folder... and I had originally just copied the contents of a previous packaged TMP version into an existing "TextMesh Pro" that had been emptied... but same thing :)

    In future I think I'll just move the contents of "TextMesh Pro" (well everything but the Resources, Sprites, and Documentation folders (unless those are changed which is another issue with the package manager, is zero effort mentioning any sort of history/version changelogs to keep end users informed about changes/improvements to these used packages) out of the project assets folder, delete the Library/ScriptAssemblies folder (would that be enough to clear it?), and add the TMP package dependencies to the Packages\manifest.json file... then start Unity and load up the project..and things should be more seamless? I obviously went wrong with trying to do this stuff while the Unity instance was running with the project... Because everything you did after step 4 was a little different in what I did, but one thing must have happened is that the guid's got changed, and is why it took longer for me to fix it.
     
  24. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,533
    Also when can you start adding the presets for TextMeshPro - Toggle, TextMeshPro - Button etc. I'd like to see all the default text stuff replaced with TMP or at least TMP versions for all the same things as default ugui text by now.
     
  25. Sebioff

    Sebioff

    Joined:
    Dec 22, 2013
    Posts:
    218
    Hi @Stephan_B !
    Could you please give a quick status update on that old masking problem with input fields when using RectMask2D?

    tmp_masking.gif

    Our game is nearing release now and this is one of the most annoying remaining bugs, so if some solution can be found that'd be much appreciated :)
     
  26. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Can you provide the steps to reproduce the example you have or some Repro scene / Project? This should not be happening.

    Also let's keep this thread to the 2018.1 package related stuff and post about other TMP stuff into parent forum here. This is to make it easier for people (and me) to find reported issues / questions and solutions.
     
  27. Sebioff

    Sebioff

    Joined:
    Dec 22, 2013
    Posts:
    218
    Sure - simply put a TMP input field as child of a RectMask2D, that's it. Started happening with the TMP/Unity versions roughly a year ago. Repro project is attached.
     

    Attached Files:

  28. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Until I can get around to implementing a better solution, the following code change should resolve your issue.

    In the TextMeshProUGUI.cs file around line 358 comment the following line.
    Code (csharp):
    1.  
    2. public override void Cull(Rect clipRect, bool validRect)
    3. {
    4.        // Comment the line below
    5.        //if (m_ignoreRectMaskCulling) return;
    6.        base.Cull(clipRect, validRect);
    7. }
    8.  
    This change should only impact input field clipping if the amount of text includes several lines of text and has a scrolling bar itself. Ie. it should not affect your use case.
     
  29. Sebioff

    Sebioff

    Joined:
    Dec 22, 2013
    Posts:
    218
    Perfect, thanks Stephan!

    Just in case anyone else has the same problem, I modified the temporary fix slightly like this to break multi-line inputs a bit less:

    TMP_InputField around line 798
    Code (CSharp):
    1. if (m_TextComponent != null)
    2.             {
    3.                 m_TextComponent.RegisterDirtyVerticesCallback(MarkGeometryAsDirty);
    4.                 m_TextComponent.RegisterDirtyVerticesCallback(UpdateLabel);
    5.                 m_TextComponent.ignoreRectMaskCulling = multiLine; // this was always set to true
     
  30. hjupter

    hjupter

    Joined:
    Dec 23, 2011
    Posts:
    628
    @Stephan_B I tried making a dev PC build in Unity Cloud and got this warnings/errors:

    Code (CSharp):
    1. Selected Shader does not support Stencil Masking. Please select the Distance Field or Mobile Distance Field Shader.
    2. UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    3. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    4. UnityEngine.Logger:Log(LogType, Object)
    5. UnityEngine.Debug:LogWarning(Object)
    6. TMPro.TMP_MaterialManager:GetStencilMaterial(Material, Int32) (at /Users/buildbot/Library/Unity/cache/packages/packages.unity.com/com.unity.textmeshpro@1.2.2/Scripts/Runtime/TMP_MaterialManager.cs:60)
    7. TMPro.TextMeshProUGUI:GetModifiedMaterial(Material) (at /Users/buildbot/Library/Unity/cache/packages/packages.unity.com/com.unity.textmeshpro@1.2.2/Scripts/Runtime/TextMeshProUGUI.cs:258)
    8. TMPro.TMP_MaterialManager:GetMaterialForRendering(MaskableGraphic, Material) (at /Users/buildbot/Library/Unity/cache/packages/packages.unity.com/com.unity.textmeshpro@1.2.2/Scripts/Runtime/TMP_MaterialManager.cs:326)
    9. TMPro.TextMeshProUGUI:get_materialForRendering() (at /Users/buildbot/Library/Unity/cache/packages/packages.unity.com/com.unity.textmeshpro@1.2.2/Scripts/Runtime/TextMeshProUGUI.cs:28)
    10. TMPro.TextMeshProUGUI:UpdateMaterial() (at /Users/buildbot/Library/Unity/cache/packages/packages.unity.com/com.unity.textmeshpro@1.2.2/Scripts/Runtime/TextMeshProUGUI.cs:284)
    11. TMPro.TextMeshProUGUI:Rebuild(CanvasUpdate) (at /Users/buildbot/Library/Unity/cache/packages/packages.unity.com/com.unity.textmeshpro@1.2.2/Scripts/Runtime/TextMeshProUGUI.cs:216)
    12. UnityEngine.UI.CanvasUpdateRegistry:PerformUpdate() (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/CanvasUpdateRegistry.cs:150)
    13. UnityEngine.Canvas:SendWillRenderCanvases()
    14. UnityEngine.Canvas:ForceUpdateCanvases()
    15. UnityEngine.UI.ScrollRect:EnsureLayoutHasRebuilt() (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/ScrollRect.cs:259)
    16. UnityEngine.UI.ScrollRect:LateUpdate() (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/ScrollRect.cs:382)
    17. (Filename: /Users/buildbot/Library/Unity/cache/packages/packages.unity.com/com.unity.textmeshpro@1.2.2/Scripts/Runtime/TMP_MaterialManager.cs Line: 60)
    18.  
    19. Trying to add WarningCount (UnityEngine.UI.Text) for graphic rebuild while we are already inside a graphic rebuild loop. This is not supported.
    20. UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    21. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    22. UnityEngine.Logger:Log(LogType, Object)
    23. UnityEngine.Debug:LogError(Object)
    24. UnityEngine.UI.CanvasUpdateRegistry:InternalRegisterCanvasElementForGraphicRebuild(ICanvasElement) (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/CanvasUpdateRegistry.cs:229)
    25. UnityEngine.UI.CanvasUpdateRegistry:RegisterCanvasElementForGraphicRebuild(ICanvasElement) (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/CanvasUpdateRegistry.cs:217)
    26. UnityEngine.UI.Graphic:SetVerticesDirty() (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Graphic.cs:104)
    27. UnityEngine.UI.Text:set_text(String) (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Text.cs:138)
    28. IngameDebugConsole.DebugLogManager:ReceivedLog(String, String, LogType) (at /opt/workspace/workspace/ninjutsu-games.astro-blood-s-i-x.windows-32-bit/Assets/Plugins/IngameDebugConsole/Scripts/DebugLogManager.cs:394)
    29. UnityEngine.Application:CallLogCallback(String, String, LogType, Boolean)
    30. UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    31. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    32. UnityEngine.Logger:Log(LogType, Object)
    33. UnityEngine.Debug:LogWarning(Object)
    34. TMPro.TMP_MaterialManager:GetStencilMaterial(Material, Int32) (at /Users/buildbot/Library/Unity/cache/packages/packages.unity.com/com.unity.textmeshpro@1.2.2/Scripts/Runtime/TMP_MaterialManager.cs:60)
    35. TMPro.TextMeshProUGUI:GetModifiedMaterial(Material) (at /Users/buildbot/Library/Unity/cache/packages/packages.unity.com/com.unity.textmeshpro@1.2.2/Scripts/Runtime/TextMeshProUGUI.cs:258)
    36. TMPro.TMP_MaterialManager:GetMaterialForRendering(MaskableGraphic, Material) (at /Users/buildbot/Library/Unity/cache/packages/packages.unity.com/com.unity.textmeshpro@1.2.2/Scripts/Runtime/TMP_MaterialManager.cs:326)
    37. TMPro.TextMeshProUGUI:get_materialForRendering() (at /Users/buildbot/Library/Unity/cache/packages/packages.unity.com/com.unity.textmeshpro@1.2.2/Scripts/Runtime/TextMeshProUGUI.cs:28)
    38. TMPro.TextMeshProUGUI:UpdateMaterial() (at /Users/buildbot/Library/Unity/cache/packages/packages.unity.com/com.unity.textmeshpro@1.2.2/Scripts/Runtime/TextMeshProUGUI.cs:284)
    39. TMPro.TextMeshProUGUI:Rebuild(CanvasUpdate) (at /Users/buildbot/Library/Unity/cache/packages/packages.unity.com/com.unity.textmeshpro@1.2.2/Scripts/Runtime/TextMeshProUGUI.cs:216)
    40. UnityEngine.UI.CanvasUpdateRegistry:PerformUpdate() (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/CanvasUpdateRegistry.cs:150)
    41. UnityEngine.Canvas:SendWillRenderCanvases()
    42. UnityEngine.Canvas:ForceUpdateCanvases()
    43. UnityEngine.UI.ScrollRect:EnsureLayoutHasRebuilt() (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/ScrollRect.cs:259)
    44. UnityEngine.UI.ScrollRect:LateUpdate() (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/ScrollRect.cs:382)
    45. (Filename: /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/CanvasUpdateRegistry.cs Line: 229)
    Any ideas?... (talking about that shader problem I'm still having with Unity Cloud builds)
     
  31. TJHeuvel-net

    TJHeuvel-net

    Joined:
    Jul 31, 2012
    Posts:
    838
    Are there still plans to ship the source code? Because i just installed 2018.1b and only got the DLLs
     
  32. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    If you installed TextMesh Pro via the package manager, it is provided as source code. The source code is located in the cache location of the packages which on windows is in "ProgramData\Unity\cache\packages\packages.unity.com\com.unity.textmeshpro@1.2.2"
     
  33. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,113
    @Stephan_B, any plan to make TextMesh Pro supports int text output directly instead of converting int to string for text output? So, gc issue can be solved.
     
  34. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I presume you mean something like string text = TMP_Text.text?

    I certainly understand checking the output of a TMP_InputField.text but what is the use case for getting the text from a component?

    P.S. General questions that are not specific to Unity 2018.1 and the conversion to the TMP UPM package should go into the main section of the "Unity UI & TextMesh Pro" forum. This way information can be more easily found in searches.
     
  35. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,113
    Nope. I mean make it something like TMP_Text.text = 123 so TMP_Text.text can directly feed in int/float/double/etc numeric value instead of string. There is always have this use case most of the time that you need to update your UI text frequently for numeric value. If you always needs to convert your numeric value into string before passing to TMP_Text.text. It's quite expensive if you have a lot of UI texts.
     
  36. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789
    there are methods for that already, "settext" or similar.
    They have format arguments and they are optimized, they do custom "number to symbols" conversion and don't rely on ToString or string.Format.

    You just have to cast your int to a float, that shouldn't cause any problems, and you can specify the format as well (0, 0.0, 0.00, ...)
     
    Stephan_B likes this.
  37. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The TMP_Text.SetText() function also includes a StringBuilder overload. See the following post.
     
  38. lulitd

    lulitd

    Joined:
    Feb 20, 2016
    Posts:
    13
    Currently attempting to use TMPro v 1.2.2 with 2018.1.0b12.

    Unable to install it via the package manager as TMPro's package.json file is empty.

    This was a result an unexpected shutdown during install. How would I go about fixing this?
     
  39. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Packages on Windows are cached in "C:\ProgramData\Unity\cache" and referenced in the npm folder and contained in the packages folder. You will need to look in there for references to the TMP package and remove / delete them or you can simply delete the whole cache folder (provided you didn't change any source code of other packages contained in there).
     
    lulitd likes this.
  40. lulitd

    lulitd

    Joined:
    Feb 20, 2016
    Posts:
    13
    Thanks, Stephan! Deleting the appropriate folders worked. I was unsure if it was safe to delete the cache.
     
    Stephan_B likes this.
  41. rfuller

    rfuller

    Joined:
    May 25, 2017
    Posts:
    1
    Just wanted to report a successful conversion from paid TMPro package on 2017.4 to 2018.1 on a large project with TONS of TMPro components, font assets and materials spread across asset bundles, scenes, and prefabs.

    I followed the procedure you posted exactly (first post) and it worked perfectly. Very happy to be in sync with the Unity package now. Thanks for making that so easy!
     
    Stephan_B likes this.
  42. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Glad to hear and thank you for taking the time to share this information.

    I have been converting every user project that has been provided to me via the bug reporter or directly which is usually for the purpose of investigating some unrelated potential issue and although I haven't come across any issues in the conversion process, it is still very nice to get additional feedback. So again thank you :)
     
  43. cxode

    cxode

    Joined:
    Jun 7, 2017
    Posts:
    268
    Will TextMeshPro later be renamed to just Text and replace the Unity text components?
     
  44. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I don't know if the new text system will get a specific name. Until then, it will be known as the new text system :)

    The components themselves will get a class / name that allows them to be differentiated from each other.

    There will be several text components. We need a text component that work with the Mesh Renderer which is mostly used in worldspace / XR applications. We need a text component that works with the Canvas Renderer / system.

    Although not text components per say, UI Element and the Editor will be accessing / using the new text system.

    Since user input is also needed in most of these cases, you will also have TextField type components and comparable types for use with UI Element and in the Editor.

    All these will have a text property and support mostly the same functionality / rich text options, etc.
     
    ocnenued and cxode like this.
  45. ocnenued

    ocnenued

    Joined:
    Apr 4, 2018
    Posts:
    26
    @Stephan_B Hey man, thanks a lot for the painless upgrade process.

    The issue we're facing is that after the clean upgrade process (which worked out fine, we were able to run our scenes without any issues), we pushed our code to "Collaboration" and it failed throwing this namespace error:
    The type or namespace name `TextMeshProUGUI' could not be found. Are you missing an assembly reference?
    also this:
     The type or namespace name `TMPro' could not be found. Are you missing an assembly reference? 


    Any idea why this is happening? In the meantime, we just triggered a clean build from the unity cloud dashboard (EDIT: same error.)
     
    Last edited: May 3, 2018
  46. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I suspect it might be related to the use of assembly definitions with the new package version of TMP and on your end where you need to manually add a reference to the Unity.TextMeshPro and Unity.TextMeshPro.Editor in your own assembly. See the following post above.
     
  47. ocnenued

    ocnenued

    Joined:
    Apr 4, 2018
    Posts:
    26
    When I try to import Unity.TextMeshPro, I get "Unable to resolve symbol TextMeshPro"
     
  48. Disastercake

    Disastercake

    Joined:
    Apr 7, 2012
    Posts:
    317
    Just wanted to confirm that following these steps seemed to have work flawlessly for me. Thank you for putting the work into a converter tool!
     
    Stephan_B likes this.
  49. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    What version of the TMP UPM package is installed? You can check via the Package Manager or check the TMP Settings. In my case, the version is 1.2.3 but your should be 1.2.2.

    upload_2018-5-3_12-43-45.png
     
  50. Jason_Spree

    Jason_Spree

    Joined:
    Apr 5, 2018
    Posts:
    7
    I had the same issue and solved it by removing all the Visual Studio-related files (.csproj, .sln) from the project directory and then getting Visual Studio to rebuild them.