diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-04-05 19:20:27 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-04-05 19:21:14 +0300 |
commit | 1c24c04e6023f2d2a328dfcdc9f86cd381d029a3 (patch) | |
tree | 7a5af59ce078cb66fb17ec33cf111ffc8d5fb328 /source/blender/editors/space_view3d/view3d_snap.c | |
parent | 57329304b061efe756e3a4ce1b828e9a7c7f7030 (diff) |
Remove workspace object mode, reverts changes w/ 2.8
This caused too many problems syncing object modes
with multiple objects/windows/workspaces, see: D3130 for details.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_snap.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_snap.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index 40dd2f0f428..1df29201bf6 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -113,7 +113,7 @@ static int snap_sel_to_grid_exec(bContext *C, wmOperator *UNUSED(op)) CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { - if (eval_ctx.object_mode & OB_MODE_POSE) { + if (ob->mode & OB_MODE_POSE) { bPoseChannel *pchan; bArmature *arm = ob->data; @@ -272,7 +272,7 @@ static int snap_selected_to_location(bContext *C, const float snap_target_global ED_transverts_update_obedit(&tvs, obedit); ED_transverts_free(&tvs); } - else if (obact && (eval_ctx.object_mode & OB_MODE_POSE)) { + else if (obact && (obact->mode & OB_MODE_POSE)) { struct KeyingSet *ks = ANIM_get_keyingset_for_autokeying(scene, ANIM_KS_LOCATION_ID); bPoseChannel *pchan; @@ -554,8 +554,6 @@ static void bundle_midpoint(Scene *scene, Object *ob, float vec[3]) static bool snap_curs_to_sel_ex(bContext *C, float cursor[3]) { - EvaluationContext eval_ctx; - CTX_data_eval_ctx(C, &eval_ctx); Object *obedit = CTX_data_edit_object(C); Scene *scene = CTX_data_scene(C); View3D *v3d = CTX_wm_view3d(C); @@ -601,7 +599,7 @@ static bool snap_curs_to_sel_ex(bContext *C, float cursor[3]) else { Object *obact = CTX_data_active_object(C); - if (obact && (eval_ctx.object_mode & OB_MODE_POSE)) { + if (obact && (obact->mode & OB_MODE_POSE)) { bArmature *arm = obact->data; bPoseChannel *pchan; for (pchan = obact->pose->chanbase.first; pchan; pchan = pchan->next) { @@ -703,8 +701,7 @@ static bool snap_calc_active_center(bContext *C, const bool select_only, float r Object *ob = CTX_data_active_object(C); if (ob) { - const WorkSpace *workspace = CTX_wm_workspace(C); - if (workspace->object_mode & OB_MODE_POSE) { + if (ob->mode & OB_MODE_POSE) { bPoseChannel *pchan = BKE_pose_channel_active(ob); if (pchan) { if (!select_only || (pchan->bone->flag & BONE_SELECTED)) { |