Index: source/blender/blenkernel/BKE_main.h =================================================================== --- source/blender/blenkernel/BKE_main.h (revision 38415) +++ source/blender/blenkernel/BKE_main.h (working copy) @@ -53,6 +53,7 @@ typedef struct Main { struct Main *next, *prev; char name[240]; + char non_enum_name[240]; short versionfile, subversionfile; short minversionfile, minsubversionfile; int revision; /* svn revision of binary that saved file */ Index: source/blender/makesdna/DNA_userdef_types.h =================================================================== --- source/blender/makesdna/DNA_userdef_types.h (revision 38415) +++ source/blender/makesdna/DNA_userdef_types.h (working copy) @@ -480,6 +480,7 @@ #define USER_SPLASH_DISABLE (1 << 27) #define USER_HIDE_RECENT (1 << 28) #define USER_SHOW_THUMBNAILS (1 << 29) +#define USER_FILE_ENUMERATION (1 << 30) /* Auto-Keying mode */ /* AUTOKEY_ON is a bitflag */ Index: source/blender/makesrna/intern/rna_userdef.c =================================================================== --- source/blender/makesrna/intern/rna_userdef.c (revision 38415) +++ source/blender/makesrna/intern/rna_userdef.c (working copy) @@ -2822,6 +2822,10 @@ 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, "file_enumeration", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_FILE_ENUMERATION); + RNA_def_property_ui_text(prop, "File Enumeration", "Save enumerated files"); + 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_ui_text(prop, "Relative Paths", "Default relative path option for the file selector"); Index: source/blender/windowmanager/intern/wm_operators.c =================================================================== --- source/blender/windowmanager/intern/wm_operators.c (revision 38415) +++ source/blender/windowmanager/intern/wm_operators.c (working copy) @@ -37,6 +37,7 @@ #include #include #include +#include #include "GHOST_C-api.h" @@ -1885,15 +1886,49 @@ save_set_compress(op); if(RNA_property_is_set(op->ptr, "filepath")) - RNA_string_get(op->ptr, "filepath", path); - else { + { + RNA_string_get(op->ptr, "filepath", path); + } + else + { BLI_strncpy(path, G.main->name, FILE_MAX); untitled(path); } if(RNA_property_is_set(op->ptr, "copy")) + { copy = RNA_boolean_get(op->ptr, "copy"); - + } + + if(U.uiflag & USER_FILE_ENUMERATION) + { + char* ext = ".blend"; + BLI_strncpy(path, G.main->non_enum_name, FILE_MAX); + + //strcpy(ext,strstr( path, ".blend" )); + if(ext) + { + int ext_len = strlen(ext); + int path_len = strlen(path); + + time_t cur_time; + struct tm raw_date; + + char enum_path[FILE_MAX]; + char dt[80]; + time(&cur_time); + localtime_s(&raw_date, &cur_time); + strftime(dt, 80, "_%Y_%m_%d_%H_%M_%S", &raw_date); + + BLI_strncpy(enum_path, path, (path_len-ext_len) + 1); + strncat(enum_path, dt, FILE_MAX); + strncat(enum_path, ext, FILE_MAX); + BLI_strncpy(path, enum_path, FILE_MAX); + + } + + } + fileflags= G.fileflags; /* set compression flag */ @@ -1958,7 +1993,9 @@ BLI_strncpy(name, recent->filepath, FILE_MAX); } else + { BLI_strncpy(name, G.main->name, FILE_MAX); + } untitled(name); @@ -1969,8 +2006,10 @@ check_existing = 0; if (G.save_over) { - if (check_existing) - uiPupMenuSaveOver(C, op, name); + if (check_existing && !(U.uiflag & USER_FILE_ENUMERATION)) + { + uiPupMenuSaveOver(C, op, name); + } else { wm_save_as_mainfile_exec(C, op); } Index: source/blender/windowmanager/intern/wm_files.c =================================================================== --- source/blender/windowmanager/intern/wm_files.c (revision 38415) +++ source/blender/windowmanager/intern/wm_files.c (working copy) @@ -746,10 +746,11 @@ fileflags |= G_FILE_HISTORY; /* write file history */ if (BLO_write_file(CTX_data_main(C), filepath, fileflags, reports, thumb)) { - if(!copy) { + if(!copy) + { G.relbase_valid = 1; BLI_strncpy(G.main->name, filepath, sizeof(G.main->name)); /* is guaranteed current file */ - + G.save_over = 1; /* disable untitled.blend convention */ } Index: source/blender/editors/space_file/file_ops.c =================================================================== --- source/blender/editors/space_file/file_ops.c (revision 38415) +++ source/blender/editors/space_file/file_ops.c (working copy) @@ -617,8 +617,9 @@ } if(RNA_struct_find_property(op->ptr, "filepath")) { RNA_string_set(op->ptr, "filepath", filepath); + BLI_strncpy(G.main->non_enum_name, filepath, FILE_MAX); // Changes only on save as } - + /* some ops have multiple files to select */ { PointerRNA itemptr;