From 0e1440eefd98ef359ea83b465ada175364b1c4bf Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Thu, 15 Dec 2022 10:53:46 +0100 Subject: [PATCH] Paint: Orbit around selection/stroke: remove redundant case Since rB8014180720d8, all paint modes support orbiting around last stroke, so [a] the comment there is out of date and [b] the fallback case of orbiting around the center will never be used (unless there is no stroke information - but BKE_paint_stroke_get_average handles that anyways). Spotted while looking into T101766. Maniphest Tasks: T101766 Differential Revision: https://developer.blender.org/D16779 --- .../blender/editors/space_view3d/view3d_navigate.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/source/blender/editors/space_view3d/view3d_navigate.c b/source/blender/editors/space_view3d/view3d_navigate.c index 047b48a72d9..ed0225f578b 100644 --- a/source/blender/editors/space_view3d/view3d_navigate.c +++ b/source/blender/editors/space_view3d/view3d_navigate.c @@ -174,19 +174,7 @@ bool view3d_orbit_calc_center(bContext *C, float r_dyn_ofs[3]) if (ob_act && (ob_act->mode & OB_MODE_ALL_PAINT) && /* with weight-paint + pose-mode, fall through to using calculateTransformCenter */ ((ob_act->mode & OB_MODE_WEIGHT_PAINT) && BKE_object_pose_armature_get(ob_act)) == 0) { - /* in case of sculpting use last average stroke position as a rotation - * center, in other cases it's not clear what rotation center shall be - * so just rotate around object origin - */ - if (ob_act->mode & - (OB_MODE_SCULPT | OB_MODE_TEXTURE_PAINT | OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT)) { - float stroke[3]; - BKE_paint_stroke_get_average(scene, ob_act_eval, stroke); - copy_v3_v3(lastofs, stroke); - } - else { - copy_v3_v3(lastofs, ob_act_eval->object_to_world[3]); - } + BKE_paint_stroke_get_average(scene, ob_act_eval, lastofs); is_set = true; } else if (ob_act && (ob_act->mode & OB_MODE_EDIT) && (ob_act->type == OB_FONT)) {