[Bf-blender-cvs] [0aaa0720e9e] temp-lanpr-cleanup: GPencil: Remove Sculpt rotation effect for multiframe sculpt

Antonio Vazquez noreply at git.blender.org
Wed Sep 25 03:49:52 CEST 2019


Commit: 0aaa0720e9e97fcd99b21dc72698755a2c1e4116
Author: Antonio Vazquez
Date:   Fri Sep 20 16:42:57 2019 +0200
Branches: temp-lanpr-cleanup
https://developer.blender.org/rB0aaa0720e9e97fcd99b21dc72698755a2c1e4116

GPencil: Remove Sculpt rotation effect for multiframe sculpt

As multiframe does not use modifiers, this is not required and only gets weird results.

Related to T70116

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

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 c8b0e4951fd..59d63e0a3fd 100644
--- a/source/blender/editors/gpencil/gpencil_brush.c
+++ b/source/blender/editors/gpencil/gpencil_brush.c
@@ -1507,21 +1507,21 @@ static void gpsculpt_brush_init_stroke(bContext *C, tGP_BrushEditData *gso)
  * valid reference point.
  */
 static float gpsculpt_rotation_eval_get(GP_SpaceConversion *gsc,
-                                        bGPDstroke *gps_orig,
-                                        bGPDspoint *pt_orig,
                                         bGPDstroke *gps_eval,
                                         bGPDspoint *pt_eval,
-                                        int idx)
+                                        int idx_eval)
 {
 
+  bGPDstroke *gps_orig = gps_eval->runtime.gps_orig;
+  bGPDspoint *pt_orig = &gps_orig->points[pt_eval->runtime.idx_orig];
   bGPDspoint *pt_prev_eval = NULL;
   bGPDspoint *pt_orig_prev = NULL;
-  if (idx != 0) {
-    pt_prev_eval = &gps_eval->points[idx - 1];
+  if (idx_eval != 0) {
+    pt_prev_eval = &gps_eval->points[idx_eval - 1];
   }
   else {
     if (gps_eval->totpoints > 1) {
-      pt_prev_eval = &gps_eval->points[idx + 1];
+      pt_prev_eval = &gps_eval->points[idx_eval + 1];
     }
     else {
       return 0.0f;
@@ -1594,7 +1594,7 @@ static bool gpsculpt_brush_do_stroke(tGP_BrushEditData *gso,
       if (len_v2v2_int(mval_i, pc1) <= radius) {
         /* apply operation to this point */
         if (pt_active != NULL) {
-          rot_eval = gpsculpt_rotation_eval_get(&gso->gsc, gps_active, pt_active, gps, pt, 0);
+          rot_eval = (!is_multiedit) ? gpsculpt_rotation_eval_get(&gso->gsc, gps, pt, 0) : 0.0f;
           changed = apply(gso, gps_active, rot_eval, 0, radius, pc1);
         }
       }
@@ -1641,7 +1641,7 @@ static bool gpsculpt_brush_do_stroke(tGP_BrushEditData *gso,
           pt_active = (!is_multiedit) ? pt->runtime.pt_orig : pt;
           int index = (!is_multiedit) ? pt->runtime.idx_orig : i;
           if (pt_active != NULL) {
-            rot_eval = gpsculpt_rotation_eval_get(&gso->gsc, gps_active, pt_active, gps, pt, i);
+            rot_eval = (!is_multiedit) ? gpsculpt_rotation_eval_get(&gso->gsc, gps, pt, i) : 0.0f;
             ok = apply(gso, gps_active, rot_eval, index, radius, pc1);
           }
 
@@ -1658,8 +1658,8 @@ static bool gpsculpt_brush_do_stroke(tGP_BrushEditData *gso,
             pt_active = (!is_multiedit) ? pt->runtime.pt_orig : pt;
             index = (!is_multiedit) ? pt->runtime.idx_orig : i;
             if (pt->runtime.pt_orig != NULL) {
-              rot_eval = gpsculpt_rotation_eval_get(
-                  &gso->gsc, gps_active, pt_active, gps, pt, i + 1);
+              rot_eval = (!is_multiedit) ? gpsculpt_rotation_eval_get(
+                  &gso->gsc, gps, pt, i + 1) : 0.0f;
               ok |= apply(gso, gps_active, rot_eval, index, radius, pc2);
               include_last = false;
             }
@@ -1680,7 +1680,7 @@ static bool gpsculpt_brush_do_stroke(tGP_BrushEditData *gso,
           pt_active = (!is_multiedit) ? pt->runtime.pt_orig : pt;
           index = (!is_multiedit) ? pt->runtime.idx_orig : i;
           if (pt->runtime.pt_orig != NULL) {
-            rot_eval = gpsculpt_rotation_eval_get(&gso->gsc, gps_active, pt_active, gps, pt, i);
+            rot_eval = (!is_multiedit) ? gpsculpt_rotation_eval_get(&gso->gsc, gps, pt, i) : 0.0f;
             changed |= apply(gso, gps_active, rot_eval, index, radius, pc1);
             include_last = false;
           }



More information about the Bf-blender-cvs mailing list