[Bf-blender-cvs] [47851e38e7c] greasepencil-object: GPencil: Use Object location instead of 3D cursor for Grab Brush

Antonio Vazquez noreply at git.blender.org
Thu Sep 19 17:04:35 CEST 2019


Commit: 47851e38e7c4528bfcd534f35cb67cf432a97263
Author: Antonio Vazquez
Date:   Thu Sep 19 17:04:20 2019 +0200
Branches: greasepencil-object
https://developer.blender.org/rB47851e38e7c4528bfcd534f35cb67cf432a97263

GPencil: Use Object location instead of 3D cursor for Grab Brush

Instead to use the 3D cursor as reference point (legacy code), it would be better use the object location.

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

M	source/blender/editors/gpencil/gpencil_brush.c

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

diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c
index 4a65bbff454..cd1536d0dbb 100644
--- a/source/blender/editors/gpencil/gpencil_brush.c
+++ b/source/blender/editors/gpencil/gpencil_brush.c
@@ -532,7 +532,7 @@ static void gp_brush_grab_calc_dvec(tGP_BrushEditData *gso)
   // XXX: screen-space strokes in 3D space will suffer!
   if (gso->sa->spacetype == SPACE_VIEW3D) {
     RegionView3D *rv3d = gso->ar->regiondata;
-    float *rvec = gso->scene->cursor.location;
+    float *rvec = gso->object->loc;
     float zfac = ED_view3d_calc_zfac(rv3d, rvec, NULL);
 
     float mval_f[2];
@@ -657,7 +657,7 @@ static void gp_brush_calc_midpoint(tGP_BrushEditData *gso)
      * See: gpencil_paint.c :: gp_stroke_convertcoords()
      */
     RegionView3D *rv3d = gso->ar->regiondata;
-    const float *rvec = gso->scene->cursor.location;
+    const float *rvec = gso->object->loc;
     float zfac = ED_view3d_calc_zfac(rv3d, rvec, NULL);
 
     float mval_f[2];



More information about the Bf-blender-cvs mailing list