Search Unity

TextMesh Pro Material disappear from the inspector when GO is disabled

Discussion in 'UGUI & TextMesh Pro' started by jj_unity328, Jul 4, 2018.

  1. jj_unity328

    jj_unity328

    Joined:
    Jun 7, 2018
    Posts:
    22
    By default, when selecting a TMP text field, you can see and tweak its material directly in the inspector, changing its outline, underlay etc.

    But if your GO (or one of its parents) is disabled, the 'shortcut' to the material disappear. I had to scratch my head to find out why the settings were suddenly gone.

    (Also, but I'm not sure it's solely related to TMP as I didn't test it completely yet but right click on the material and hitting "Select material" does expand the hierarchy but doesn't highlight the material EDIT: Only when I'm not using a Preset)

    I'm using Unity 218.1.6f1 and TextMeshPro 1.2.3. (Package manager)
     
    Last edited: Jul 4, 2018
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,596
    The visibility of the Material Inspector is controlled by the CanvasRenderer. As such if the text object is disabled, the CanvasRenderer will not expose the Material Inspector.

    In terms of "Select Material" this will only ping the material if the font asset was user created which exposes the material and texture that are contained as sub asset of the font asset.

    For compatibility reasons, the font asset included with TMP have their default material and texture hidden (this was necessary when these assets were created a long time ago to get around a bug in Unity).
     
    jj_unity328 likes this.
  3. jj_unity328

    jj_unity328

    Joined:
    Jun 7, 2018
    Posts:
    22
    That's the why but does this mean, well, that's how it is or do I read that wrong? :)

    Thanks for the detailed answer! :+1:
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,596
    That's how it is right now but I can always ask internally why we chose to implement it this way and check if that is something that we could change.