Cleanup: Use BKE_scene_base_add for creating bases
And use __func__ macro.
This commit is contained in:
parent
274795045c
commit
3a5eff95c5
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue