@Stephan_B Our Text Mesh Pro Font Assets keep showing up as changed in our source control. No one is touching the assets nor any TMP settings. It always has something to do with the “UNITY_UI_CLIP_RECT” shader keyword being added or removed. If we accept the change one way, it ends up eventually showing as changed back the other way.
What is causing this? What can we do to prevent it?
This is not set specifically by TextMesh Pro and most likely the result of the Canvas / UI system. For this shader keyword to change, I would assume a 2D RectMask is being enabled and disabled which results in this change.
What version of Unity are you using? I would suggest testing in Unity 2017.1 and 2017.2 to see if the behavior persists.
This behavior is the result of a change in 2017.2 where the 2D RectMask now uses a shader keyword. This is done by the Canvas batching system and as such would affect all materials.
As Unity batches these materials, it is setting and un-setting this keyword and depending on the order of these batches, it may end up where the last batch sets or unsets the keyword. Ie. this will appear to be random.
This behavior also affects all materials used by the canvas. Since the UI Default material is an instance which does not live in a user project, you are not seeing this behavior. But if you were to assign a specific material to any object or use a persistent asset like a TMP Material Preset, then you will see this behavior.
Since this behavior will affect anything that uses a material that is persistent in the project (not only TextMesh Pro) I would suggest submitting a bug report on this. Please post the case number.
Hopefully, the UI and / or Graphics team can figure out an alternative way of handling this which doesn’t result in dirtying persistent materials in the project when using a 2D RectMask.
Thank you for the explanation! Bug report submitted with test project.
Case 967024
I hope you can help speed up the development of a solution! It’s been causing crazy merge conflicts for us in source control and we don’t want to ignore random materials that could have valid changes as well.
I have asked internally to see what the plans are in regards to a backport on this behavior.
This might be on a low priority (in terms of backport) given this is just an annoyance in terms of source control and not a breaking bug per say. But like I said it is an annoyance at any rate.
It is my understand that the fix for this will be back ported down to 2017.2 and 2017.3. Not sure when the change will land but keep looking for it in a subsequent patch for those.