I have two buttons in my panel, one to import obj and one to import collada. I have two folders named 'obj_files' and 'collada_files' in two locations on my machine. I'm using importhelper, but I want when I press on the Import OBJ button, the obj_files folder will be the default path which shows up which is the location where I stored all the obj files in it instead of browsing for it, and the collada_files path when pressing the import collada button. I've tried
bpy.ops.import_scene.obj(filepath = '/Users/UserA/Temp/obj_files/')
I've also tried the below but still didn't work:
class ImportOBJ(Operator, ImportHelper):
"""Import OBJ"""
bl_idname = "io.importobj"
bl_label = "Import OBJ"
filename_ext = ".obj"
filter_glob = StringProperty(
default="*.obj",
options={'HIDDEN'},
maxlen=255,
)
filepath = bpy.props.StringProperty(
name="File Path",
description="File path used for importing the OBJ file",
maxlen= 1024,
default= "/Users/UserA/Temp/obj_files/")
def execute(self, context):
bpy.ops.import_scene.obj(filepath = self.properties.filepath)