I need to change font materials, and can't seem to figure out how to do it.
I have two team fonts: Team1Font, Team2Font.
I get that I can use tags, so when I'm setting something for team 1, I can use:
textObject.TextWithTags = "{Team1Font}" & my_text_value
That changes the font; however, every team has a different color; I'm only using two at a time, and the interface I'm building around the current project needs to be very dynamic/generic, so I can't realistically duplicate the same font and edit all the colors by hand, and have Team<N>Font. The color comes from a spreadsheet - each team has, among other things, a text color given in the data in the spreadsheet.
So I update materials: Team1Color and Team2Color, and I know that works because I can have that material applied to different things, like quads, and I can see it work, but would like to just apply those materials to Team1Font and Team2Font (respectively), and can't seem to find a way. The API also doesn't have a way to set a font's material directly, at least not that I can tell.
I did my searching, and found this post: https://support.rossvideo.com/hc/en-us/community/posts/360043355312-XPression-Font-Materials
The response from Garner seems to indicate I CAN set the font material from my material library somehow, but I can't figure it out. If I could, in the editor, just tell Team1Font to use Team1Color, and then script in where that Team1Color (a material) gets updated with the new color, theoretically it should work, but I don't see how to do it.
Again, this is not how to select different fonts - it's how to update a given font's material through scripting - either directly (by accessing the font's material directly), or indirectly (by setting the font's material to something in my material library, then updating that material).
Thanks.
EDIT: Oh, I also know I can apply the material to the text object itself, but that doesn't seem to work - it always seems to use what was there before. In the editor, you either need to set the material first, or highlight the text to set the material.