Commit: 680e3c30310fad85824a85217303a8c197ff17e2
Author: Antonio Vazquez
Date:   Tue Jan 14 16:05:51 2020 +0100
Branches: temp-gpencil-eval
https://developer.blender.org/rB680e3c30310fad85824a85217303a8c197ff17e2

Use evaluated data for selecction

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

M       source/blender/editors/gpencil/gpencil_intern.h
M       source/blender/editors/gpencil/gpencil_uv.c

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

diff --git a/source/blender/editors/gpencil/gpencil_intern.h 
b/source/blender/editors/gpencil/gpencil_intern.h
index 86ba23dcabe..cc35b29c0f3 100644
--- a/source/blender/editors/gpencil/gpencil_intern.h
+++ b/source/blender/editors/gpencil/gpencil_intern.h
@@ -672,15 +672,14 @@ struct GP_EditableStrokes_Iter {
  * \param gps: The identifier to use for current stroke being processed.
  *                    Choose a suitable value to avoid name clashes.
  */
-// TODO GPXX
 #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); \
     Object *obact_ = CTX_data_active_object(C); \
-    bGPdata *gpd_ = (bGPdata *)obact_->data; \
-    const bool is_multiedit_ = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd_); \
-    int idx_eval = 0; \
+    Object *ob_eval_ = (Object *)DEG_get_evaluated_id(depsgraph_, 
&obact_->id); \
+    bGPdata *gpd = (bGPdata *)ob_eval_->data; \
+    const bool is_multiedit_ = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd); \
     for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) { \
       if (gpencil_layer_is_editable(gpl)) { \
         bGPDframe *init_gpf_ = gpl->actframe; \
@@ -689,7 +688,7 @@ struct GP_EditableStrokes_Iter {
         } \
         for (bGPDframe *gpf_ = init_gpf_; gpf_; gpf_ = gpf_->next) { \
           if ((gpf_ == gpl->actframe) || ((gpf_->flag & GP_FRAME_SELECT) && 
is_multiedit_)) { \
-            ED_gpencil_parent_location(depsgraph_, obact_, gpd_, gpl, 
gpstroke_iter.diff_mat); \
+            ED_gpencil_parent_location(depsgraph_, obact_, gpd, gpl, 
gpstroke_iter.diff_mat); \
             invert_m4_m4(gpstroke_iter.inverse_diff_mat, 
gpstroke_iter.diff_mat); \
             /* loop over strokes */ \
             for (bGPDstroke *gps = gpf_->strokes.first; gps; gps = gps->next) 
{ \
@@ -709,7 +708,6 @@ struct GP_EditableStrokes_Iter {
   } \
   } \
   } \
-  idx_eval++; \
   } \
   } \
   (void)0
diff --git a/source/blender/editors/gpencil/gpencil_uv.c 
b/source/blender/editors/gpencil/gpencil_uv.c
index 986624fab34..7137b616f67 100644
--- a/source/blender/editors/gpencil/gpencil_uv.c
+++ b/source/blender/editors/gpencil/gpencil_uv.c
@@ -171,7 +171,6 @@ static bool gpencil_uv_transform_init(bContext *C, 
wmOperator *op, const bool is
   }
 
   /* Calc selected strokes center. */
-  bGPdata *gpd = opdata->gpd;
   zero_v2(opdata->mcenter);
   float center[3] = {0.0f};
   int i = 0;

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to