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:
authorTon Roosendaal <ton@blender.org>2005-12-12 01:54:46 +0300
committerTon Roosendaal <ton@blender.org>2005-12-12 01:54:46 +0300
commit51d1b52286ba711a76f196dc8e8f2046631c913f (patch)
tree1bf3d4dd52d09d0289421d114ca3ab6508b75df4 /source/blender/blenloader
parent83f8cb0806ccc86419e084330233bdbb4b97b5ef (diff)
Fix #1 to resolve corrupted NLA files with lib-linked groups.
- If a library became unreadable, with a print like: ERROR: can't find lib //../../../../../../..//jorma_light.blend Then set the F10 "rt" button to 111. :) That will read files with a stripping routine to fix it. - For lost actions in strips: press Lkey in NLA editor, this is the new "re-link action" option. To get it work, dont forget to fill in the proper Armature in NKey panel. The real fix, for the code that corrupted relative paths, will be part of the bf-blender branch merging, which follows.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index f8185b229ae..84ee079ba81 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -890,6 +890,19 @@ FileData *blo_openblenderfile(char *name, BlendReadError *error_r)
gzFile gzfile;
char name1[FILE_MAXDIR+FILE_MAXFILE];
+ /* relative path rescue... */
+ if(G.rt==111) {
+ int len= strlen(name);
+ printf("old %s\n", name);
+ while(len-- > 1) {
+ if(name[len]=='/' && name[len-1]=='/') {
+ strcpy(name, name+len-1);
+ printf("new %s\n", name);
+ break;
+ }
+ }
+ }
+
/* library files can have stringcodes */
strcpy(name1, name);
if(name[0]=='/' && name[1]=='/')
@@ -5958,6 +5971,10 @@ void BLO_library_append(SpaceFile *sfile, char *dir, int idcode)
/* make copy of the 'last loaded filename', we need to restore it */
BLI_strncpy(filename, G.sce, sizeof(filename));
+ printf("G.sce %s\n", filename);
+ printf("fd->filename %s\n", fd->filename);
+ printf("dir %s\n", dir);
+
BLI_strncpy(G.sce, fd->filename, sizeof(filename)); // already opened file, to reconstruct relative paths
if(sfile->flag & FILE_AUTOSELECT) scene_deselect_all(G.scene);
@@ -5990,8 +6007,11 @@ void BLO_library_append(SpaceFile *sfile, char *dir, int idcode)
read_libraries(fd, &fd->mainlist);
if(sfile->flag & FILE_STRINGCODE) {
+ printf("mainl->curlib->name %s\n", mainl->curlib->name);
+
/* uses old .blend file (*filename) as reference */
BLI_makestringcode(filename, mainl->curlib->name);
+ printf("after mainl->curlib->name %s\n", mainl->curlib->name);
/* the caller checks for appended library, so we make sure names match */
BLI_strncpy(dir, mainl->curlib->name, sizeof(mainl->curlib->name));
}