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 Import TMP Essentials through package manager / git / dependencies ?

Discussion in 'UGUI & TextMesh Pro' started by JALIK, Mar 14, 2021.

  1. JALIK

    JALIK

    Joined:
    Mar 14, 2021
    Posts:
    2
    Hello everyone ! I've been looking for a solution to my problem online but couldn't find any...

    I've been using Unity (currently using 2019.4), git and TMP for years and I would like to use them in a more efficient way :
    Every time I want to use TMP in a new project, I go to Window > Text Mesh Pro and click "Import TMP Essentials" which adds a whole folder in my asset folder.
    This folder is then added to my git repository wich suddenly becomes 99% TMP and 1% my Unity project...

    This does allows for my friends to clone the project and work on it without any problems, but I find it too bad to have to add a whole package right in the asset folder...

    Another solution would be to ignore the TextMesh Pro folder in the .gitignore : this would make my git repository more clean, but my friends to reimport manually TMP Essentials when cloning, which bugs me a little bit...

    Is there any way to declare TMP Essentials somewhere so that, in Unity the TMP Essentials folder would be listed in "Packages" instead of "Asset" ? This would allow to :
    1) Keep the git repository clean, and does not contain the whole TMP Essentials folder
    2) Work on the project just by git cloning it, without having to import anything.

    Maybe the manifest.json file could be manually edited ? Or by adding some sort of official git link in the package manager ?

    Thank you for reading !
     
    ebulku likes this.
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Files contained in the Packages folder are read-only.

    Since it is common for users to edit / modify some of these Resources like font assets, styles, TMP Settings which amongst other things defines the default font asset, fallbacks, style sheet, etc. these resources are placed in the project to make them accessible to the user.
     
  3. JALIK

    JALIK

    Joined:
    Mar 14, 2021
    Posts:
    2
    Oh okay that makes sense ! Thanks !

    So a quick solution would be to ignore *some* of TMP Essentials files but not the files containing custom assets (custom fonts, etc...). This would force coworkers to install TMP beforehand...

    What would be top notch however is to move all of the files from TMP Essentials that we don't want to modify into a private git repository (that we would add through the package manager : wihch would end up in the "Packages" folder). And the other asset that we do want to modify : leave them in the Asset folder and the project's git repo.

    I wonder if that would be feasable, maybe it would require to write some code.
    I'll look into it and keep this forum updated if I find anything. If you have any insights or advice I would be glad to listen :D
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I do not recommend saving any resources / assets inside the "TextMesh Pro" folder hierarchy. Your font assets and other resources, should be saved in their own "Resources/Fonts & Materials/..." in the case of font asset or material presets.

    BTW: This "Resources/Fonts & Materials/..." is the default location specified in the TMP Settings.