[Bf-blender-cvs] [49235428ff8] greasepencil-object: GPencil: Fix changes after merge

Antonio Vazquez noreply at git.blender.org
Sat Aug 24 13:21:27 CEST 2019


Commit: 49235428ff800460b11922a1466991ae4e2d5cfe
Author: Antonio Vazquez
Date:   Sat Aug 24 13:20:20 2019 +0200
Branches: greasepencil-object
https://developer.blender.org/rB49235428ff800460b11922a1466991ae4e2d5cfe

GPencil: Fix changes after merge

Some variables changed and need rename.

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

M	source/blender/editors/gpencil/gpencil_brush.c
M	source/blender/editors/gpencil/gpencil_intern.h
M	source/blender/editors/gpencil/gpencil_select.c

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

diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c
index 1e2903f05fc..17e5b80264f 100644
--- a/source/blender/editors/gpencil/gpencil_brush.c
+++ b/source/blender/editors/gpencil/gpencil_brush.c
@@ -1812,10 +1812,10 @@ static bool gpsculpt_brush_apply_standard(bContext *C, tGP_BrushEditData *gso)
     if (gpl->actframe == NULL) {
       continue;
     }
-    /* Get derived frames array data */
-    int derived_idx = BLI_findindex(&gpd->layers, gpl);
-    bGPDframe *derived_gpf = &ob_eval->runtime.derived_frames[derived_idx];
-    if (derived_gpf == NULL) {
+    /* Get evaluated frames array data */
+    int idx_eval = BLI_findindex(&gpd->layers, gpl);
+    bGPDframe *gpf_eval = &ob_eval->runtime.gpencil_evaluated_frames[idx_eval];
+    if (gpf_eval == NULL) {
       continue;
     }
 
@@ -1849,14 +1849,14 @@ static bool gpsculpt_brush_apply_standard(bContext *C, tGP_BrushEditData *gso)
 
           /* affect strokes in this frame */
           changed |= gpsculpt_brush_do_frame(
-              C, gso, gpl, (gpf == gpl->actframe) ? derived_gpf : gpf, diff_mat);
+              C, gso, gpl, (gpf == gpl->actframe) ? gpf_eval : gpf, diff_mat);
         }
       }
     }
     else {
       /* Apply to active frame's strokes */
       gso->mf_falloff = 1.0f;
-      changed |= gpsculpt_brush_do_frame(C, gso, gpl, derived_gpf, diff_mat);
+      changed |= gpsculpt_brush_do_frame(C, gso, gpl, gpf_eval, diff_mat);
     }
   }
   CTX_DATA_END;
diff --git a/source/blender/editors/gpencil/gpencil_intern.h b/source/blender/editors/gpencil/gpencil_intern.h
index 55b1b1e449d..f7fc7e34460 100644
--- a/source/blender/editors/gpencil/gpencil_intern.h
+++ b/source/blender/editors/gpencil/gpencil_intern.h
@@ -642,7 +642,7 @@ struct GP_EditableStrokes_Iter {
             GP_SCULPT_MASK_SELECTMODE_SEGMENT)))
 
 /**
- * Iterate over all editable strokes using derived data in the current context,
+ * Iterate over all editable strokes using evaluated data in the current context,
  * stopping on each usable layer + stroke pair (i.e. gpl and gps)
  * to perform some operations on the stroke.
  *
@@ -651,7 +651,7 @@ struct GP_EditableStrokes_Iter {
  * \param gps: The identifier to use for current stroke being processed.
  *                    Choose a suitable value to avoid name clashes.
  */
