[Bf-blender-cvs] [7e905b0cf6d] asset-engine: All blendlib (ID types) filters ON by default for operator-less filebrowser.

Bastien Montagne noreply at git.blender.org
Mon Aug 21 19:57:25 CEST 2017


Commit: 7e905b0cf6df69f20d4b3c32d304e2f9cd677d89
Author: Bastien Montagne
Date:   Mon Aug 21 19:33:01 2017 +0200
Branches: asset-engine
https://developer.blender.org/rB7e905b0cf6df69f20d4b3c32d304e2f9cd677d89

All blendlib (ID types) filters ON by default for operator-less filebrowser.

===================================================================

M	source/blender/blenloader/intern/versioning_270.c
M	source/blender/editors/space_file/filesel.c

===================================================================

diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index d80adbaacfe..9e6e2ff5b8e 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -1681,6 +1681,16 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
 						SpaceFile *sfile = (SpaceFile *)sl;
 						if (sfile->params != NULL) {
 							sfile->params->type = FILE_LOADLIB;
+							sfile->params->filter = FILE_TYPE_FOLDER | FILE_TYPE_BLENDERLIB;
+							/* For now, always init filterid to 'all true' */
+							sfile->params->filter_id = FILTER_ID_AC | FILTER_ID_AR | FILTER_ID_BR | FILTER_ID_CA |
+							                           FILTER_ID_CU | FILTER_ID_GD | FILTER_ID_GR | FILTER_ID_IM |
+							                           FILTER_ID_LA | FILTER_ID_LS | FILTER_ID_LT | FILTER_ID_MA |
+							                           FILTER_ID_MB | FILTER_ID_MC | FILTER_ID_ME | FILTER_ID_MSK |
+							                           FILTER_ID_NT | FILTER_ID_OB | FILTER_ID_PA | FILTER_ID_PAL |
+							                           FILTER_ID_PC | FILTER_ID_SCE | FILTER_ID_SPK | FILTER_ID_SO |
+							                           FILTER_ID_TE | FILTER_ID_TXT | FILTER_ID_VF | FILTER_ID_WO |
+							                           FILTER_ID_CF;
 						}
 					}
 				}
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index 1a30eec47d4..db2979f803a 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -108,6 +108,13 @@ short ED_fileselect_set_params(SpaceFile *sfile)
 
 	params = sfile->params;
 
+	/* For now, always init filterid to 'all true' */
+	params->filter_id = FILTER_ID_AC | FILTER_ID_AR | FILTER_ID_BR | FILTER_ID_CA | FILTER_ID_CU | FILTER_ID_GD |
+	                    FILTER_ID_GR | FILTER_ID_IM | FILTER_ID_LA | FILTER_ID_LS | FILTER_ID_LT | FILTER_ID_MA |
+	                    FILTER_ID_MB | FILTER_ID_MC | FILTER_ID_ME | FILTER_ID_MSK | FILTER_ID_NT | FILTER_ID_OB |
+	                    FILTER_ID_PA | FILTER_ID_PAL | FILTER_ID_PC | FILTER_ID_SCE | FILTER_ID_SPK | FILTER_ID_SO |
+	                    FILTER_ID_TE | FILTER_ID_TXT | FILTER_ID_VF | FILTER_ID_WO | FILTER_ID_CF;
+
 	/* set the parameters from the operator, if it exists */
 	if (op) {
 		PropertyRNA *prop;
@@ -210,13 +217,6 @@ short ED_fileselect_set_params(SpaceFile *sfile)
 			}
 		}
 
-		/* For now, always init filterid to 'all true' */
-		params->filter_id = FILTER_ID_AC | FILTER_ID_AR | FILTER_ID_BR | FILTER_ID_CA | FILTER_ID_CU | FILTER_ID_GD |
-		                    FILTER_ID_GR | FILTER_ID_IM | FILTER_ID_LA | FILTER_ID_LS | FILTER_ID_LT | FILTER_ID_MA |
-		                    FILTER_ID_MB | FILTER_ID_MC | FILTER_ID_ME | FILTER_ID_MSK | FILTER_ID_NT | FILTER_ID_OB |
-		                    FILTER_ID_PA | FILTER_ID_PAL | FILTER_ID_PC | FILTER_ID_SCE | FILTER_ID_SPK | FILTER_ID_SO |
-		                    FILTER_ID_TE | FILTER_ID_TXT | FILTER_ID_VF | FILTER_ID_WO | FILTER_ID_CF;
-
 		if (U.uiflag & USER_HIDE_DOT) {
 			params->flag |= FILE_HIDE_DOT;
 		}
@@ -269,7 +269,7 @@ short ED_fileselect_set_params(SpaceFile *sfile)
 		params->flag &= ~FILE_DIRSEL_ONLY;
 		params->display = FILE_SHORTDISPLAY;
 		params->sort = FILE_SORT_ALPHA;
-		params->filter = 0;
+		params->filter = FILE_TYPE_FOLDER | FILE_TYPE_BLENDERLIB;
 		params->filter_glob[0] = '\0';
 	}



More information about the Bf-blender-cvs mailing list