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:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -42,6 +42,7 @@ bool yafrayRender_t::exportScene()
|
||||
|
||||
if (!initExport())
|
||||
{
|
||||
G.afbreek = 1;
|
||||
clearAll();
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user