Separates export_frame() into individual functions for opening file streams and writing .mtl and .obj data. This makes the code clearer in what and when data is written to each stream by not interleaving .obj/.mtl writing. It also simplifies the logic by separating out handling/branching for file streams and .mtl writing. Pull Request: https://projects.blender.org/blender/blender/pulls/142918