Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

TextMesh Pro Couldn't open include file 'TMPro_Properties.cginc??? Why not?

Discussion in 'UGUI & TextMesh Pro' started by Immersive-Matthew, Jul 29, 2021.

  1. Immersive-Matthew

    Immersive-Matthew

    Joined:
    Mar 24, 2020
    Posts:
    137
    Second post as I thought I had it solved, but I do not. As the title states, I was getting the error at the bottom when I go to build for the Android based Oculus Quest.

    I am on Untiy version 2021.1.15f1
    TexMesh Pro version: 3.06
    OpenXR version: 1.2.3
    Building to Vulkan

    Steps that got me here. I wanted to clean up my project so I exported all scenes as a package and imported into a new project. All went well until I went to build to the Oculus Quest and got the error below. I did a search and followed a few tips such as reimporting the TMP Essentials and Examples all to now avail. I uninstalled it and reinstalled, plus deleted and recreated my library. I then played eith the shader for the font I am using thought I had it working, but alas I do not.

    I am stumped and need someone who knows more about Text Mesh Pro than I do. Thanks for your help.


    Error:
    Shader error in 'TextMeshPro/Mobile/Distance Field Overlay': Couldn't open include file 'TMPro_Properties.cginc'. at line 93
    Compiling Vertex program with STEREO_MULTIVIEW_ON UNITY_UI_CLIP_RECT
    Platform defines: UNITY_NO_DXT5nm UNITY_NO_RGBM UNITY_ENABLE_REFLECTION_BUFFERS UNITY_NO_CUBEMAP_ARRAY UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER SHADER_API_MOBILE UNITY_LIGHTMAP_DLDR_ENCODING
    Disabled keywords: OUTLINE_ON UNDERLAY_ON UNDERLAY_INNER UNITY_UI_ALPHACLIP UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_PBS_USE_BRDF2 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_RGBM_ENCODING UNITY_LIGHTMAP_FULL_HDR UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30v
     
  2. Immersive-Matthew

    Immersive-Matthew

    Joined:
    Mar 24, 2020
    Posts:
    137
    I solved it finally by finding the shader the font was using and right click to choose reimport.
     
    kreso, EJSainz, angles20 and 3 others like this.
  3. april_4_short

    april_4_short

    Joined:
    Jul 19, 2021
    Posts:
    489
    One interesting side effect of Packages is that the system (Unity) wants to consider them sacrosanct and immutable. Or so I've been told.

    As a result, what you do in modifying them is not permanent, and Unity does some kind of refresh of them, at certain times. One of those times is restarting Unity, but there are other times it refreshes them, too. I suspect building is one of them, as are changes to the Project Settings... as unrelated changes to the Project Settings seem to create a refresh cycle, too.

    However, apparently there's a global cache for packages, that can be changed, and those changes are supposed to stick around and work. I tried seven ways to Sunday to get this to work, but could not.

    https://forum.unity.com/threads/how-to-make-a-custom-tmp-shader-and-inspector-ui.1144454/

    You can see those troubles in the thread linked above, and the proposed alternative approach from @Stephan_B of creating another folder entirely. I did this, and it somehow worked. I can't figure out how that new folder and its new content is known about, but it is, and it somewhat works... so far.

    Side effect, though... it feels like Unity has to rebuild the entire TextMeshPro package every time I run the game, now, or something else is slowing it down, after this change, whenever I change ANY script in the project and rebuild or run in the editor.
     
    Immersive-Matthew likes this.
  4. jacksonkr

    jacksonkr

    Joined:
    Jan 22, 2013
    Posts:
    23
    I solved this but changing the path of the include

    eg.

    Code (CSharp):
    1. #include "../../Store/TextMesh Pro/Shaders/TMPro_Properties.cginc"
    extra:

    I also commented out
    TMPro.EditorUtilities.TMP_SDFShaderGUI
    at the bottom which reveals ALL of the shader options
     
  5. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,596
    This behavior is typically the result of some import issue where re-importing the TMP Essential Resources or just the shaders typically resolves this issue.

    If your project is going back to a few years ago where the TMP shaders were located in a Resources folder, I would suggest deleting the Shaders folder contained in this Resources folder and then re-importing the TMP Essential Resources / Shaders which will place them in their new location which is "TextMesh Pro/Shaders/..."
     
  6. Jelmer123

    Jelmer123

    Joined:
    Feb 11, 2019
    Posts:
    244
    I also get this suddenly for no reason. Why is TMP being pushed by Unity editor while it is badly integrated.
     
  7. protanker25

    protanker25

    Joined:
    Aug 7, 2021
    Posts:
    2
    Thanks a lot. In my case it worked. Couldn't fix it for a long time.
     
  8. generalred512

    generalred512

    Joined:
    Nov 8, 2021
    Posts:
    2
    This solution didn't work in my case. What did work was to go under Edit -> Rendering -> "Generate Shader Includes". Then doing a reimport of the shaders in TMPro just in case. This might be because I have a URP project.
     
  9. Oyoshi

    Oyoshi

    Joined:
    Sep 2, 2022
    Posts:
    1
    Hi, for those having tried everything above and did not find the solution (same as me). I found another solution.

    I have my project on github which stores only the things that aren't generated by unity fully automatically. So I cloned my project again and the errors disappeared.

    If you dont work with git, you can try deleting the following folders, i think that it would perform the same :
    • Library
    • Logs
    • Temp
     
    Frojd00 likes this.
  10. MaZy

    MaZy

    Joined:
    Jun 29, 2012
    Posts:
    107
    Thanks helped me. I just pulled from git and had the error.
     
  11. q8sr

    q8sr

    Joined:
    Nov 21, 2014
    Posts:
    4
    Old versions of TextMeshPro installed into a Plugins/ folder. If you update to the latest version of TextMeshPro, delete the Plugins/TextMeshPro folder - otherwise when you import the Essentials asset Unity will not move the files to the right spot. The files that were previously in Plugins/ includes TMPro_Properties.cginc
     
  12. Frojd00

    Frojd00

    Joined:
    Aug 21, 2020
    Posts:
    3
    Thank you! I came out of nowhere and only affected one person from the team. This is the only thing that helped me.
     
  13. CSEliot

    CSEliot

    Joined:
    May 9, 2014
    Posts:
    34
    I fixed it by doing a 'reimport' on the TMPro_Properties.gcinc file. Opened it up in VS, made a "change" (add harmless space in file) and then saved, forcing a reimport. Perhaps the file was 'locked' ?
     
    Turtle_In_Space and fipsy like this.
  14. daxiongmao

    daxiongmao

    Joined:
    Feb 2, 2016
    Posts:
    412
    I fixed my issue by searching my project for the missing include.
    And I ended up finding another set of extras in my project.

    They were included TerrainDemoScene_URP sample. Not if this is an oversight or old version but not sure why unity would put out a sample that doesn't use the packages.

    I deleted the folder there and the one created by the package and then reinstalled the package versions and now all is well.
     
    HSplinter likes this.