== filebrowser ==
Added two user preferences for filebrowser: 1. Hide Recent Locations Requested by Kernon Dillon. Reason: People doing video tutorials might not want to expose the name of other projects they are working on. 2. Open Filebrowser in thumbnail view for images and movies Requested by Sebastian König at the Blender Conference. Reason: In the past (and most likely still) some corrupt images or movies could crash the filebrowser when generating thumbnails. (crashes in ffmpeg, libtiff, libjpg). While many of those were solved, artists in a production environment might want to use this setting to prevent any crashes. NOTE: the second setting should probably be set next time we create a new default startup.blend. Until then users need to switch this on manually in the User Preferences.
This commit is contained in:
		@@ -696,6 +696,8 @@ class USERPREF_PT_file(bpy.types.Panel):
 | 
				
			|||||||
        col.prop(paths, "use_load_ui")
 | 
					        col.prop(paths, "use_load_ui")
 | 
				
			||||||
        col.prop(paths, "use_filter_files")
 | 
					        col.prop(paths, "use_filter_files")
 | 
				
			||||||
        col.prop(paths, "show_hidden_files_datablocks")
 | 
					        col.prop(paths, "show_hidden_files_datablocks")
 | 
				
			||||||
 | 
					        col.prop(paths, "hide_recent_locations")
 | 
				
			||||||
 | 
					        col.prop(paths, "show_thumbnails")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        col.separator()
 | 
					        col.separator()
 | 
				
			||||||
        col.separator()
 | 
					        col.separator()
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -33,6 +33,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include "DNA_screen_types.h"
 | 
					#include "DNA_screen_types.h"
 | 
				
			||||||
#include "DNA_space_types.h"
 | 
					#include "DNA_space_types.h"
 | 
				
			||||||
 | 
					#include "DNA_userdef_types.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "MEM_guardedalloc.h"
 | 
					#include "MEM_guardedalloc.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -146,8 +147,11 @@ static void file_panel_recent(const bContext *C, Panel *pa)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
	SpaceFile *sfile= CTX_wm_space_file(C);
 | 
						SpaceFile *sfile= CTX_wm_space_file(C);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if(sfile)
 | 
						if(sfile) {
 | 
				
			||||||
		file_panel_category(C, pa, FS_CATEGORY_RECENT, &sfile->recentnr, ICON_FILE_FOLDER, 0, 1);
 | 
							if ( !(U.uiflag & USER_HIDE_RECENT) ) {
 | 
				
			||||||
 | 
								file_panel_category(C, pa, FS_CATEGORY_RECENT, &sfile->recentnr, ICON_FILE_FOLDER, 0, 1);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -199,12 +199,16 @@ short ED_fileselect_set_params(SpaceFile *sfile)
 | 
				
			|||||||
			params->flag |= RNA_boolean_get(op->ptr, "autoselect") ? FILE_AUTOSELECT : 0;
 | 
								params->flag |= RNA_boolean_get(op->ptr, "autoselect") ? FILE_AUTOSELECT : 0;
 | 
				
			||||||
			params->flag |= RNA_boolean_get(op->ptr, "active_layer") ? FILE_ACTIVELAY : 0;
 | 
								params->flag |= RNA_boolean_get(op->ptr, "active_layer") ? FILE_ACTIVELAY : 0;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					 | 
				
			||||||
		if(params->filter & (IMAGEFILE|MOVIEFILE))
 | 
					 | 
				
			||||||
			params->display= FILE_IMGDISPLAY;
 | 
					 | 
				
			||||||
		else
 | 
					 | 
				
			||||||
			params->display= FILE_SHORTDISPLAY;
 | 
					 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
 | 
							if (U.uiflag & USER_SHOW_THUMBNAILS) {
 | 
				
			||||||
 | 
								if(params->filter & (IMAGEFILE|MOVIEFILE))
 | 
				
			||||||
 | 
									params->display= FILE_IMGDISPLAY;
 | 
				
			||||||
 | 
								else
 | 
				
			||||||
 | 
									params->display= FILE_SHORTDISPLAY;
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								params->display= FILE_SHORTDISPLAY;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		/* default values, if no operator */
 | 
							/* default values, if no operator */
 | 
				
			||||||
		params->type = FILE_UNIX;
 | 
							params->type = FILE_UNIX;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -468,6 +468,8 @@ extern UserDef U; /* from blenkernel blender.c */
 | 
				
			|||||||
#define USER_ZOOM_INVERT		(1 << 25)
 | 
					#define USER_ZOOM_INVERT		(1 << 25)
 | 
				
			||||||
#define USER_ZOOM_DOLLY_HORIZ	(1 << 26)
 | 
					#define USER_ZOOM_DOLLY_HORIZ	(1 << 26)
 | 
				
			||||||
#define USER_SPLASH_DISABLE		(1 << 27)
 | 
					#define USER_SPLASH_DISABLE		(1 << 27)
 | 
				
			||||||
 | 
					#define USER_HIDE_RECENT		(1 << 28)
 | 
				
			||||||
 | 
					#define USER_SHOW_THUMBNAILS	(1 << 29)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Auto-Keying mode */
 | 
					/* Auto-Keying mode */
 | 
				
			||||||
	/* AUTOKEY_ON is a bitflag */
 | 
						/* AUTOKEY_ON is a bitflag */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2718,10 +2718,18 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna)
 | 
				
			|||||||
	RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_FILTERFILEEXTS);
 | 
						RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_FILTERFILEEXTS);
 | 
				
			||||||
	RNA_def_property_ui_text(prop, "Filter File Extensions", "Display only files with extensions in the image select window");
 | 
						RNA_def_property_ui_text(prop, "Filter File Extensions", "Display only files with extensions in the image select window");
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
 | 
						prop= RNA_def_property(srna, "hide_recent_locations", PROP_BOOLEAN, PROP_NONE);
 | 
				
			||||||
 | 
						RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_HIDE_RECENT);
 | 
				
			||||||
 | 
						RNA_def_property_ui_text(prop, "Hide Recent Locations", "Hide recent locations in the file selector");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						prop= RNA_def_property(srna, "show_thumbnails", PROP_BOOLEAN, PROP_NONE);
 | 
				
			||||||
 | 
						RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_THUMBNAILS);
 | 
				
			||||||
 | 
						RNA_def_property_ui_text(prop, "Show Thumbnails", "Open in thumbnail view for images and movies");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	prop= RNA_def_property(srna, "use_relative_paths", PROP_BOOLEAN, PROP_NONE);
 | 
						prop= RNA_def_property(srna, "use_relative_paths", PROP_BOOLEAN, PROP_NONE);
 | 
				
			||||||
	RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_RELPATHS);
 | 
						RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_RELPATHS);
 | 
				
			||||||
	RNA_def_property_ui_text(prop, "Relative Paths", "Default relative path option for the file selector");
 | 
						RNA_def_property_ui_text(prop, "Relative Paths", "Default relative path option for the file selector");
 | 
				
			||||||
 | 
						
 | 
				
			||||||
	prop= RNA_def_property(srna, "use_file_compression", PROP_BOOLEAN, PROP_NONE);
 | 
						prop= RNA_def_property(srna, "use_file_compression", PROP_BOOLEAN, PROP_NONE);
 | 
				
			||||||
	RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_FILECOMPRESS);
 | 
						RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_FILECOMPRESS);
 | 
				
			||||||
	RNA_def_property_ui_text(prop, "Compress File", "Enable file compression when saving .blend files");
 | 
						RNA_def_property_ui_text(prop, "Compress File", "Enable file compression when saving .blend files");
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user