Commit: 9b94e2a743cf6b059f5e62fbb34605bc1f3117f1
Author: Dalai Felinto
Date:   Mon Apr 24 17:14:01 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB9b94e2a743cf6b059f5e62fbb34605bc1f3117f1

Bring back outliner hierachy delete

===================================================================

M       source/blender/editors/space_outliner/outliner_tools.c

===================================================================

diff --git a/source/blender/editors/space_outliner/outliner_tools.c 
b/source/blender/editors/space_outliner/outliner_tools.c
index 7afd4e28602..bf004db2c84 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -886,16 +886,17 @@ static void outliner_do_data_operation(SpaceOops *soops, 
int type, int event, Li
        }
 }
 
-static BaseLegacy *outline_delete_hierarchy(bContext *C, ReportList *reports, 
Scene *scene, BaseLegacy *base)
+static Base *outline_delete_hierarchy(bContext *C, ReportList *reports, Scene 
*scene, Base *base)
 {
-       BaseLegacy *child_base, *base_next;
+       Base *child_base, *base_next;
        Object *parent;
+       SceneLayer *scene_layer = CTX_data_scene_layer(C);
 
        if (!base) {
                return NULL;
        }
 
-       for (child_base = scene->base.first; child_base; child_base = 
base_next) {
+       for (child_base = scene_layer->object_bases.first; child_base; 
child_base = base_next) {
                base_next = child_base->next;
                for (parent = child_base->object->parent; parent && (parent != 
base->object); parent = parent->parent);
                if (parent) {
@@ -926,12 +927,12 @@ static void object_delete_hierarchy_cb(
         bContext *C, ReportList *reports, Scene *scene,
         TreeElement *te, TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem, 
void *UNUSED(user_data))
 {
-#if 0
+       SceneLayer *sl = CTX_data_scene_layer(C);
        Base *base = (Base *)te->directdata;
        Object *obedit = scene->obedit;
 
        if (!base) {
-               base = BKE_scene_base_find(scene, (Object *)tselem->id);
+               base = BKE_scene_layer_base_find(sl, (Object *)tselem->id);
        }
        if (base) {
                /* Check also library later. */
@@ -949,15 +950,6 @@ static void object_delete_hierarchy_cb(
        }
 
        WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene);
-#else
-       (void) C;
-       (void) scene;
-       (void) te;
-       (void) tselem;
-       (void) outline_delete_hierarchy;
-       BKE_reportf(reports, RPT_ERROR, "Delete from outliner not supported at 
the moment");
-       TODO_LAYER_BASE
-#endif
 }
 
 /* **************************************** */

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to