diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-02-06 09:28:00 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-02-06 10:03:28 +0300 |
commit | 5ec016169b80cc8205740a5b3beb12f91be3182b (patch) | |
tree | cf3423e34d0a0d51b72b40d8efd3abe2cf5a5370 /source/blender/editors/space_view3d/view3d_snap.c | |
parent | 269ed0a770bf3627ba1e21d87d3d748c0765a531 (diff) |
Object Mode: use eval_ctx for context/screen code
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_snap.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_snap.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index 1df29201bf6..cee76925040 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 (ob->mode & OB_MODE_POSE) { + if (eval_ctx.object_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 && (obact->mode & OB_MODE_POSE)) { + else if (obact && (eval_ctx.object_mode & OB_MODE_POSE)) { struct KeyingSet *ks = ANIM_get_keyingset_for_autokeying(scene, ANIM_KS_LOCATION_ID); bPoseChannel *pchan; @@ -554,6 +554,8 @@ 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); @@ -599,7 +601,7 @@ static bool snap_curs_to_sel_ex(bContext *C, float cursor[3]) else { Object *obact = CTX_data_active_object(C); - if (obact && (obact->mode & OB_MODE_POSE)) { + if (obact && (eval_ctx.object_mode & OB_MODE_POSE)) { bArmature *arm = obact->data; bPoseChannel *pchan; for (pchan = obact->pose->chanbase.first; pchan; pchan = pchan->next) { @@ -698,10 +700,12 @@ static bool snap_calc_active_center(bContext *C, const bool select_only, float r } } else { + EvaluationContext eval_ctx; + CTX_data_eval_ctx(C, &eval_ctx); Object *ob = CTX_data_active_object(C); if (ob) { - if (ob->mode & OB_MODE_POSE) { + if (eval_ctx.object_mode & OB_MODE_POSE) { bPoseChannel *pchan = BKE_pose_channel_active(ob); if (pchan) { if (!select_only || (pchan->bone->flag & BONE_SELECTED)) { |