Search Unity

TextMesh Pro [BUG] I can't change settings of shader

Discussion in 'UGUI & TextMesh Pro' started by Finijumper, Jul 3, 2017.

  1. Finijumper

    Finijumper

    Joined:
    Jul 12, 2016
    Posts:
    79
    I could change settings of every text before, but now I can't click, as you can see Underlay is enabled, but I can't modify it or unable it again. This happens with all the text and I have reinstalled TextMesh Pro without solving anything.

    I would appreciate some help, thanks.

    upload_2017-7-3_21-22-0.png
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    What version of Unity and TMP are you using?

    As per the name of the Material being used, this is an instanced material resulting from the use of a UI Mask. You should be able to modify its properties. I'll try to take a look tomorrow.

    In the meantime, unless you need to use the UI Mask, I suggest switching to a 2D RectMask.
     
  3. Finijumper

    Finijumper

    Joined:
    Jul 12, 2016
    Posts:
    79
    Unity Version: 5.6.2f1
    TMP Version: 1.0.55.0b10 (I deleted the entire folder and imported it again from the asset store)
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Is that version 1.0.55.56.0b10?

    Do you need to be using the Stencil Mask (UI Mask)? You can use the 2D Rect Mask which works on all mobile devices and has better performance.

    I am traveling for most of the day tomorrow but will try to take a look when I get to my destination.
     
  5. Finijumper

    Finijumper

    Joined:
    Jul 12, 2016
    Posts:
    79
    Yes it is. How can I change the UI Mask to 2D Rect Mask?
     
  6. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    You should be able to simply remove the UI Mask component and add a 2D RectMask instead. Note that the 2D RectMask doesn't need an image component nor a CanvasRenderer either. So just an object with the RectTransform, 2D RectMask and that is it.
     
    amxxvi, CakeMuffinCo and Andrei_S like this.
  7. Kmausser

    Kmausser

    Joined:
    Feb 17, 2016
    Posts:
    23
    Having an issue where the settings for the shader settings don't even appear.

    I see this: Screen Shot 2017-07-17 at 9.57.09 AM.png

    And when I click on "settings" for outline, Underlay and Debug below it just disappear. So essentially I have no way of adding a drop shadow.

    Using TMP 1.0.55.0b11 and Unity 17.1.0f3
     
  8. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    When you click on the panel header (like Face), the panel should expand again to reveal those options.
     
  9. Kmausser

    Kmausser

    Joined:
    Feb 17, 2016
    Posts:
    23
    You are right, It should. But instead it just hides all the headers underneath it. I have no way of getting to the settings.

    Screen Shot 2017-07-17 at 1.26.28 PM.png


    When I click on "Face": Screen Shot 2017-07-17 at 1.26.41 PM.png
     
  10. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    When you updated to Unity 2017.1, did you also update TextMesh Pro to the release for Unity 2017.1?

    There was (1) API change which affects the material inspector which would result in some errors if you don't get the release for 2017.1.

    A link to download the release for Unity 2017.1 is available in the top TextMesh Pro sticky thread in the section of the forum.
     
  11. Kmausser

    Kmausser

    Joined:
    Feb 17, 2016
    Posts:
    23
    I wasn't aware the asset store wasn't the most updated. I downloaded "TextMesh Pro - Release 1.0.55.2017.1.0b11 (dll only).unitypackage" and it initially made all text disappear, but then I deleted the TMP folder and re-imported like the upgrade note says and it now works. Thanks!
     
    Stephan_B likes this.
  12. Finijumper

    Finijumper

    Joined:
    Jul 12, 2016
    Posts:
    79
  13. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    There is something else going on as expanding those shader panels should be working.

    See if you get the same behavior in a new empty project and importing the latest release of TMP.
     
  14. Finijumper

    Finijumper

    Joined:
    Jul 12, 2016
    Posts:
    79
    I already have the latest version, and I don't even need to create an empty project, it works well in a new empty scene.
     
  15. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I thought we were still on the same initial issue.

    In this particular case, this is due to the material being an instanced material as a result of using a UI.Mask. Editing the instance is not possible but editing the material preset (from which it was derived) will work.

    In the next release of TMP (which should be available this week), this will be improved upon and you will be able to edit the instanced material.
     
  16. Finijumper

    Finijumper

    Joined:
    Jul 12, 2016
    Posts:
    79
    Thanks, I'll wait for the update.
     
  17. Finijumper

    Finijumper

    Joined:
    Jul 12, 2016
    Posts:
    79
    Has it been realeased?
     
  18. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    New release should be available tonight (before I go to sleep).
     
  19. Finijumper

    Finijumper

    Joined:
    Jul 12, 2016
    Posts:
    79
    Thanks.
     
  20. janvetulani3r

    janvetulani3r

    Joined:
    Feb 8, 2017
    Posts:
    12
    Hi! Was this fixed?
    I have the same issue of not being able to modify the shader properties, and when clicked they jsut completely disappear.
    Using Unity 2017.1.0f3
     
  21. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    This was fixed in the last release so make sure you are using the latest release. Be sure to review the release notes and follow upgrade notes.

    In terms of the previous behavior, this was only happening when using a UI.Mask component on one of the parents of the text object. In terms of the disappearance, that is something new. What is disappearing? The controls or the text?

    I would suggest testing an a new empty project where you import the latest release to see if you can reproduce it.
     
    TadasTalalas likes this.
  22. GmanREE

    GmanREE

    Joined:
    May 22, 2018
    Posts:
    3
    i have the same problem where i have nothing there... and i using the latest tmp available on asset store
     

    Attached Files:

  23. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    If you click the Outline or Underlay section, it should expand to reveal those options.
     
  24. KarlKarl2000

    KarlKarl2000

    Joined:
    Jan 25, 2016
    Posts:
    606
    @Stephan_B I'm geting this error when I try to make custom fonts.

    UnassignedReferenceException: The variable material of TMP_FontAsset has not been assigned.
    You probably need to assign the material variable of the TMP_FontAsset script in the inspector.
    UnityEngine.Object.get_name () (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:195)
    TMPro.EditorUtilities.TMP_UiEditorPanel.GetMaterialPresets () (at C:/Users/PC/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.textmeshpro@1.2.4/Scripts/Editor/TMP_UiEditorPanel.cs:825)
    TMPro.EditorUtilities.TMP_UiEditorPanel.OnInspectorGUI () (at C:/Users/PC/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.textmeshpro@1.2.4/Scripts/Editor/TMP_UiEditorPanel.cs:311)
    UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor[] editors, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1295)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)


    I was using an older version that didn't need me to make materials. I updated to 1.2.4 through the package manager and now I get these errors. I can generate a font atlus, but TextMeshPro UI won't let me use those fonts without getting these red errors.

    Do you have any suggestions? Thanks
     
  25. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Did you go through the project files GUID remapping process?
     
  26. Botcho

    Botcho

    Joined:
    Jul 13, 2018
    Posts:
    3
    I had to fully delete my current TextMeshPro object and then re-create it from the "Create" button in the Hierarchy. All the options then magically reappeared.
     
  27. TadasTalalas

    TadasTalalas

    Joined:
    Nov 7, 2016
    Posts:
    33
    One of my parents has Mask component on it to mask my Scroll Rect content, now I cannot edit material in textmeshprougui text component on child of my content. Is there any way to allow material to be editable? Or something? In my content I want to add a number representing order of components for the player, only other way i can figure out is to create small image instead of text component? But that is ridiculous. :D
     
  28. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The material is not editable because it is an instance material created as a result of the use of the mask. Do you need to use a UI Mask? You can replace the UI Mask by a RectMask2D which will not result in the creation and use of an instance material in which case you will be able to create and use material presets.

    Why do you need to modify the material to add this number? What are you trying to modify on the material?
     
    TadasTalalas likes this.
  29. TadasTalalas

    TadasTalalas

    Joined:
    Nov 7, 2016
    Posts:
    33
    I want to add a number in the corner for player to see which number is this item. But that ScrollRect mask ruins the whole thing. ^^

    tmpro-example.png
     
  30. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Still unclear as to why you need to edit the material?

    What are you trying to change on the material?

    P.S. It looks like you may not need to use the UIMask. So replace that component from the ScrollRect by a RectMask2D.
     
  31. TadasTalalas

    TadasTalalas

    Joined:
    Nov 7, 2016
    Posts:
    33
    Those properties of shader:
    1.png 2.png
     
  32. TadasTalalas

    TadasTalalas

    Joined:
    Nov 7, 2016
    Posts:
    33
    Oh sorry. I changed to RectMask2D and it works like a charm. :)) Thank you very much!
     
  33. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Again the issue is related to the use of a UIMask in the ScrollRect which requires the use of an Instance Material which is why the material cannot be edited since this material is temporary.

    You have two options:
    Option (1) Assuming you want all text objects (numbers) to appear consistent from a visual stand point, then create a material preset with the visual appear you want (ie. Outline, Shadow, etc) and assign that Material Preset to your text object. In this case, the instance material will be created from this Material Preset which will already have the material settings you need without having to edit them on the instance. See the following video on how to create and use material presets.

    If you are going to have multiple text objects that share the same visual style (ie. material property settings) with the exception of color since that is usually set using the Vertex Color on the text object which is unique per text object. Using Material Presets is more efficient since the same material is shared by all those text objects thus reducing the number of draw calls.

    Option (2) Replace the UIMask component by a RectMask2D component. The RectMask2D does not require the use of an instance material. This will allow you to modify the material.

    You should still use Material Presets as this is more efficient since text objects all share the same material.
     
    TadasTalalas likes this.
  34. TadasTalalas

    TadasTalalas

    Joined:
    Nov 7, 2016
    Posts:
    33
    Wow...thank you very much Stephan! Appreciate you help! Diving in to my code! :))
     
  35. MrMobeen

    MrMobeen

    Joined:
    Sep 22, 2020
    Posts:
    2
    It's because the parent of component is using a "mask" component which makes it lack to change its shader's properties.
     
  36. amxxvi

    amxxvi

    Joined:
    Dec 23, 2017
    Posts:
    12
    Awesome, thank you!!