From c2dee803e31446c42dc6a371b9e89c4f4d559ead Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 16 Jan 2019 17:34:31 +0100 Subject: Outilner: pass userdata void pointer to outliner_do_object_operation_ex(). Even though it is not used currently, an _ex() func should not ignore that, it is kind of mandatory for many advanced/complex behaviors. --- source/blender/editors/space_outliner/outliner_intern.h | 2 +- source/blender/editors/space_outliner/outliner_tools.c | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'source/blender/editors/space_outliner') diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h index f8c32375bdf..b3e4ea88b4c 100644 --- a/source/blender/editors/space_outliner/outliner_intern.h +++ b/source/blender/editors/space_outliner/outliner_intern.h @@ -219,7 +219,7 @@ typedef void (*outliner_operation_cb)( void outliner_do_object_operation_ex( struct bContext *C, struct ReportList *reports, struct Scene *scene, struct SpaceOops *soops, - struct ListBase *lb, outliner_operation_cb operation_cb, bool recurse_selected); + struct ListBase *lb, outliner_operation_cb operation_cb, void *user_data, bool recurse_selected); void outliner_do_object_operation( struct bContext *C, struct ReportList *reports, struct Scene *scene, struct SpaceOops *soops, struct ListBase *lb, outliner_operation_cb operation_cb); diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index 401f76947bb..4532ee5cd51 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -561,7 +561,7 @@ static void singleuser_world_cb( */ void outliner_do_object_operation_ex( bContext *C, ReportList *reports, Scene *scene_act, SpaceOops *soops, ListBase *lb, - outliner_operation_cb operation_cb, bool select_recurse) + outliner_operation_cb operation_cb, void *user_data, bool select_recurse) { TreeElement *te; @@ -578,14 +578,14 @@ void outliner_do_object_operation_ex( /* important to use 'scene_owner' not scene_act else deleting objects can crash. * only use 'scene_act' when 'scene_owner' is NULL, which can happen when the * outliner isn't showing scenes: Visible Layer draw mode for eg. */ - operation_cb(C, reports, scene_owner ? scene_owner : scene_act, te, NULL, tselem, NULL); + operation_cb(C, reports, scene_owner ? scene_owner : scene_act, te, NULL, tselem, user_data); select_handled = true; } } if (TSELEM_OPEN(tselem, soops)) { if ((select_handled == false) || select_recurse) { outliner_do_object_operation_ex( - C, reports, scene_act, soops, &te->subtree, operation_cb, select_recurse); + C, reports, scene_act, soops, &te->subtree, operation_cb, NULL, select_recurse); } } } @@ -595,7 +595,7 @@ void outliner_do_object_operation( bContext *C, ReportList *reports, Scene *scene_act, SpaceOops *soops, ListBase *lb, outliner_operation_cb operation_cb) { - outliner_do_object_operation_ex(C, reports, scene_act, soops, lb, operation_cb, true); + outliner_do_object_operation_ex(C, reports, scene_act, soops, lb, operation_cb, NULL, true); } /* ******************************************** */ @@ -961,7 +961,8 @@ static int outliner_object_operation_exec(bContext *C, wmOperator *op) } else if (event == OL_OP_SELECT_HIERARCHY) { Scene *sce = scene; // to be able to delete, scenes are set... - outliner_do_object_operation_ex(C, op->reports, scene, soops, &soops->tree, object_select_hierarchy_cb, false); + outliner_do_object_operation_ex( + C, op->reports, scene, soops, &soops->tree, object_select_hierarchy_cb, NULL, false); if (scene != sce) { WM_window_set_active_scene(bmain, C, win, sce); } @@ -991,7 +992,8 @@ static int outliner_object_operation_exec(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene); } else if (event == OL_OP_DELETE_HIERARCHY) { - outliner_do_object_operation_ex(C, op->reports, scene, soops, &soops->tree, object_delete_hierarchy_cb, false); + outliner_do_object_operation_ex( + C, op->reports, scene, soops, &soops->tree, object_delete_hierarchy_cb, NULL, false); /* XXX: See OL_OP_DELETE comment above. */ outliner_cleanup_tree(soops); -- cgit v1.2.3