UIList for file list.

Hi again, shelling out questions to the community, rather than working out everything myself.

Can I make a UIList for a file list without having to set up a collection property?

Here is the code for listing all blender compatible audio files in a folder


import bpy
import glob
import os


def multiglob(path, exts):
    path = os.path.join(path, "*") if os.path.isdir(path) else path + "*"
    return [f for files in [glob.glob(path + ext) for ext in exts] for f in files]




# quick hack to soundfile folder  requires a sound loaded in the usual way
sound = bpy.data.sounds[0]


filepath = sound.filepath
path = os.path.split(filepath)[0]
files = multiglob(path, bpy.path.extensions_audio)


print(files)

It appears there are no search capability in the file browser & I have a folder full of soundfiles with names that quite often start with the track number then song name depending on the ripping program used. It would be nice to be able to search without scrolling the filebrowser, or for that matter writing an operator to use the filebrowser.

Cheers.

Add a new world

bpy.ops.world.new()

You can use * in the filename field and tab to select matching files. If you change the filename and tab again, it will extend the selection. Most importers won’t handle the multiple input files however, I guess.