diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2016-07-14 14:58:40 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2016-07-14 15:00:24 +0300 |
commit | 3a5eff95c59fdf1f2817e5e3ffe7b7f3609d031a (patch) | |
tree | add635a1ad75eb127c82cc4f51b0d8c80b776d04 /source/blender/editors/space_outliner | |
parent | 274795045c988065757faa88aee335961d978fff (diff) |
Cleanup: Use BKE_scene_base_add for creating bases
And use __func__ macro.
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_tools.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index f3235d07757..253e8180c3d 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -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; } } |