In windows, without temp path set, the 'save buffers' render option crashes.

I've coded a blenlib BLI_is_writable(char *filename) to check for such
cases. This is not much needed in Blender, since the open() command is
checked for. However, file saving happens deep inside the C++ exr lib, and
it throws an exception crash when a file cannot be written.
This commit is contained in:
2006-06-19 13:53:00 +00:00
parent 03449818b3
commit 36bedb3d7e
3 changed files with 31 additions and 3 deletions

View File

@@ -1102,9 +1102,10 @@ static void threaded_tile_processor(Render *re)
if(rr->exrhandle) {
char str[FILE_MAXDIR+FILE_MAXFILE];
render_unique_exr_name(re, str);
printf("write exr tmp file, %dx%d, %s\n", rr->rectx, rr->recty, str);
render_unique_exr_name(re, str);
printf("write exr tmp file, %dx%d, %s\n", rr->rectx, rr->recty, str);
IMB_exrtile_begin_write(rr->exrhandle, str, rr->rectx, rr->recty, rr->rectx/re->xparts, rr->recty/re->yparts);
}
@@ -1721,6 +1722,18 @@ static int is_rendering_allowed(Render *re)
}
}
if(re->r.scemode & R_EXR_TILE_FILE) {
char str[FILE_MAXDIR+FILE_MAXFILE];
render_unique_exr_name(re, str);
if (BLI_is_writable(str)==0) {
re->error("Can not save render buffers, check the temp default path");
return 0;
}
}
if(re->r.scemode & R_DOCOMP) {
if(re->scene->use_nodes) {
bNodeTree *ntree= re->scene->nodetree;