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>2007-12-20 13:52:56 +0300
committerCampbell Barton <ideasman42@gmail.com>2007-12-20 13:52:56 +0300
commita637aca44ab6b19e054c605ff412be59d7828563 (patch)
tree6270284a553f26845305d0cfd699a2682dbe8fb7 /source/blender
parent9b89abaa8b3689383a8c557981a482d9b1156165 (diff)
make relative paths wasnt working, also disallowed it when the blend file isnt saved
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenlib/intern/bpath.c6
-rw-r--r--source/blender/src/header_info.c4
2 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c
index 598b5720b65..4e394bb7fae 100644
--- a/source/blender/blenlib/intern/bpath.c
+++ b/source/blender/blenlib/intern/bpath.c
@@ -345,7 +345,7 @@ void makeFilesRelative(int *tot, int *changed, int *failed, int *linked) {
filepath = BLI_bpathIterator_getPath(&bpi);
libpath = BLI_bpathIterator_getLib(&bpi);
- if(strncmp(filepath, "//", 2)==0) {
+ if(strncmp(filepath, "//", 2)) {
if (libpath) { /* cant make relative if we are kibrary - TODO, LOG THIS */
(*linked)++;
} else { /* local data, use the blend files path */
@@ -356,10 +356,10 @@ void makeFilesRelative(int *tot, int *changed, int *failed, int *linked) {
} else {
/* safe to to check the length */
if(strncmp(filepath_relative, "//", 2)==0) {
- (*failed)++;
- } else {
strcpy(filepath, filepath_relative);
(*changed)++;
+ } else {
+ (*failed)++;
}
}
}
diff --git a/source/blender/src/header_info.c b/source/blender/src/header_info.c
index f3933507a7b..fd7495dbbbe 100644
--- a/source/blender/src/header_info.c
+++ b/source/blender/src/header_info.c
@@ -953,12 +953,14 @@ static void do_info_externalfiles(void *arg, int event)
}
break;
case 10: /* make all paths relative */
- {
+ if (G.relbase_valid) {
int tot,changed,failed,linked;
char str[512];
makeFilesRelative(&tot, &changed, &failed, &linked);
sprintf(str, "Make Relative%%t|Total files %i|Changed %i|Failed %i|Linked %i", tot, changed, failed, linked);
pupmenu(str);
+ } else {
+ pupmenu("Can't set relative paths with an unsaved blend file");
}
break;
case 11: /* check images exist */