[Bf-blender-cvs] [41bd45d0802] greasepencil-object: Merge branch 'master' into greasepencil-object

Antonio Vazquez noreply at git.blender.org
Sat May 2 10:50:21 CEST 2020


Commit: 41bd45d08029077312a5b8c9cfe46ba19e5b04c2
Author: Antonio Vazquez
Date:   Sat May 2 10:50:04 2020 +0200
Branches: greasepencil-object
https://developer.blender.org/rB41bd45d08029077312a5b8c9cfe46ba19e5b04c2

Merge branch 'master' into greasepencil-object

 Conflicts:
	source/blender/editors/gpencil/gpencil_paint.c

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



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

diff --cc source/blender/editors/gpencil/gpencil_paint.c
index 030d98d90e2,561104b0b98..81e1f72f9f1
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@@ -3323,8 -3237,8 +3320,9 @@@ static void gpencil_add_arc_points(tGPs
  
    corner[0] = midpoint[0] - (cp1[0] - midpoint[0]);
    corner[1] = midpoint[1] - (cp1[1] - midpoint[1]);
 +  float stepcolor = 1.0f / segments;
  
+   tGPspoint *pt_step = pt_prev;
    for (int i = 0; i < segments; i++) {
      pt = &points[idx_prev + i - 1];
      pt->x = corner[0] + (end[0] - corner[0]) * sinf(a) + (start[0] - corner[0]) * cosf(a);
@@@ -3333,12 -3247,35 +3331,20 @@@
      /* Set pressure and strength equals to previous. It will be smoothed later. */
      pt->pressure = pt_prev->pressure;
      pt->strength = pt_prev->strength;
 +    /* Interpolate vertex color. */
 +    interp_v4_v4v4(
 +        pt->vert_color, pt_before->vert_color, pt_prev->vert_color, stepcolor * (i + 1));
  
+     /* Apply angle of stroke to brush size to interpolated points but slightly attenuated.. */
+     if (brush_settings->draw_angle_factor != 0.0f) {
+       gp_brush_angle_segment(p, pt_step, pt);
+       CLAMP(pt->pressure, pt_prev->pressure * 0.8f, 1.0f);
+       /* Use the previous interpolated point for next segment. */
+       pt_step = pt;
+     }
+ 
 -    /* Apply randomness to pressure. */
 -    if (brush_settings->draw_random_press > 0.0f) {
 -      float rand = BLI_rng_get_float(p->rng) * 2.0f - 1.0f;
 -      pt->pressure *= 1.0 + rand * 2.0 * brush_settings->draw_random_press;
 -      CLAMP(pt->pressure, GPENCIL_STRENGTH_MIN, 1.0f);
 -    }
 -    /* Apply randomness to color strength. */
 -    if (brush_settings->draw_random_strength) {
 -      float rand = BLI_rng_get_float(p->rng) * 2.0f - 1.0f;
 -      pt->strength *= 1.0 + rand * brush_settings->draw_random_strength;
 -      CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f);
 -    }
 -    /* Apply randomness to uv texture rotation. */
 -    if (brush_settings->uv_random > 0.0f) {
 -      float rand = BLI_hash_int_01(BLI_hash_int_2d((int)pt->x, gpd->runtime.sbuffer_used + i)) *
 -                       2.0f -
 -                   1.0f;
 -      pt->uv_rot += rand * M_PI_2 * brush_settings->uv_random;
 -      CLAMP(pt->uv_rot, -M_PI_2, M_PI_2);
 -    }
 +    /* Apply other randomness. */
 +    gp_apply_randomness(p, brush_settings, pt, false, false, true);
  
      a += step;
    }



More information about the Bf-blender-cvs mailing list