diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-18 13:32:12 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-18 13:32:12 +0300 |
commit | 324e10e76af43788c282e5a08eb18fde48bb488b (patch) | |
tree | b2c3ad71aefba138cd8030c0b066dab4a747207c /source/blender/makesrna | |
parent | 5e47f365e1e743ca1cc86e9f1dad936d5ce7e93a (diff) | |
parent | 579631819f0136ab0fbb0f6c7c21265b468940dc (diff) |
Merge branch 'master' into blender2.8
Conflicts:
source/blender/makesrna/intern/rna_space.c
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 5ce27a533b8..4558cd9c053 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -249,6 +249,9 @@ const EnumPropertyItem rna_enum_file_sort_items[] = { #include "DNA_screen_types.h" #include "DNA_userdef_types.h" +#include "BLI_path_util.h" +#include "BLI_string.h" + #include "BKE_animsys.h" #include "BKE_brush.h" #include "BKE_colortools.h" @@ -1662,6 +1665,16 @@ static const EnumPropertyItem *rna_FileSelectParams_recursion_level_itemf( return fileselectparams_recursion_level_items; } +static void rna_FileSelectPrams_filter_glob_set(PointerRNA *ptr, const char *value) +{ + FileSelectParams *params = ptr->data; + + BLI_strncpy(params->filter_glob, value, sizeof(params->filter_glob)); + + /* Remove stupi things like last group being a wildcard-only one... */ + BLI_path_extension_glob_validate(params->filter_glob); +} + static void rna_FileBrowser_FSMenuEntry_path_get(PointerRNA *ptr, char *value) { char *path = ED_fsmenu_entry_get_path(ptr->data); @@ -4137,7 +4150,10 @@ static void rna_def_fileselect_params(BlenderRNA *brna) prop = RNA_def_property(srna, "filter_glob", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "filter_glob"); - RNA_def_property_ui_text(prop, "Extension Filter", ""); + RNA_def_property_ui_text(prop, "Extension Filter", + "UNIX shell-like filename patterns matching, supports wildcards ('*') " + "and list of patterns separated by ';'"); + RNA_def_property_string_funcs(prop, NULL, NULL, "rna_FileSelectPrams_filter_glob_set"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_FILE_LIST, NULL); prop = RNA_def_property(srna, "filter_search", PROP_STRING, PROP_NONE); |