[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59623] trunk/blender/source/blender/ windowmanager/intern/wm_files.c: don't replace the extension with '.blend' in save code since the file selector already ensures this,
Campbell Barton
ideasman42 at gmail.com
Thu Aug 29 06:26:40 CEST 2013
Revision: 59623
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59623
Author: campbellbarton
Date: 2013-08-29 04:26:40 +0000 (Thu, 29 Aug 2013)
Log Message:
-----------
don't replace the extension with '.blend' in save code since the file selector already ensures this,
needed so python scripts can save as temp filenames.
Modified Paths:
--------------
trunk/blender/source/blender/windowmanager/intern/wm_files.c
Modified: trunk/blender/source/blender/windowmanager/intern/wm_files.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_files.c 2013-08-29 04:08:44 UTC (rev 59622)
+++ trunk/blender/source/blender/windowmanager/intern/wm_files.c 2013-08-29 04:26:40 UTC (rev 59623)
@@ -810,15 +810,14 @@
}
}
-int wm_file_write(bContext *C, const char *target, int fileflags, ReportList *reports)
+int wm_file_write(bContext *C, const char *filepath, int fileflags, ReportList *reports)
{
Library *li;
int len;
- char filepath[FILE_MAX];
int *thumb = NULL;
ImBuf *ibuf_thumb = NULL;
- len = strlen(target);
+ len = strlen(filepath);
if (len == 0) {
BKE_report(reports, RPT_ERROR, "Path is empty, cannot save");
@@ -830,9 +829,9 @@
return -1;
}
- BLI_strncpy(filepath, target, FILE_MAX);
- BLI_replace_extension(filepath, FILE_MAX, ".blend");
- /* don't use 'target' anymore */
+ /* note: used to replace the file extension (to ensure '.blend'),
+ * no need to now because the operator ensures,
+ * its handy for scripts to save to a predefined name without blender editing it */
/* send the OnSave event */
for (li = G.main->library.first; li; li = li->id.next) {
More information about the Bf-blender-cvs
mailing list