test commit

Bugfix for anim crash with xml export and no export dir set.
Alternate relative path using blender function, but wouldn't be surprised
if it still is a problem in some cases for some (windows) users.
This commit is contained in:
Alfredo de Greef
2004-09-20 23:59:09 +00:00
parent 273c8e0804
commit 7d65af235e
3 changed files with 19 additions and 18 deletions

View File

@@ -294,18 +294,18 @@ void yafrayFileRender_t::displayImage()
}
#ifdef WIN32
#define MAXPATHLEN MAX_PATH
#else
#include <sys/param.h>
#endif
static void adjustPath(string &path)
{
// if relative, expand to full path
if ((path[0]=='/') && (path[1]=='/')) {
string basepath = G.sce;
// fwd slash valid for win32 as well
int ls = basepath.find_last_of("/");
#ifdef WIN32
if (ls==-1) ls = basepath.find_last_of("\\");
#endif
path = basepath.substr(0, ls) + path.substr(1, path.length());
}
char cpath[MAXPATHLEN];
strcpy(cpath, path.c_str());
BLI_convertstringcode(cpath, G.sce, 0);
path = cpath;
#ifdef WIN32
// add drive char if not there
addDrive(path);

View File

@@ -298,18 +298,18 @@ void yafrayPluginRender_t::displayImage()
}
#ifdef WIN32
#define MAXPATHLEN MAX_PATH
#else
#include <sys/param.h>
#endif
static void adjustPath(string &path)
{
// if relative, expand to full path
if ((path[0]=='/') && (path[1]=='/')) {
string basepath = G.sce;
// fwd slash valid for win32 as well
int ls = basepath.find_last_of("/");
#ifdef WIN32
if (ls==-1) ls = basepath.find_last_of("\\");
#endif
path = basepath.substr(0, ls) + path.substr(1, path.length());
}
char cpath[MAXPATHLEN];
strcpy(cpath, path.c_str());
BLI_convertstringcode(cpath, G.sce, 0);
path = cpath;
#ifdef WIN32
// add drive char if not there
addDrive(path);

View File

@@ -42,6 +42,7 @@ bool yafrayRender_t::exportScene()
if (!initExport())
{
G.afbreek = 1;
clearAll();
return false;
}