[Bf-blender-cvs] [aa72aebabe2] greasepencil-edit-curve: Merge branch 'master' into greasepencil-edit-curve

Antonio Vazquez noreply at git.blender.org
Thu Jul 16 08:16:43 CEST 2020


Commit: aa72aebabe2176c5aeee16c22705f6d67cc1c6aa
Author: Antonio Vazquez
Date:   Thu Jul 16 08:16:01 2020 +0200
Branches: greasepencil-edit-curve
https://developer.blender.org/rBaa72aebabe2176c5aeee16c22705f6d67cc1c6aa

Merge branch 'master' into greasepencil-edit-curve

 Conflicts:
	source/blender/blenkernel/intern/gpencil_geom.c

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



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

diff --cc source/blender/blenkernel/intern/gpencil_geom.c
index cb0ffd919b4,5e55d3b2bef..bb057c90ae6
--- a/source/blender/blenkernel/intern/gpencil_geom.c
+++ b/source/blender/blenkernel/intern/gpencil_geom.c
@@@ -2114,8 -2087,8 +2114,9 @@@ static int gpencil_walk_edge(GHash *v_t
  }
  
  static void gpencil_generate_edgeloops(Object *ob,
 +                                       bGPdata *gpd,
                                         bGPDframe *gpf_stroke,
+                                        int stroke_mat_index,
                                         const float angle,
                                         const int thickness,
                                         const float offset,
diff --cc source/blender/editors/transform/transform_convert_gpencil.c
index fb4569e284e,0eb12aeabed..c3b9c14cc4a
--- a/source/blender/editors/transform/transform_convert_gpencil.c
+++ b/source/blender/editors/transform/transform_convert_gpencil.c
@@@ -337,158 -267,94 +337,158 @@@ void createTransGPencil(bContext *C, Tr
                /* save falloff factor */
                gps->runtime.multi_frame_falloff = falloff;
  
 -              /* calculate stroke center */
 -              float center[3];
 -              createTransGPencil_center_get(gps, center);
 -
 -              /* add all necessary points... */
 -              for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
 -                bool point_ok;
 -
 -                /* include point? */
 -                if (is_prop_edit) {
 -                  /* Always all points in strokes that get included. */
 -                  point_ok = true;
 -                }
 -                else {
 -                  /* Only selected points in selected strokes. */
 -                  point_ok = (pt->flag & GP_SPOINT_SELECT) != 0;
 -                }
 +              if (is_curve_edit) {
 +                createTransGPencil_curve_center_get(gpc, center);
  
 -                /* do point... */
 -                if (point_ok) {
 -                  copy_v3_v3(td->iloc, &pt->x);
 -                  /* Only copy center in local origins.
 -                   * This allows get interesting effects also when move
 -                   * using proportional editing. */
 -                  if ((gps->flag & GP_STROKE_SELECT) &&
 -                      (ts->transform_pivot_point == V3D_AROUND_LOCAL_ORIGINS)) {
 -                    copy_v3_v3(td->center, center);
 +                for (int i = 0; i < tot_points; i++) {
 +                  bGPDcurve_point *gpc_pt = &gpc->curve_points[i];
 +                  if (is_prop_edit) {
 +                    point_ok = true;
                    }
                    else {
 -                    copy_v3_v3(td->center, &pt->x);
 +                    point_ok = (gpc_pt->flag & GP_CURVE_POINT_SELECT) != 0;
                    }
  
 -                  td->loc = &pt->x;
 +                  if (point_ok) {
 +                    BezTriple *bezt = &gpc_pt->bezt;
 +                    for (int j = 0; j < 3; j++) {
 +                      td->flag = 0;
 +                      /* always do transform if control point is selected or if proportional
 +                       * editing is enabled. Otherwise only look at selected handles */
 +                      if (bezt->f2 & SELECT || BEZT_ISSEL_IDX(bezt, j) || is_prop_edit) {
 +                        copy_v3_v3(td->iloc, bezt->vec[j]);
 +                        if ((gpc->flag & GP_CURVE_SELECT) &&
 +                            (ts->transform_pivot_point == V3D_AROUND_LOCAL_ORIGINS)) {
 +                          copy_v3_v3(td->center, center);
 +                        }
 +                        else {
 +                          copy_v3_v3(td->center, bezt->vec[j]);
 +                        }
 +
 +                        td->loc = bezt->vec[j];
 +                        td->flag |= TD_SELECTED;
 +
 +                        /* can only change thickness and strength if control point is selected */
 +                        if (j == 1) {
 +                          if (t->mode != TFM_MIRROR) {
 +                            if (t->mode != TFM_GPENCIL_OPACITY) {
 +                              if (is_scale_thickness) {
 +                                td->val = &gpc_pt->pressure;
 +                                td->ival = gpc_pt->pressure;
 +                              }
 +                            }
 +                            else {
 +                              td->val = &gpc_pt->strength;
 +                              td->ival = gpc_pt->strength;
 +                            }
 +                          }
 +                        }
 +
 +                        /* apply parent transformations */
 +                        copy_m3_m4(td->smtx, inverse_diff_mat); /* final position */
 +                        copy_m3_m4(td->mtx, diff_mat);          /* display position */
 +                        copy_m3_m4(td->axismtx, diff_mat);      /* axis orientation */
 +
 +                        /* Save the stroke for recalc geometry function. */
 +                        td->extra = gps;
 +
 +                        /* Save pointer to object. */
 +                        td->ob = obact;
 +
 +                        td++;
 +                        tail++;
 +                      }
 +                    }
 +                  }
 +                }
 +              }
 +              else {
 +                /* calculate stroke center */
 +                createTransGPencil_center_get(gps, center);
  
 -                  td->flag = 0;
 +                for (int i = 0; i < tot_points; i++) {
 +                  bGPDspoint *pt = &gps->points[i];
  
 -                  if (pt->flag & GP_SPOINT_SELECT) {
 -                    td->flag |= TD_SELECTED;
 +                  /* include point? */
 +                  if (is_prop_edit) {
 +                    /* Always all points in strokes that get included. */
 +                    point_ok = true;
 +                  }
 +                  else {
 +                    /* Only selected points in selected strokes. */
 +                    point_ok = (pt->flag & GP_SPOINT_SELECT) != 0;
                    }
  
 -                  /* For other transform modes (e.g. shrink-fatten), need to additional data
 -                   * but never for mirror.
 -                   */
 -                  if (t->mode != TFM_MIRROR) {
 -                    if (t->mode != TFM_GPENCIL_OPACITY) {
 -                      if (is_scale_thickness) {
 -                        td->val = &pt->pressure;
 -                        td->ival = pt->pressure;
 -                      }
 +                  /* do point... */
 +                  if (point_ok) {
 +                    copy_v3_v3(td->iloc, &pt->x);
 +                    /* Only copy center in local origins.
 +                     * This allows get interesting effects also when move
 +                     * using proportional editing. */
 +                    if ((gps->flag & GP_STROKE_SELECT) &&
 +                        (ts->transform_pivot_point == V3D_AROUND_LOCAL_ORIGINS)) {
 +                      copy_v3_v3(td->center, center);
                      }
                      else {
 -                      td->val = &pt->strength;
 -                      td->ival = pt->strength;
 +                      copy_v3_v3(td->center, &pt->x);
                      }
 -                  }
  
 -                  /* screenspace needs special matrices... */
 -                  if ((gps->flag & (GP_STROKE_3DSPACE | GP_STROKE_2DSPACE | GP_STROKE_2DIMAGE)) ==
 -                      0) {
 -                    /* screenspace */
 -                    td->protectflag = OB_LOCK_LOCZ | OB_LOCK_ROTZ | OB_LOCK_SCALEZ;
 -                  }
 -                  else {
 -                    /* configure 2D dataspace points so that they don't play up... */
 -                    if (gps->flag & (GP_STROKE_2DSPACE | GP_STROKE_2DIMAGE)) {
 +                    td->loc = &pt->x;
 +
 +                    td->flag = 0;
 +
 +                    if (pt->flag & GP_SPOINT_SELECT) {
 +                      td->flag |= TD_SELECTED;
 +                    }
 +
 +                    /* For other transform modes (e.g. shrink-fatten), need to additional data
 +                     * but never for mirror.
 +                     */
 +                    if (t->mode != TFM_MIRROR) {
 +                      if (t->mode != TFM_GPENCIL_OPACITY) {
 +                        if (is_scale_thickness) {
 +                          td->val = &pt->pressure;
 +                          td->ival = pt->pressure;
 +                        }
 +                      }
 +                      else {
 +                        td->val = &pt->strength;
 +                        td->ival = pt->strength;
 +                      }
 +                    }
 +#if 0
 +                    /* screenspace needs special matrices... */
 +                    if ((gps->flag & (GP_STROKE_3DSPACE | GP_STROKE_2DSPACE | GP_STROKE_2DIMAGE)) ==
 +                        0) {
 +                      /* screenspace */
                        td->protectflag = OB_LOCK_LOCZ | OB_LOCK_ROTZ | OB_LOCK_SCALEZ;
                      }
 -                  }
 -                  /* apply parent transformations */
 -                  copy_m3_m4(td->smtx, inverse_diff_mat); /* final position */
 -                  copy_m3_m4(td->mtx, diff_mat);          /* display position */
 -                  copy_m3_m4(td->axismtx, diff_mat);      /* axis orientation */
 +                    else {
 +                      /* configure 2D dataspace points so that they don't play up... */
 +                      if (gps->flag & (GP_STROKE_2DSPACE | GP_STROKE_2DIMAGE)) {
 +                        td->protectflag = OB_LOCK_LOCZ | OB_LOCK_ROTZ | OB_LOCK_SCALEZ;
 +                      }
 +                    }
 +#endif
 +                    /* apply parent transformations */
 +                    copy_m3_m4(td->smtx, inverse_diff_mat); /* final position */
 +                    copy_m3_m4(td->mtx, diff_mat);          /* display position */
 +                    copy_m3_m4(td->axismtx, diff_mat);      /* axis orientation */
  
 -                  /* Triangulation must be calculated again

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list