I'm trying to open a file browser (similar the browser in the image bellow) where the user can chose a folder and file name to save a new .blend file with the selected objects.
I want make a addon to easely save a new blender file e.g to select a collection and save a new blender file with the collection name and all objects inside there or select only two object and save a new file with that.
To do that I'm using the code bellow but all I get is some errors. Someone know a simple way to open that browser. I read some parts of the blender api documentation but I'm really confusing with some functions that I found in there.
The code I'm using:
class FileExporter(Operator):
bl_idname = "export.file_exporter"
bl_label = "Save"
bl_options = {'REGISTER'}
def export(self, context):
self.file_path = bpy.path.relpath
bpy.ops.wm.path_open(filepath=self.file_path)
def execute(self, context):
self.export(context)
return {'FINISHED'}
Text Editor > Templates > Python >
Operator Import Export examples. $\endgroup$