From 5db950e860b2f64078cfc8cf00cb4f430b8a1baf Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 9 Feb 2018 22:14:17 +1100 Subject: Cleanup: use workspace for object_mode when possible --- source/blender/editors/space_outliner/outliner_edit.c | 7 +++---- source/blender/editors/space_outliner/outliner_select.c | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'source/blender/editors/space_outliner') diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 25808df807d..6bbec6a1a48 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -978,8 +978,7 @@ static int outliner_open_back(TreeElement *te) static int outliner_show_active_exec(bContext *C, wmOperator *UNUSED(op)) { - EvaluationContext eval_ctx; - CTX_data_eval_ctx(C, &eval_ctx); + const WorkSpace *workspace = CTX_wm_workspace(C); SpaceOops *so = CTX_wm_space_outliner(C); ViewLayer *view_layer = CTX_data_view_layer(C); ARegion *ar = CTX_wm_region(C); @@ -1000,13 +999,13 @@ static int outliner_show_active_exec(bContext *C, wmOperator *UNUSED(op)) /* traverse down the bone hierarchy in case of armature */ TreeElement *te_obact = te; - if (eval_ctx.object_mode & OB_MODE_POSE) { + if (workspace->object_mode & OB_MODE_POSE) { bPoseChannel *pchan = CTX_data_active_pose_bone(C); if (pchan) { te = outliner_find_posechannel(&te_obact->subtree, pchan); } } - else if (eval_ctx.object_mode & OB_MODE_EDIT) { + else if (workspace->object_mode & OB_MODE_EDIT) { EditBone *ebone = CTX_data_active_bone(C); if (ebone) { te = outliner_find_editbone(&te_obact->subtree, ebone); diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index 9f66e6a0105..df5f43978e6 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -658,8 +658,7 @@ static eOLDrawState tree_element_active_text( static eOLDrawState tree_element_active_pose( bContext *C, Scene *scene, ViewLayer *view_layer, TreeElement *UNUSED(te), TreeStoreElem *tselem, const eOLSetState set) { - EvaluationContext eval_ctx; - CTX_data_eval_ctx(C, &eval_ctx); + const WorkSpace *workspace = CTX_wm_workspace(C); Object *ob = (Object *)tselem->id; Base *base = BKE_view_layer_base_find(view_layer, ob); @@ -672,7 +671,7 @@ static eOLDrawState tree_element_active_pose( if (scene->obedit) { ED_object_editmode_exit(C, EM_FREEDATA | EM_FREEUNDO | EM_WAITCURSOR | EM_DO_UNDO); } - if (eval_ctx.object_mode & OB_MODE_POSE) { + if (workspace->object_mode & OB_MODE_POSE) { ED_armature_exit_posemode(C, base); } else { @@ -680,7 +679,7 @@ static eOLDrawState tree_element_active_pose( } } else { - if (eval_ctx.object_mode & OB_MODE_POSE) { + if (workspace->object_mode & OB_MODE_POSE) { return OL_DRAWSEL_NORMAL; } } -- cgit v1.2.3