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:
authorNathan Letwory <nathan@letworyinteractive.com>2005-05-20 16:18:11 +0400
committerNathan Letwory <nathan@letworyinteractive.com>2005-05-20 16:18:11 +0400
commit1071d4a16e08bda7a6bfbcb02e278510b3cd1e44 (patch)
tree9e23634d8e5a829502e2a9f9dd900a1e6a6fda82 /source/blender/blenkernel
parentf8ae055f4b0f62e55866cf89e8ea40d0a95141c3 (diff)
This commit fixes two related issues:
1: * when a blendfile gets loaded, paths are corrected with OS specific slashes (see blender.c) * made available BLI_char_switch(char *string, char from, char to) * made available BLI_clean(char *string);. This function should be called whenever you're doing path stuff, so paths are correctly saved, and thus avoiding other path functions stopping to work 2: * relative paths work now in sequencer too (due to slash mess that didn't work all too well).
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/blender.c47
-rw-r--r--source/blender/blenkernel/intern/image.c3
2 files changed, 48 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index cc47169a7a2..466c69ce639 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -262,6 +262,51 @@ static void clear_global(void)
G.f &= ~(G_WEIGHTPAINT + G_VERTEXPAINT + G_FACESELECT);
}
+/* make sure path names are correct for OS */
+static void clean_paths(Main *main)
+{
+ Image *image= main->image.first;
+ bSound *sound= main->sound.first;
+ Scene *scene= main->scene.first;
+ Editing *ed;
+ Sequence *seq;
+ Strip *strip;
+
+
+ while(image) {
+ BLI_clean(image->name);
+ image= image->id.next;
+ }
+
+ while(sound) {
+ BLI_clean(sound->name);
+ sound= sound->id.next;
+ }
+
+ while(scene) {
+ ed= scene->ed;
+ if(ed) {
+ seq= ed->seqbasep->first;
+ while(seq) {
+ if(seq->plugin) {
+ BLI_clean(seq->plugin->name);
+ }
+ strip= seq->strip;
+ while(strip) {
+ BLI_clean(strip->dir);
+ strip= strip->next;
+ }
+ seq= seq->next;
+ }
+ }
+ BLI_clean(scene->r.backbuf);
+ BLI_clean(scene->r.pic);
+ BLI_clean(scene->r.ftype);
+
+ scene= scene->id.next;
+ }
+}
+
static void setup_app_data(BlendFileData *bfd, char *filename)
{
Object *ob;
@@ -275,6 +320,8 @@ static void setup_app_data(BlendFileData *bfd, char *filename)
else if(G.fileflags & G_FILE_NO_UI) mode= 'n';
else mode= 0;
+ clean_paths(bfd->main);
+
/* no load screens? */
if(mode) {
/* comes from readfile.c */
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 10387e8e2a7..051646f9ae3 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -172,7 +172,7 @@ void makepicstring(char *string, int frame)
strcpy(string, G.scene->r.pic);
BLI_convertstringcode(string, G.sce, G.scene->r.cfra);
- len= strlen(string);
+ len= strlen(string);
/* can also: sprintf(num, "%04d", frame); */
@@ -205,7 +205,6 @@ void makepicstring(char *string, int frame)
else if(G.scene->r.imtype==R_BMP) {
extension= ".bmp";
}
-
if(G.scene->r.scemode & R_EXTENSION) strcat(string, extension);
}