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>2008-06-06 12:58:08 +0400
committerCampbell Barton <ideasman42@gmail.com>2008-06-06 12:58:08 +0400
commit14393c9ffbe67eb41281fcc50f8a0ff44e4fe0fc (patch)
tree49ba7cc2162581c26ea6d27df57b69f598e37147 /source/blender/python
parent6ffadbfb103f498b7400ae6d7d960c98404a9bdc (diff)
bugfix - Blender.GetPaths() was returning relative paths from libraries, but with no way to access the library path the the file is relative too. Check for these cases and make them absolute.
bpath also assigned one var it didnt need to.
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/api2_2x/Blender.c8
1 files changed, 7 insertions, 1 deletions
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);