I'm trying to find a way to bring up two file browsers (one after the other), but without success.
The reason for needing multiple file browsers is that I first need the user to export a text file, then export a mesh file. Those could have different names and be exported to different directories.
One solution I could think of is to have a separate operator that I call from the first operator, but the problem seems to be that 1. it doesn't return a value and 2. the code pause while I call the other operator.
I also tried to add multiple fileselect_add calls, but that seemed to crash blender. Any idea?
Sample code:
import bpy
from bpy_extras.io_utils import ExportHelper
class ExportCommon(bpy.types.Operator, ExportHelper):
bl_idname = "export.common"
bl_label = "Export common"
bl_options = {'PRESET'}
filename_ext = ".fbx"
def invoke(self, context, event):
context.window_manager.fileselect_add(self)
return {'RUNNING_MODAL'}
def execute(self, context):
print(self.filename)
return {"FINISHED"}