-#define GP_DERIVED_STROKES_BEGIN(gpstroke_iter, C, gpl, gps) \
+#define GP_EVALUATED_STROKES_BEGIN(gpstroke_iter, C, gpl, gps) \
   { \
     struct GP_EditableStrokes_Iter gpstroke_iter = {{{0}}}; \
     Depsgraph *depsgraph_ = CTX_data_ensure_evaluated_depsgraph(C); \
@@ -659,7 +659,7 @@ struct GP_EditableStrokes_Iter {
     Object *obeval_ = DEG_get_evaluated_object(depsgraph_, obact_); \
     bGPdata *gpd_ = CTX_data_gpencil_data(C); \
     const bool is_multiedit_ = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd_); \
-    int derived_idx = 0; \
+    int idx_eval = 0; \
     for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) { \
       if (gpencil_layer_is_editable(gpl)) { \
         bGPDframe *init_gpf_ = gpl->actframe; \
@@ -670,10 +670,10 @@ struct GP_EditableStrokes_Iter {
           if ((gpf_ == gpl->actframe) || ((gpf_->flag & GP_FRAME_SELECT) && is_multiedit_)) { \
             ED_gpencil_parent_location(depsgraph_, obact_, gpd_, gpl, gpstroke_iter.diff_mat); \
             invert_m4_m4(gpstroke_iter.inverse_diff_mat, gpstroke_iter.diff_mat); \
-            /* get derived frame with modifiers applied */ \
-            bGPDframe *derived_gpf_ = &obeval_->runtime.derived_frames[derived_idx]; \
+            /* get evaluated frame with modifiers applied */ \
+            bGPDframe *gpf_eval_ = &obeval_->runtime.gpencil_evaluated_frames[idx_eval]; \
             /* loop over strokes */ \
-            for (bGPDstroke *gps = derived_gpf_->strokes.first; gps; gps = gps->next) { \
+            for (bGPDstroke *gps = gpf_eval_->strokes.first; gps; gps = gps->next) { \
               /* skip strokes that are invalid for current view */ \
               if (ED_gpencil_stroke_can_use(C, gps) == false) \
                 continue; \
@@ -682,7 +682,7 @@ struct GP_EditableStrokes_Iter {
                 continue; \
     /* ... Do Stuff With Strokes ...  */
 
-#define GP_DERIVED_STROKES_END(gpstroke_iter) \
+#define GP_EVALUATED_STROKES_END(gpstroke_iter) \
   } \
   } \
   if (!is_multiedit_) { \
@@ -690,7 +690,7 @@ struct GP_EditableStrokes_Iter {
   } \
   } \
   } \
-  derived_idx++; \
+  idx_eval++; \
   } \
   } \
   (void)0
diff --git a/source/blender/editors/gpencil/gpencil_select.c b/source/blender/editors/gpencil/gpencil_select.c
index 61015c1f7c7..7225bf43fbd 100644
--- a/source/blender/editors/gpencil/gpencil_select.c
+++ b/source/blender/editors/gpencil/gpencil_select.c
@@ -993,12 +993,12 @@ static int gpencil_circle_select_exec(bContext *C, wmOperator *op)
   rect.ymax = my + radius;
 
   /* find visible strokes, and select if hit */
-  GP_DERIVED_STROKES_BEGIN(gpstroke_iter, C, gpl, gps)
+  GP_EVALUATED_STROKES_BEGIN(gpstroke_iter, C, gpl, gps)
   {
     changed |= gp_stroke_do_circle_sel(
         gpl, gps, &gsc, mx, my, radius, select, &rect, gpstroke_iter.diff_mat, selectmode, scale);
   }
-  GP_DERIVED_STROKES_END(gpstroke_iter);
+  GP_EVALUATED_STROKES_END(gpstroke_iter);
 
   /* updates */
   if (changed) {
@@ -1102,7 +1102,7 @@ static int gpencil_generic_select_exec(bContext *C,
   }
 
   /* select/deselect points */
-  GP_DERIVED_STROKES_BEGIN(gpstroke_iter, C, gpl, gps)
+  GP_EVALUATED_STROKES_BEGIN(gpstroke_iter, C, gpl, gps)
   {
 
     bGPDspoint *pt;
@@ -1169,7 +1169,7 @@ static int gpencil_generic_select_exec(bContext *C,
     /* Ensure that stroke selection is in sync with its points */
     BKE_gpencil_stroke_sync_selection(gps->runtime.gps_orig);
   }
-  GP_DERIVED_STROKES_END(gpstroke_iter);
+  GP_EVALUATED_STROKES_END(gpstroke_iter);
 
   /* if paint mode,delete selected points */
   if (gpd->flag & GP_DATA_STROKE_PAINTMODE) {
@@ -1391,7 +1391,7 @@ static int gpencil_select_exec(bContext *C, wmOperator *op)
 
   /* First Pass: Find stroke point which gets hit */
   /* XXX: maybe we should go from the top of the stack down instead... */
-  GP_DERIVED_STROKES_BEGIN(gpstroke_iter, C, gpl, gps)
+  GP_EVALUATED_STROKES_BEGIN(gpstroke_iter, C, gpl, gps)
   {
     bGPDspoint *pt;
     int i;
@@ -1424,7 +1424,7 @@ static int gpencil_select_exec(bContext *C, wmOperator *op)
       }
     }
   }
-  GP_DERIVED_STROKES_END(gpstroke_iter);
+  GP_EVALUATED_STROKES_END(gpstroke_iter);
 
   /* Abort if nothing hit... */
   if (ELEM(NULL, hit_stroke, hit_point)) {



More information about the Bf-blender-cvs mailing list