no functional changes, make give_base_to_objects() arguments less confusing.

This commit is contained in:
Campbell Barton 2011-05-21 06:48:19 +00:00
parent 1890b7f431
commit 6c4cd8d9f3

View File

@ -12716,10 +12716,11 @@ static int object_in_any_scene(Main *mainvar, Object *ob)
} }
/* when *lib set, it also does objects that were in the appended group */ /* when *lib set, it also does objects that were in the appended group */
static void give_base_to_objects(Main *mainvar, Scene *sce, Library *lib, int is_group_append) static void give_base_to_objects(Main *mainvar, Scene *sce, Library *lib, const short idcode, const short is_link)
{ {
Object *ob; Object *ob;
Base *base; Base *base;
const short is_group_append= (is_link==FALSE && idcode==ID_GR);
/* give all objects which are LIB_INDIRECT a base, or for a group when *lib has been set */ /* give all objects which are LIB_INDIRECT a base, or for a group when *lib has been set */
for(ob= mainvar->object.first; ob; ob= ob->id.next) { for(ob= mainvar->object.first; ob; ob= ob->id.next) {
@ -12996,21 +12997,18 @@ static void library_append_end(const bContext *C, Main *mainl, FileData **fd, in
/* give a base to loose objects. If group append, do it for objects too */ /* give a base to loose objects. If group append, do it for objects too */
if(scene) { if(scene) {
const short is_link= (flag & FILE_LINK) != 0;
if(idcode==ID_SCE) { if(idcode==ID_SCE) {
/* dont instance anything when linking in scenes, assume the scene its self instances the data */ /* dont instance anything when linking in scenes, assume the scene its self instances the data */
} }
else if(idcode==ID_GR) { else if(idcode==ID_GR) {
if (flag & FILE_LINK) { give_base_to_objects(mainvar, scene, is_link ? NULL : curlib, idcode, is_link);
give_base_to_objects(mainvar, scene, NULL, 0);
} else {
give_base_to_objects(mainvar, scene, curlib, 1);
}
if (flag & FILE_GROUP_INSTANCE) { if (flag & FILE_GROUP_INSTANCE) {
give_base_to_groups(mainvar, scene); give_base_to_groups(mainvar, scene);
} }
} else { } else {
give_base_to_objects(mainvar, scene, NULL, 0); give_base_to_objects(mainvar, scene, NULL, idcode, is_link);
} }
} }
else { else {