diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-01-05 08:33:27 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-01-05 08:33:27 +0300 |
commit | 370adc51ffa31af482b94b3ba15f601987e29a40 (patch) | |
tree | adf9ec95334383567e924e2e4a3705b59aeed3cc /source/blender/blenkernel/intern/library.c | |
parent | d387c1944482309b46576f8771779f1da9b4e585 (diff) |
py api function to tag all ID blocks, was available in 2.4x as.
bpy.data.meshes.tag = True
But this was only useful for setting so make it a function for 2.5x.
bpy.data.objects.tag(False)
X3D: use tagging rather then a name dictionary, this fixes a bug where library name overlaps could mix up names.
Diffstat (limited to 'source/blender/blenkernel/intern/library.c')
-rw-r--r-- | source/blender/blenkernel/intern/library.c | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index cac0b64a6b6..08adfdc1960 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -1257,18 +1257,36 @@ static void lib_indirect_test_id(ID *id, Library *lib) } } -void tag_main(struct Main *mainvar, int tag) +void tag_main_lb(ListBase *lb, const short tag) { - ListBase *lbarray[MAX_LIBARRAY]; ID *id; + if(tag) { + for(id= lb->first; id; id= id->next) { + id->flag |= LIB_DOIT; + } + } + else { + for(id= lb->first; id; id= id->next) { + id->flag &= ~LIB_DOIT; + } + } +} + +void tag_main_idcode(struct Main *mainvar, const short type, const short tag) +{ + ListBase *lb= which_libbase(mainvar, type); + + tag_main_lb(lb, tag); +} + +void tag_main(struct Main *mainvar, const short tag) +{ + ListBase *lbarray[MAX_LIBARRAY]; int a; a= set_listbasepointers(mainvar, lbarray); while(a--) { - for(id= lbarray[a]->first; id; id= id->next) { - if(tag) id->flag |= LIB_DOIT; - else id->flag &= ~LIB_DOIT; - } + tag_main_lb(lbarray[a], tag); } } |