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 Font Material being Modified on Editor Scene Load

Discussion in 'UGUI & TextMesh Pro' started by CDF, Nov 29, 2017.

  1. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,307
    This has been occurring for some time now. Ever since I updated to 2017.2 I believe.
    Some of my font materials keep reporting changes made when loading a scene in the editor.
    If I had to guess, probably something to do with all the UI changes/bugs introduced into 2017.2 which is causing TMP to make the font material dirty.

    Not a huge deal, I've just been skipping them in my commits. But thought I would mention it here.
    Any possible workaround?
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    This is happening due to a change in the UI system where it now sets a keyword when using a 2D RectMask.

    This change / behavior is not related to TextMesh Pro but certainly affects it.

    When this change was implemented and given the UI system (mostly) uses instanced materials whether some material have this keyword set or changed on them doesn't matter but for persistent assets / materials where you have several objects sharing the same material where some are affected by a 2D RectMask and others are not, you end up with this behavior. Having this ShaderKeyword being set and unset on shared materials which happens based on the canvas sorting order can appear to be happening at random.

    Although this behavior results in dirtying the material which in terms will make source control keep flagging this file which can be annoying, in terms of text rendering and all, it doesn't impact anything. Nonetheless, I would suggest submitting a bug report on this as this should be improved upon.

    If you do submit a bug report, please share the case #.
     
    Last edited: Nov 29, 2017
  3. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,307
    Ok thanks, will do.

    RectMasks are completely broken anyway in 2017.2. Think I'll just remove them
    So 2 bugs for the price of 1
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Actually it looks like a bug report already exists. So no need for another one :)