diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c index 79d3e487712..898ad6ddd67 100644 --- a/source/blender/blenlib/intern/bpath.c +++ b/source/blender/blenlib/intern/bpath.c @@ -456,13 +456,10 @@ void checkMissingFiles( char *txtname ) { /* be sure there is low chance of the path being too short */ char filepath_expanded[FILE_MAXDIR*2]; - char *libpath; int files_missing = 0; BLI_bpathIterator_init(&bpi); while (!BLI_bpathIterator_isDone(&bpi)) { - libpath = BLI_bpathIterator_getLib(&bpi); - BLI_bpathIterator_getPathExpanded( &bpi, filepath_expanded ); if (!BLI_exists(filepath_expanded)) { diff --git a/source/blender/python/api2_2x/Blender.c b/source/blender/python/api2_2x/Blender.c index 6b2e00f27de..d8385c1d660 100644 --- a/source/blender/python/api2_2x/Blender.c +++ b/source/blender/python/api2_2x/Blender.c @@ -936,6 +936,7 @@ static PyObject *Blender_GetPaths( PyObject * self, PyObject *args, PyObject *ke PyObject *list = PyList_New(0), *st; /* stupidly big string to be safe */ /* be sure there is low chance of the path being too short */ char filepath_expanded[FILE_MAXDIR*2]; + char *lib; int absolute = 0; static char *kwlist[] = {"absolute", NULL}; @@ -952,7 +953,12 @@ static PyObject *Blender_GetPaths( PyObject * self, PyObject *args, PyObject *ke if (absolute) { BLI_bpathIterator_getPathExpanded( &bpi, filepath_expanded ); } else { - BLI_bpathIterator_getPath( &bpi, filepath_expanded ); + lib = BLI_bpathIterator_getLib( &bpi ); + if ( lib && ( strcmp(lib, G.sce) ) ) { /* relative path to the library is NOT the same as our blendfile path, return an absolute path */ + BLI_bpathIterator_getPathExpanded( &bpi, filepath_expanded ); + } else { + BLI_bpathIterator_getPath( &bpi, filepath_expanded ); + } } st = PyString_FromString(filepath_expanded);