[Bf-blender-cvs] [0e1440eefd9] master: Paint: Orbit around selection/stroke: remove redundant case

Philipp Oeser noreply at git.blender.org
Thu Dec 15 12:28:29 CET 2022


Commit: 0e1440eefd98ef359ea83b465ada175364b1c4bf
Author: Philipp Oeser
Date:   Thu Dec 15 10:53:46 2022 +0100
Branches: master
https://developer.blender.org/rB0e1440eefd98ef359ea83b465ada175364b1c4bf

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

===================================================================

M	source/blender/editors/space_view3d/view3d_navigate.c

===================================================================

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)) {



More information about the Bf-blender-cvs mailing list