diff options
author | Ton Roosendaal <ton@blender.org> | 2006-03-05 20:35:06 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2006-03-05 20:35:06 +0300 |
commit | fd1d3779d0a691f7d05b6f46ba909dbf43a6f1a3 (patch) | |
tree | 39cbbc7ff7cb8447a2d725832cf35c9afa707464 /source | |
parent | f6cd40ee40a0cd6cdc956c2214997d4efbcff7b8 (diff) |
Fix for appending data from other files: if this appended data
again was linking from another file, this relationship was not
corrected (lib_indirect -> lib_extern), so also not saved in a file.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/library.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index f8117140e8f..ac7c9a39e09 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -75,6 +75,8 @@ #include "DNA_action_types.h" #include "DNA_userdef_types.h" #include "DNA_node_types.h" +#include "DNA_nla_types.h" +#include "DNA_effect_types.h" #include "BLI_blenlib.h" #include "BLI_dynstr.h" @@ -105,6 +107,7 @@ #include "BKE_armature.h" #include "BKE_action.h" #include "BKE_node.h" +#include "BKE_effect.h" #include "BPI_script.h" @@ -870,6 +873,42 @@ static void image_fix_relative_path(Image *ima) } } +#define LIBTAG(a) if(a && a->id.lib) {a->id.flag &=~LIB_INDIRECT; a->id.flag |= LIB_EXTERN;} + +static void lib_indirect_test_id(ID *id) +{ + + if(id->lib) + return; + + if(GS(id->name)==ID_OB) { + Object *ob= (Object *)id; + bActionStrip *strip; + Mesh *me; + PartEff *paf; + int a; + + for (strip=ob->nlastrips.first; strip; strip=strip->next){ + LIBTAG(strip->object); + LIBTAG(strip->act); + LIBTAG(strip->ipo); + } + + for(a=0; a<ob->totcol; a++) { + LIBTAG(ob->mat[a]); + } + + paf = give_parteff(ob); + if (paf) + LIBTAG(paf->group); + + LIBTAG(ob->dup_group); + me= ob->data; + LIBTAG(me); + } +} + + /* if lib!=NULL, only all from lib local */ void all_local(Library *lib) { @@ -910,6 +949,13 @@ void all_local(Library *lib) new_id(lbarray[a], id, 0); } } + + /* patch 3: make sure library data isn't indirect falsely... */ + a= set_listbasepointers(G.main, lbarray); + while(a--) { + for(id= lbarray[a]->first; id; id=id->next) + lib_indirect_test_id(id); + } } |