Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-02-09 14:14:17 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-02-09 14:14:39 +0300
commit5db950e860b2f64078cfc8cf00cb4f430b8a1baf (patch)
treeb9a734351e0cfa849c3c136e4fc6f26276c7c5c0 /source/blender/editors/space_outliner
parent25074be697cb5726328aa5d064a60788c1da6aeb (diff)
Cleanup: use workspace for object_mode when possible
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r--source/blender/editors/space_outliner/outliner_edit.c7
-rw-r--r--source/blender/editors/space_outliner/outliner_select.c7
2 files changed, 6 insertions, 8 deletions
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;
}
}