Friday, April 13, 2018

unity - Is there an upgrade path from Asset Store to package manager for TextMesh Pro?


A little while back I used the Asset Store to install TextMesh Pro after following a tutorial. The version I got was 1.2.2. I have since then had it pointed out to me that the newest version is now available through the Package Manager. The version there is 1.2.3.


I have tried changing which version i am using but have had no luck. I did quite a bit of work with adding texts and do not want to redo all of it. Simply deleting the package from my app, and then installing it from the package manager does not work. All text scripts end up not linked.


Is there anything I can do to switch my project over from the app store to the package manager?



Answer



Yes, upgrading to the new package manager version of TextMesh Pro requires the use of a utility tool to convert these existing projects to use the new sets of GUIDs and FileIDs. Using this tool will ensure that your text scripts remain linked.


See this Unity official forum thread: TextMesh Pro & Unity 2018.1. As explained there, here are the steps:



This new version of TMP will be made available via the new Unity Package Manager (also part of Unity 2018.1). These new Unity Package Manager (UPM) packages are shared between all projects. This new version of TMP includes source code and uses the new Assembly Definition feature introduced in Unity 2017.3.



Due to how this package manager works, it is important to understand this new version of TextMesh Pro will be using a completely different / unique set of GUIDs and FileIDs which was necessary to make sure it did not conflict with the current sets of GUIDs and FileIDs used by the source code and DLL only versions of TMP currently out there. As such project files and assets created with previous versions of TMP will require the use of a utility to convert these existing projects to use the new sets of GUIDs and FileIDs.


During the beta period for 2018.1, I would love to get your feedback and most importantly assistance to test this project conversion utility to make sure it correctly handles the conversion process.


My suggested upgrade steps are as follows but expect these may change based on your feedback.




  1. Before installing Unity 2018.1, open your project in your current version of Unity and close all scenes you might have opened. Using "File -> New Scene" will close current scenes. In this step we are trying to avoid having any TMP resources or DLLs loaded when you first open Unity 2018.1. Failing to do so will just confuse the crap out of Unity and make the upgrade process more complex.




  2. As usual, please backup your project before upgrading to this new version of TMP and Unity 2018.1.





  3. Install Unity 2018.1. Personally, I always install new major versions of Unity in separate folders which allows me to use multiple versions of Unity for testing and what not.




  4. Open Unity 2018.1 and expect to see lots of error messages since the older version and new versions of TMP are present thus resulting in class conflicts. This could be avoided by deleting the "TextMesh Pro" folder in step (1) but it isn't necessary as once the previous version of TMP is removed by deleting the "TextMesh Pro" folder these errors will go away. That is provided you did close any open scene using TMP in step (1). Once the "TextMesh Pro" folder is deleted, Unity will go through an Assembly Reload and the new version of TMP will finally be loaded.




Note that I could have used a new namespace for this new version but this would have required updating all the scripts referencing the "TMPro" namespace which given these errors only show up during this upgrade process, going thru all the scripts to change the namespace would have been more complicated in my opinion.



  1. Now we need to import the Essential Resources that TextMesh Pro needs. These are the default font asset, sprite asset, stylesheet, shaders, etc. You can add these to your project by going to the "Window - TextMeshPro - Import TMP Essential Resources" menu. These resources will be added to your project in the "TextMesh Pro" folder.



Note: These resources could have been contained inside the new TMP UPM package but these would have be hidden and given they would be inside a Resources folder to make it possible to access them at runtime, they would have been part of any build whether or not TMP is used. As such I thought it would be better to make those visible to users by adding them into the local project and giving you control over them.



  1. Lastly, since this new version of TMP uses a new set of GUIDs and FileIDs, we will need to convert your existing project files and resources to use this new set. To convert the project, go to "Window - TextMeshPro - Project Files GUID Remapping Tool". This will open the new Project GUID Remapping Tool which will enable you to Scan the Project to find the resources and files than need to be converted and then if you chose convert them to the new set of GUIDs and FileIDs used by this new version of TMP. Please be sure to following the instruction provided in the tool and to have made a backup of your project first.


Please provide feedback on this process and most importantly let me know if you run into any unforeseen issues. I have run through this process many times with various projects and it worked fine. On the other hand, "Murphy's Law" is always in full force so provided you backed up your project first, we'll be able to iron out whatever issues and make sure we get all these projects converted over nicely.





EDIT: For reference, see below for an example of an error message before taking the steps to upgrade. As explained above, these error messages are due to the older version and newer version of TMP both being present. (I got this error message while upgrading to Unity 2018.2 from 2017.3.)


Assets/TextMesh Pro/Examples/Scripts/FloatingText.cs(86,30): error CS0121: The call is ambiguous between the following methods or properties: `TMPro.TMPro_ExtensionMethods.Compare(this UnityEngine.Vector3, UnityEngine.Vector3, int)' and `TMPro.TMPro_ExtensionMethods.Compare(this UnityEngine.Vector3, UnityEngine.Vector3, int)'

No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...