I maintain an addon called Stop Motion OBJ. In the addon, I’ve extended the File Import panel to import mesh sequences of various file types. At the moment, it supports .OBJ, .STL, .PLY, and .X3D. In the UI, the user must select the correct file type from a drop-down menu.
I’ve created a panel that extends the ImportHelper class (see here). One of the member variables,
filter_glob, filters which file types are shown in the file explorer. Currently, I need to include all supported file types. However, this can be confusing to the user if they’ve navigated to a folder full of one file type, but the importer reports an error because the user forgot to select the correct file type.
I’d like to dynamically change the
filter_glob attribute based on which file type the user has selected. Is this possible?