Make vertex adjustments permanent

Hi,

based on the “WarpTextExample” script from the TMP examples I wrote a script to position the letters of a TMP_Text on a curve. I would now like to have these mesh adjustments persist in the editor and in play mode, ideally without recalculating the positions frequently. The text doesn’t change or move at runtime, is there some way to prevent the mesh from being rebuilt at runtime? If not, when should I call the method to adjust the vertices?
Thanks!

For anyone in my shoes, I experimented with this and figured out calling the mesh adjustment method in the following cases seems to be the necessary minimum:

  • in OnValidate() within if (!Application.running) {} for the editor preview
  • in a listener of the text component’s OnPreRenderText callback for playtime

Hope that helps some future reader