In my Panel class I use:
col.prop(context.scene, 'path')
I also have:
def register():
bpy.utils.register_class(PBRGROUP)
bpy.utils.register_module(__name__)
bpy.types.Scene.path = bpy.props.StringProperty \
(
name = "Folder with textures",
default = "",
description = "Select folder with images to import",
subtype = 'DIR_PATH'
)
def unregister():
bpy.utils.unregister_class(PBRGROUP)
bpy.utils.unregister_module(__name__)
del bpy.types.Scene.path
The above gives me:
How to add all images from selected folder to my .blend file?
I know how to create a button, but I don't know how to add files from directory.