How do i open a directory in bpy like file manager?

i am making blender addon and i need the user to select a folder how can i do that ?

Just use a stringproperty and set the sub type to dir_path

bpy.types.Scene.my_dir = bpy.props.StringProperty(subtype='DIR_PATH')
1 Like