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 TextMesh Pro Open Source Repository?

Discussion in 'UGUI & TextMesh Pro' started by IsaiahKelly, Feb 13, 2018.

  1. IsaiahKelly

    IsaiahKelly

    Joined:
    Nov 11, 2012
    Posts:
    418
    Are there any plans to make the new Unity integrated TextMesh Pro package a publicly available open-source repository? Just like the Unity UI and networking packages. I'm very interested in trying to maybe help improve the TextMesh Pro inspector and I'm sure there are many other talented people in the community that would love to contribute to the project as well. So this seems like a natural next step.
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    With Unity 2018.1, TMP will be available via the new Unity Package Manager and in 2018.2 should be included with the Editor by Default.

    Currently, I am not sure what the plans are with respect to providing access to Repositories for packages so I will have to inquire about this.

    Until then, since the version of TMP available for 2018.1 includes source code, please feel free to share any suggestions directly to me via email or pm.
     
  3. IsaiahKelly

    IsaiahKelly

    Joined:
    Nov 11, 2012
    Posts:
    418
    From what I understand, source code is only included in the old paid version, which I do not own. Are you talking about some new free version that now includes the source? I've checked the latest free Asset Store versions of TMP, but can't find any source.
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Correct. The release for Unity 2018.1 which is delivered via the Unity Package Manager includes source code.
     
  5. IsaiahKelly

    IsaiahKelly

    Joined:
    Nov 11, 2012
    Posts:
    418
    Thanks. Where exactly are Package Manger packages and the source code located on Windows?
     
  6. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The Unity Package Manager is a new feature in 2018.1. you need to access it via the Window menu as seen below

    upload_2018-2-12_19-11-18.png

    Once the Package Manager is open, you will find TextMesh Pro listed in there.

    upload_2018-2-12_19-12-25.png

    Please be sure to follow the instruction posted here for installing and upgrading to this new version.

    Packages are installed in a central location which is on Windows is C:\ProgramData\Unity\cache\packages\packages.unity.com

    There you will find the folder for the various version of TMP that have been installed with UPM.
     
    Armynator and IsaiahKelly like this.
  7. IsaiahKelly

    IsaiahKelly

    Joined:
    Nov 11, 2012
    Posts:
    418
    I have already installed TMP using the Package Manager in 2018.1 beta. Problem is I don't know where the actual source code folder is after doing so. Kind of the same issue Player7 had in the thread you linked to:

     
  8. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    From my previous post
     
    twobob likes this.
  9. IsaiahKelly

    IsaiahKelly

    Joined:
    Nov 11, 2012
    Posts:
    418
    Oops! Sorry, I totally missed that part of your reply. Probably because I thought it was just covering installation. Found it now. Thank you very much for taking the time to help such a clueless idiot. :)
     
  10. bonzaiferroni

    bonzaiferroni

    Joined:
    May 26, 2016
    Posts:
    30
    Here is an update for anyone else who is trying to see the source. As of 2018.1.1f1 the packages are no longer in C:\ProgramData and are located at this path:

    C:\Users\Username\AppData\Local\Unity\cache\packages\packages.unity.com
     
  11. senghoff

    senghoff

    Joined:
    Feb 11, 2017
    Posts:
    10
    Hi Stephan,

    I have been handed a legacy Unity project, which includes a dated (2016) version of the paid TMP add-on. The complexity of the project means that updating to the free version is not really a feasible option. Would it be possible to e.g. pay for a TMP license to get access to the latest paid TMP?

    With thanks,
    Sigurd
     
  12. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    It is no longer possible to purchase TextMesh Pro. However, the version of TextMesh Pro available via the package manager includes source code and a utility to convert existing TMP related files to the new GUID and File ID set used by these new versions.
     
  13. senghoff

    senghoff

    Joined:
    Feb 11, 2017
    Posts:
    10
    That is very helpful. Is there a means of making this approach work in older versions of Unity? - the project runs in Unity 5.6.5
     
  14. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Unfortunately not on earlier versions.

    I would suggest reaching out to your Unity account rep to see if they can work something out.
     
  15. senghoff

    senghoff

    Joined:
    Feb 11, 2017
    Posts:
    10
    How do I determine who is my "Unity account rep" and their contact details?
     
  16. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Hi Stephan,

    Do you have an update on this? Packages like PostProcessing or the Scriptable Render Pipeline (which is a whole set of packages) are already on GitHub, and that is really helpful because the package manager does some really nasty things when you just quickfix issues you run into (it will frequently just overwrite those changes, without any warning), and embedding packages takes them out of version control, so you can't really update the package once you made changes ... plus, a GitHub repository would let us do pull requests, which would also make your life easier ;-)

    The issue that prompted me to look for the GitHub repository of TextMesh Pro (a search that ended up here):

    From TextMesh Pro 1.3.0 to 1.4.0, TMP_InputField broke really badly in our project, which uses the SteamVR Keyboard for input. Finding that issue would have been really easy for me if I had had the history of TMP_InputField.cs. Without source code repository access, I had to try one version after the other (going backwards from 2.0.1).

    And now that I have the fix, I have to copy it over to various locations.

    The issue is that under some circumstances, inputSystem (which is a private property of TMP_InputField) can be null. Interestingly, for compositionString, that case is properly covered by having another property that uses inputSystem, if it is not null, and Input, if it is. What I did to fix my issue was adding three more similar properties:

    Code (CSharp):
    1.         private Vector2 compositionCursorPos
    2.         {
    3.             get { return inputSystem != null ? inputSystem.compositionCursorPos : Input.compositionCursorPos; }
    4.             set { if (inputSystem != null) { inputSystem.compositionCursorPos = value; } else { Input.compositionCursorPos = value; } }
    5.         }
    6.  
    7.         private bool touchSupported
    8.         {
    9.             get { return inputSystem != null ? inputSystem.touchSupported : Input.touchSupported; }
    10.         }
    11.  
    12.         private IMECompositionMode imeCompositionMode
    13.         {
    14.             get { return inputSystem != null ? inputSystem.imeCompositionMode : Input.imeCompositionMode; }
    15.             set { if (inputSystem != null) { inputSystem.imeCompositionMode = value; } else { Input.imeCompositionMode = value; } }
    16.         }
    17.  
    ... and then, of course, remove all instances of "inputSystem." in the remaining file so that instead of accessing those properties of inputSystem (which could be null), the locally defined properties with the fallback to Input are called.

    So, yeah, being able to send you a Pull request would make this a whole lot easier (besides, I just fixed another, unrelated issue where a Null-check was missing ... another trivial Pull-request, if I could create one).
     
    AnomalusUndrdog and patrik-org like this.
  17. patrik-org

    patrik-org

    Joined:
    Sep 10, 2012
    Posts:
    100
    I agree with jashan. The developer has done an amazing job with it, but I think it's an excellent idea to make it open source on GitHub ,so the community can help out improving it.
     
    Skyblade and jashan like this.
  18. Deleted User

    Deleted User

    Guest

    @jashan if that's still an issue and not reported I'd recommend to report a Unity bug on their issue tracker so it can be fixed internally.
    I agree, there are a lot of spots where debugging into Unity's code would be awesome (UI for example)
     
  19. Deleted User

    Deleted User

    Guest

    You can also access the source files directly from the Unity Editor (Project View -> Packages)
    upload_2020-3-31_7-44-3.png

    Opening them like this lets you debug the scripts in VS.
     
    Last edited by a moderator: Mar 31, 2020
  20. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    The issue is not accessing the source files, that part is trivial. The issue is that the source files are downloaded by the package manager and in no way connected to version control. And there's no way to fix that because there is no public repository for TextMesh Pro. So any changes that you make in the source code will put you into "manual-merge-with-source-control-hell" (you need to make a backup, update the package, then manually look for any changes ... or, put the whole package into your own version control, which at least solves the "have to make a backup" step).
     
  21. cjacobwade

    cjacobwade

    Joined:
    Jun 8, 2013
    Posts:
    10
    Running into the same problem as Jashan. I appreciate having TMP as a package by default, but it's really important to be able to extend the package as well, otherwise this ends up being more limited even than previous iterations.

    Currently the setup tool is hard coded to expect TextMeshPro to be installed as a package, so there's not a straightforward way to move the package into the project and have it work as expected.
     
    glitchers, cp- and jashan like this.
  22. cp-

    cp-

    Joined:
    Mar 29, 2018
    Posts:
    78
    Another 'yes please' to the idea of an open repository.

    Thanks for pointing that out as I was just desperate enough to try so too :)
     
    AnomalusUndrdog and jashan like this.
  23. techmage

    techmage

    Joined:
    Oct 31, 2009
    Posts:
    2,133
    Could I make new components that rely on TextMeshPro and release them on the asset store?
     
  24. aholla

    aholla

    Joined:
    May 27, 2014
    Posts:
    81
    Hi to reopen this, is there a git hub repo?

    I see in the change log there is a preview version 3.2.0 but all i can get in package manager is 3.0.6.

    Im getting some bugs and would like to test out the latest versions as 3.0.6 is almost 6 months old.
     
  25. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Depending on the version of Unity that you are using 2020 vs. 2021 vs. 2022, enabling showing preview packages may not show preview packages :confused:

    As such, you will need to edit the "manifest.json" file contained in "ProjectRoot/Packages/..." to add a direct reference to 3.2.0-pre.1.
     
    aholla likes this.
  26. GroovyKoala

    GroovyKoala

    Joined:
    Feb 16, 2022
    Posts:
    23
    Hi @Stephan_B , is there a way to modify the source packages on a project?

    I need to fix the way a unicode string is added when creating a new asset file.

    It's in the file:

    Packages/com.unity.textmeshpro/Scripts/Editor/TMP_SpriteAssetImporter.cs


    in the PopulateSpriteTables method, on the line 188, the unicode is hardcoded. An because I'm trying to import a set of emojis based on its json table, the result is that every glyph ends up with the same unicode value

    upload_2022-11-8_18-14-8.png

    Also tried to create a new class based on the code TMP_SpriteAsset and TMP_SpriteAssetImporter, but the result asset is broken and does not save correctly the glyph images.

    upload_2022-11-8_18-17-50.png