Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-09-17 13:27:31 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-09-17 13:27:31 +0400
commit5452f335d7fd768fda7320419e3581e5309529fe (patch)
treef80553108d8541e2d070c02fe86778494f31c188 /source/blender/blenkernel/intern/exotic.c
parent945ae254092dcbb284072fd4ffcc80b33bff27f6 (diff)
New optional operator function, check(), it takes the same arguments as execute().
This runs after changing a property and allows correcting incompatible options. Returning True will redraw the UI. Currently this is used for setting the write extension when saving files, so changing the image format also corrects the extension. The same is accessible from python where its used when saving SVG/EPS/PNG files. This fixes: [#23828] obj export problems, [#23760] Exporting OBJ and filetype ending also fixed document submission operator. Now the filename in the file selector is the one used for writing this means we remove the "Save Over" popup which could be overlooked too easily. Instead display the filename field with red tint, and a note in the tooltip.
Diffstat (limited to 'source/blender/blenkernel/intern/exotic.c')
-rw-r--r--source/blender/blenkernel/intern/exotic.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/source/blender/blenkernel/intern/exotic.c b/source/blender/blenkernel/intern/exotic.c
index 973c18531c4..9dac409226b 100644
--- a/source/blender/blenkernel/intern/exotic.c
+++ b/source/blender/blenkernel/intern/exotic.c
@@ -577,15 +577,8 @@ void write_stl(Scene *scene, char *str)
FILE *fpSTL;
int numfacets = 0;
ReportList *reports= NULL; /* XXX */
-
- if(BLI_testextensie(str,".blend")) str[ strlen(str)-6]= 0;
- if(BLI_testextensie(str,".ble")) str[ strlen(str)-4]= 0;
- if(BLI_testextensie(str,".stl")==0) strcat(str, ".stl");
- if (BLI_exists(str)) {
- ; //XXX if(saveover(str)==0)
- //XXX return;
- }
+ /* XXX, operator needs to manage filename extension */
fpSTL= fopen(str, "wb");
@@ -872,15 +865,7 @@ void write_dxf(struct Scene *scene, char *str)
Base *base;
FILE *fp;
- if(BLI_testextensie(str,".blend")) str[ strlen(str)-6]= 0;
- if(BLI_testextensie(str,".ble")) str[ strlen(str)-4]= 0;
- if(BLI_testextensie(str,".dxf")==0) strcat(str, ".dxf");
-
-
- if (BLI_exists(str)) {
- ; //XXX if(saveover(str)==0)
- // return;
- }
+ /* XXX, operator needs to handle overwrite & rename */
fp= fopen(str, "w");