Cleanup: Use BKE_scene_base_add for creating bases

And use __func__ macro.
This commit is contained in:
Julian Eisel 2016-07-14 13:58:40 +02:00
parent 274795045c
commit 3a5eff95c5
2 changed files with 6 additions and 13 deletions

View File

@ -1123,7 +1123,7 @@ char *BKE_scene_find_last_marker_name(Scene *scene, int frame)
Base *BKE_scene_base_add(Scene *sce, Object *ob)
{
Base *b = MEM_callocN(sizeof(*b), "BKE_scene_base_add");
Base *b = MEM_callocN(sizeof(*b), __func__);
BLI_addhead(&sce->base, b);
b->object = ob;

View File

@ -516,23 +516,16 @@ static void group_linkobs2scene_cb(
Group *group = (Group *)tselem->id;
GroupObject *gob;
Base *base;
for (gob = group->gobject.first; gob; gob = gob->next) {
base = BKE_scene_base_find(scene, gob->ob);
if (base) {
base->object->flag |= SELECT;
base->flag |= SELECT;
}
else {
if (!base) {
/* link to scene */
base = MEM_callocN(sizeof(Base), "add_base");
BLI_addhead(&scene->base, base);
base->lay = gob->ob->lay;
gob->ob->flag |= SELECT;
base->flag = gob->ob->flag;
base->object = gob->ob;
base = BKE_scene_base_add(scene, gob->ob);
id_lib_extern((ID *)gob->ob); /* in case these are from a linked group */
}
base->object->flag |= SELECT;
base->flag |= SELECT;
}
}