diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-04-07 21:35:47 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-04-07 21:35:47 +0400 |
commit | 76420c2fecdd57acf4fe0440fb681cf8f46707e4 (patch) | |
tree | a2ce3b28bf0d93aa4b2e241cc36a949f364d2a82 /source/blender/src/filesel.c | |
parent | 4fae78f8d9e1acd55a5d068ea4f161687c8efc0c (diff) |
appending libdata no longer breaks all external references.
Existing data is flagged with LIB_APPEND_TAG and all_local only has an option to only operate on un-flagged data.
If you append an object thats linked to a material alredy linked in your scene, the material will not be made local.
So at worst youll need to make local some of the datablocks.
This is fairly simple and though my tests show it to work, do some tests on your own libraries before assuming its problem free.
scripttemplate_mesh_edit wasnt updated with PyAPI changes and moved some functions into generic places.
Diffstat (limited to 'source/blender/src/filesel.c')
-rw-r--r-- | source/blender/src/filesel.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/source/blender/src/filesel.c b/source/blender/src/filesel.c index d2ac3115c0f..d8f1b732e19 100644 --- a/source/blender/src/filesel.c +++ b/source/blender/src/filesel.c @@ -2395,8 +2395,20 @@ static void do_library_append(SpaceFile *sfile) Object *ob; int idcode = groupname_to_code(group); + if((sfile->flag & FILE_LINK)==0) { + /* tag everything, all untagged data can be made local */ + ID *id; + ListBase *lbarray[MAX_LIBARRAY]; + int a; + + a= set_listbasepointers(G.main, lbarray); + while(a--) { + for(id= lbarray[a]->first; id; id= id->next) id->flag |= LIB_APPEND_TAG; + } + } + BLO_library_append(sfile, dir, idcode); - + /* DISPLISTS? */ ob= G.main->object.first; while(ob) { @@ -2413,14 +2425,15 @@ static void do_library_append(SpaceFile *sfile) lib= lib->id.next; } - if(lib) { - if((sfile->flag & FILE_LINK)==0) - all_local(lib); + /* make local */ + if(lib && (sfile->flag & FILE_LINK)==0) { + all_local(lib, 1); } + DAG_scene_sort(G.scene); + /* in sfile->dir is the whole lib name */ BLI_strncpy(G.lib, sfile->dir, sizeof(G.lib) ); - } } |