[Bf-blender-cvs] [b720c0f6aa6] master: Fix T71436: proportional_edit_objects turns off when translating cursor in edit mode

2019-11-09 Thread mano-wii
Commit: b720c0f6aa688e42ceb136b90d40ec9b5c60a050
Author: mano-wii
Date:   Sat Nov 9 16:12:27 2019 -0300
Branches: master
https://developer.blender.org/rBb720c0f6aa688e42ceb136b90d40ec9b5c60a050

Fix T71436: proportional_edit_objects turns off when translating cursor in edit 
mode

===

M   source/blender/editors/transform/transform.c
M   source/blender/editors/transform/transform_convert.c
M   source/blender/editors/transform/transform_generics.c

===

diff --git a/source/blender/editors/transform/transform.c 
b/source/blender/editors/transform/transform.c
index dd43e487d92..20b72334695 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -2133,7 +2133,7 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator 
*op)
 else if (t->options & CTX_MASK) {
   ts->proportional_mask = proportional != 0;
 }
-else {
+else if ((t->options & CTX_CURSOR) == 0) {
   ts->proportional_objects = proportional != 0;
 }
   }
diff --git a/source/blender/editors/transform/transform_convert.c 
b/source/blender/editors/transform/transform_convert.c
index c17a726576a..0c49d67f7a2 100644
--- a/source/blender/editors/transform/transform_convert.c
+++ b/source/blender/editors/transform/transform_convert.c
@@ -2391,7 +2391,6 @@ void createTransData(bContext *C, TransInfo *t)
   /* if tests must match recalcData for correct updates */
   if (t->options & CTX_CURSOR) {
 t->flag |= T_CURSOR;
-t->obedit_type = -1;
 
 if (t->spacetype == SPACE_IMAGE) {
   createTransCursor_image(t);
@@ -2407,7 +2406,6 @@ void createTransData(bContext *C, TransInfo *t)
   }
   else if (t->options & CTX_TEXTURE) {
 t->flag |= T_TEXTURE;
-t->obedit_type = -1;
 
 createTransTexspace(t);
 countAndCleanTransDataContainer(t);
diff --git a/source/blender/editors/transform/transform_generics.c 
b/source/blender/editors/transform/transform_generics.c
index afaca361372..0df0b70a56a 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -1416,8 +1416,8 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator 
*op, const wmEvent *eve
 {
   Scene *sce = CTX_data_scene(C);
   ViewLayer *view_layer = CTX_data_view_layer(C);
-  const eObjectMode object_mode = OBACT(view_layer) ? OBACT(view_layer)->mode 
: OB_MODE_OBJECT;
-  const short object_type = OBACT(view_layer) ? OBACT(view_layer)->type : -1;
+  Object *obact = OBACT(view_layer);
+  const eObjectMode object_mode = obact ? obact->mode : OB_MODE_OBJECT;
   ToolSettings *ts = CTX_data_tool_settings(C);
   ARegion *ar = CTX_wm_region(C);
   ScrArea *sa = CTX_wm_area(C);
@@ -1437,9 +1437,13 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator 
*op, const wmEvent *eve
 
   t->flag = 0;
 
-  t->obedit_type = ((object_mode == OB_MODE_EDIT) || (object_mode == 
OB_MODE_EDIT_GPENCIL)) ?
-   object_type :
-   -1;
+  if (obact && !(t->options & (CTX_CURSOR | CTX_TEXTURE)) &&
+  ELEM(object_mode, OB_MODE_EDIT, OB_MODE_EDIT_GPENCIL)) {
+t->obedit_type = obact->type;
+  }
+  else {
+t->obedit_type = -1;
+  }
 
   /* Many kinds of transform only use a single handle. */
   if (t->data_container == NULL) {
@@ -1776,7 +1780,7 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator 
*op, const wmEvent *eve
   }
 }
   }
-  else if ((t->obedit_type == -1) && ts->proportional_objects) {
+  else if (!(t->options & CTX_CURSOR) && ts->proportional_objects) {
 t->flag |= T_PROP_EDIT;
   }
 }

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


[Bf-blender-cvs] [8da22e5293c] greasepencil-object: GPencil: New Blur Tool for Vertex Paint

2019-11-09 Thread Antonio Vazquez
Commit: 8da22e5293c8b860fa65577e93ca37caee166fbc
Author: Antonio Vazquez
Date:   Sat Nov 9 17:45:49 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB8da22e5293c8b860fa65577e93ca37caee166fbc

GPencil: New Blur Tool for Vertex Paint

===

M   release/scripts/presets/keyconfig/keymap_data/blender_default.py
M   
release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
M   release/scripts/startup/bl_ui/properties_paint_common.py
M   release/scripts/startup/bl_ui/space_view3d.py
M   release/scripts/startup/bl_ui/space_view3d_toolbar.py
M   source/blender/editors/gpencil/gpencil_vertex_paint.c

===

diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py 
b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index c84d43c41ba..c4a82b80830 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -3413,8 +3413,6 @@ def km_grease_pencil_stroke_vertex_blur(params):
 # Tint
 ("gpencil.vertex_paint", {"type": 'LEFTMOUSE', "value": 'PRESS'},
  {"properties": [("wait_for_input", False)]}),
-("gpencil.vertex_paint", {"type": 'LEFTMOUSE', "value": 'PRESS', 
"ctrl": True},
- {"properties": [("wait_for_input", False)]}),
 # Brush strength
 ("wm.radial_control", {"type": 'F', "value": 'PRESS', "shift": True},
  {"properties": [("data_path_primary", 
'tool_settings.gpencil_vertex_paint.brush.gpencil_settings.pen_strength')]}),
diff --git 
a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py 
b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
index b9b3d6a6515..99d66729cad 100644
--- a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
+++ b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
@@ -2608,8 +2608,6 @@ def km_grease_pencil_stroke_vertex_blur(params):
 # Tint
 ("gpencil.vertex_paint", {"type": 'LEFTMOUSE', "value": 'PRESS'},
  {"properties": [("wait_for_input", False)]}),
-("gpencil.vertex_paint", {"type": 'LEFTMOUSE', "value": 'PRESS', 
"ctrl": True},
- {"properties": [("wait_for_input", False)]}),
 # Brush strength
 ("wm.radial_control", {"type": 'F', "value": 'PRESS', "shift": True},
  {"properties": [("data_path_primary", 
'tool_settings.gpencil_vertex_paint.brush.gpencil_settings.pen_strength')]}),
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py 
b/release/scripts/startup/bl_ui/properties_paint_common.py
index 3d81662affe..e7b4a1c520a 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -505,7 +505,7 @@ def brush_basic_gpencil_vertex_settings(layout, _context, 
brush, tool, *, compac
 row.prop(brush, "size", text="Radius")
 row.prop(gp_settings, "use_pressure", text="", icon='STYLUS_PRESSURE')
 
-if brush.gpencil_vertex_tool == 'DRAW':
+if brush.gpencil_vertex_tool in ('DRAW', 'BLUR'):
 row = layout.row(align=True)
 row.prop(gp_settings, "pen_strength", slider=True)
 row.prop(gp_settings, "use_strength_pressure", text="", 
icon='STYLUS_PRESSURE')
diff --git a/release/scripts/startup/bl_ui/space_view3d.py 
b/release/scripts/startup/bl_ui/space_view3d.py
index bb9c6ed3c9e..188a07feebb 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -432,7 +432,7 @@ class _draw_tool_settings_context_mode:
 settings = tool_settings.gpencil_vertex_paint
 row.template_ID_preview(settings, "brush", rows=3, cols=8, 
hide_buttons=True)
 
-if brush.gpencil_vertex_tool != 'AVERAGE':
+if brush.gpencil_vertex_tool not in ('BLUR', 'AVERAGE'):
 row.separator(factor=0.4)
 row.prop(brush, "color", text="")
 
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py 
b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 262649e695f..395877e369b 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -2290,7 +2290,7 @@ class 
VIEW3D_PT_tools_grease_pencil_brush_vertex(View3DPanel, Panel):
 if ob is None or brush is None:
 return False
 
-if context.region.type == 'TOOL_HEADER' or brush.gpencil_vertex_tool 
== 'AVERAGE':
+if context.region.type == 'TOOL_HEADER' or brush.gpencil_vertex_tool 
in ('BLUR', 'AVERAGE'):
 return False
 
 return True
@@ -2370,7 +2370,7 @@ class 
VIEW3D_PT_tools_grease_pencil_brush_vertex_palette(View3DPanel, Panel):
 if ob is None or brush is None:
 

[Bf-blender-cvs] [e603f05b695] greasepencil-object: GPencil: Add curve falloff for Vertex Paint brushes

2019-11-09 Thread Antonio Vazquez
Commit: e603f05b6959fd69f99642851ebbf7d44cf264e9
Author: Antonio Vazquez
Date:   Sat Nov 9 16:15:06 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rBe603f05b6959fd69f99642851ebbf7d44cf264e9

GPencil: Add curve falloff for Vertex Paint brushes

===

M   release/scripts/startup/bl_ui/space_view3d_toolbar.py
M   source/blender/editors/gpencil/gpencil_vertex_paint.c

===

diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py 
b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index fc49be8a82d..262649e695f 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -2318,6 +2318,41 @@ class 
VIEW3D_PT_tools_grease_pencil_brush_vertex(View3DPanel, Panel):
 sub_row.operator("gpencil.tint_flip", icon='FILE_REFRESH', text="")
 
 
+class VIEW3D_PT_tools_grease_pencil_brush_vertex_falloff(Panel, 
View3DPaintPanel):
+bl_context = ".greasepencil_vertex"
+bl_label = "Falloff"
+bl_options = {'DEFAULT_CLOSED'}
+
+@classmethod
+def poll(cls, context):
+ts = context.tool_settings
+settings = ts.gpencil_vertex_paint
+brush = settings.brush
+return (settings and settings.brush and settings.brush.curve)
+
+def draw(self, context):
+layout = self.layout
+ts = context.tool_settings
+settings = ts.gpencil_vertex_paint
+brush = settings.brush
+
+col = layout.column(align=True)
+row = col.row(align=True)
+row.prop(brush, "curve_preset", text="")
+
+if brush.curve_preset == 'CUSTOM':
+layout.template_curve_mapping(brush, "curve", brush=True)
+
+col = layout.column(align=True)
+row = col.row(align=True)
+row.operator("brush.curve_preset", icon='SMOOTHCURVE', 
text="").shape = 'SMOOTH'
+row.operator("brush.curve_preset", icon='SPHERECURVE', 
text="").shape = 'ROUND'
+row.operator("brush.curve_preset", icon='ROOTCURVE', 
text="").shape = 'ROOT'
+row.operator("brush.curve_preset", icon='SHARPCURVE', 
text="").shape = 'SHARP'
+row.operator("brush.curve_preset", icon='LINCURVE', text="").shape 
= 'LINE'
+row.operator("brush.curve_preset", icon='NOCURVE', text="").shape 
= 'MAX'
+
+
 class VIEW3D_PT_tools_grease_pencil_brush_vertex_palette(View3DPanel, Panel):
 bl_context = ".greasepencil_vertex"
 bl_label = "Color Palette"
@@ -2554,6 +2589,7 @@ classes = (
 VIEW3D_PT_tools_grease_pencil_vertex_brush,
 VIEW3D_PT_tools_grease_pencil_brush_vertex,
 VIEW3D_PT_tools_grease_pencil_brush_vertex_palette,
+VIEW3D_PT_tools_grease_pencil_brush_vertex_falloff,
 )
 
 if __name__ == "__main__":  # only for live edit.
diff --git a/source/blender/editors/gpencil/gpencil_vertex_paint.c 
b/source/blender/editors/gpencil/gpencil_vertex_paint.c
index 12bce027587..d0b57cbced9 100644
--- a/source/blender/editors/gpencil/gpencil_vertex_paint.c
+++ b/source/blender/editors/gpencil/gpencil_vertex_paint.c
@@ -208,6 +208,11 @@ static float brush_influence_calc(tGP_BrushVertexpaintData 
*gso, const int radiu
 
   influence *= fac;
 
+  /* Apply Brush curve. */
+  if (brush->curve) {
+float brush_fallof = BKE_curvemapping_evaluateF(brush->curve, 0, fac);
+influence *= brush_fallof;
+  }
   /* apply multiframe falloff */
   influence *= gso->mf_falloff;
 
@@ -391,6 +396,7 @@ static bool gp_vertexpaint_brush_init(bContext *C, 
wmOperator *op)
   op->customdata = gso;
 
   gso->brush = paint->brush;
+  BKE_curvemapping_initialize(gso->brush->curve);
 
   gso->is_painting = false;
   gso->first = true;

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


[Bf-blender-cvs] [d13ed6391c2] greasepencil-object: GPencil: Cleanup comment

2019-11-09 Thread Antonio Vazquez
Commit: d13ed6391c2d81ebea9303e3dc8b4d41bc4e166b
Author: Antonio Vazquez
Date:   Sat Nov 9 13:49:46 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rBd13ed6391c2d81ebea9303e3dc8b4d41bc4e166b

GPencil: Cleanup comment

===

M   source/blender/editors/gpencil/gpencil_vertex_paint.c

===

diff --git a/source/blender/editors/gpencil/gpencil_vertex_paint.c 
b/source/blender/editors/gpencil/gpencil_vertex_paint.c
index 805aeb59933..12bce027587 100644
--- a/source/blender/editors/gpencil/gpencil_vertex_paint.c
+++ b/source/blender/editors/gpencil/gpencil_vertex_paint.c
@@ -598,7 +598,7 @@ static void 
gp_vertexpaint_select_stroke(tGP_BrushVertexpaintData *gso,
   }
 }
 
-/* Apply sculpt brushes to strokes in the given frame. */
+/* Apply vertex paint brushes to strokes in the given frame. */
 static bool gp_vertexpaint_brush_do_frame(bContext *C,
   tGP_BrushVertexpaintData *gso,
   bGPDlayer *gpl,

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


[Bf-blender-cvs] [ea330229835] greasepencil-object: GPencil: New Vertex Paint Average Brush

2019-11-09 Thread Antonio Vazquez
Commit: ea3302298358b2bd0e1b4764c9b7572981aaeea8
Author: Antonio Vazquez
Date:   Sat Nov 9 13:45:41 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rBea3302298358b2bd0e1b4764c9b7572981aaeea8

GPencil: New Vertex Paint Average Brush

This brush tint the points with the average of the colors below the cursor.

===

M   release/scripts/startup/bl_ui/space_view3d.py
M   release/scripts/startup/bl_ui/space_view3d_toolbar.py
M   source/blender/editors/gpencil/gpencil_vertex_paint.c

===

diff --git a/release/scripts/startup/bl_ui/space_view3d.py 
b/release/scripts/startup/bl_ui/space_view3d.py
index ef810cca0b3..bb9c6ed3c9e 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -432,12 +432,14 @@ class _draw_tool_settings_context_mode:
 settings = tool_settings.gpencil_vertex_paint
 row.template_ID_preview(settings, "brush", rows=3, cols=8, 
hide_buttons=True)
 
-row.separator(factor=0.4)
-row.prop(brush, "color", text="")
-row.popover(
-panel="TOPBAR_PT_gpencil_vertexcolor",
-text="Vertex Color",
-)
+if brush.gpencil_vertex_tool != 'AVERAGE':
+row.separator(factor=0.4)
+row.prop(brush, "color", text="")
+
+row.popover(
+panel="TOPBAR_PT_gpencil_vertexcolor",
+text="Vertex Color",
+)
 
 from bl_ui.properties_paint_common import (
 brush_basic_gpencil_vertex_settings,
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py 
b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index fc4ad59feee..fc49be8a82d 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -2289,8 +2289,8 @@ class 
VIEW3D_PT_tools_grease_pencil_brush_vertex(View3DPanel, Panel):
 
 if ob is None or brush is None:
 return False
-
-if context.region.type == 'TOOL_HEADER':
+
+if context.region.type == 'TOOL_HEADER' or brush.gpencil_vertex_tool 
== 'AVERAGE':
 return False
 
 return True
@@ -2334,7 +2334,10 @@ class 
VIEW3D_PT_tools_grease_pencil_brush_vertex_palette(View3DPanel, Panel):
 
 if ob is None or brush is None:
 return False
-
+
+if brush.gpencil_vertex_tool == 'AVERAGE':
+return False
+
 return True
 
 def draw(self, context):
diff --git a/source/blender/editors/gpencil/gpencil_vertex_paint.c 
b/source/blender/editors/gpencil/gpencil_vertex_paint.c
index 137749b682a..805aeb59933 100644
--- a/source/blender/editors/gpencil/gpencil_vertex_paint.c
+++ b/source/blender/editors/gpencil/gpencil_vertex_paint.c
@@ -313,6 +313,54 @@ static bool brush_replace_apply(tGP_BrushVertexpaintData 
*gso,
   return true;
 }
 
+/* Average Brush */
+static bool brush_average_apply(tGP_BrushVertexpaintData *gso,
+bGPDstroke *gps,
+int pt_index,
+const int radius,
+const int co[2],
+float average_color[3])
+{
+  Brush *brush = gso->brush;
+  float final_color[3];
+  copy_v3_v3(final_color, average_color);
+
+  /* Attenuate factor to get a smoother tinting. */
+  float inf = (brush_influence_calc(gso, radius, co) * 
brush->gpencil_settings->draw_strength) /
+  100.0f;
+  float inf_fill = (gso->pressure * brush->gpencil_settings->draw_strength) / 
1000.0f;
+
+  bGPDspoint *pt = >points[pt_index];
+
+  float alpha = pt->mix_color[3];
+  float alpha_fill = gps->mix_color_fill[3];
+
+  if (brush_invert_check(gso)) {
+alpha -= inf;
+alpha_fill -= inf_fill;
+  }
+  else {
+alpha += inf;
+alpha_fill += inf_fill;
+  }
+
+  /* Apply color to Stroke point. */
+  if (GPENCIL_TINT_VERTEX_COLOR_STROKE(brush)) {
+CLAMP(alpha, 0.0f, 1.0f);
+interp_v3_v3v3(pt->mix_color, pt->mix_color, final_color, inf);
+pt->mix_color[3] = alpha;
+  }
+
+  /* Apply color to Fill area (all with same color and factor). */
+  if (GPENCIL_TINT_VERTEX_COLOR_FILL(brush)) {
+CLAMP(alpha_fill, 0.0f, 1.0f);
+copy_v3_v3(gps->mix_color_fill, final_color);
+gps->mix_color_fill[3] = alpha_fill;
+  }
+
+  return true;
+}
+
 /*  */
 /* Header Info */
 static void gp_vertexpaint_brush_header_set(bContext *C, 
tGP_BrushVertexpaintData *UNUSED(gso))
@@ -563,6 +611,8 @@ static bool gp_vertexpaint_brush_do_frame(bContext *C,
   const int radius = (gso->brush->flag & GP_BRUSH_USE_PRESSURE) ?
  gso->brush->size * gso->pressure :
  gso->brush->size;
+  tGP_selected *selected = NULL;
+  int 

[Bf-blender-cvs] [521358428da] greasepencil-object: GPencil: Attenuate translate effect in Transform UV operator

2019-11-09 Thread Antonio Vazquez
Commit: 521358428da293684f5dfc14020dbea9139abb39
Author: Antonio Vazquez
Date:   Sat Nov 9 12:28:26 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB521358428da293684f5dfc14020dbea9139abb39

GPencil: Attenuate translate effect in Transform UV operator

The old attenuate value makes the transform too hard.

===

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

===

diff --git a/source/blender/editors/gpencil/gpencil_uv.c 
b/source/blender/editors/gpencil/gpencil_uv.c
index fb97d6afb48..18a3216d979 100644
--- a/source/blender/editors/gpencil/gpencil_uv.c
+++ b/source/blender/editors/gpencil/gpencil_uv.c
@@ -60,7 +60,6 @@ typedef struct GpUvData {
   float initial_length;
   float pixel_size; /* use when mouse input is interpreted as spatial distance 
*/
   bool is_modal;
-  bool is_shift;
 
   /* Arrays of original loc/rot/scale by stroke. */
   float (*array_loc)[2];
@@ -160,7 +159,6 @@ static bool gpencil_uv_transform_init(bContext *C, 
wmOperator *op, const bool is
   opdata->array_rot = NULL;
   opdata->array_scale = NULL;
   opdata->ob_scale = mat4_to_scale(opdata->ob->obmat);
-  opdata->is_shift = false;
 
   opdata->vinit_rotation[0] = 1.0f;
   opdata->vinit_rotation[1] = 0.0f;
@@ -267,9 +265,8 @@ static bool gpencil_uv_transform_calc(bContext *C, 
wmOperator *op)
 
   float uv_rotation = (opdata->is_modal) ? 
angle_signed_v2v2(opdata->vinit_rotation, vr) :
RNA_float_get(op->ptr, "rotation");
-  if (opdata->is_shift) {
-uv_rotation *= SMOOTH_FACTOR;
-  }
+  uv_rotation *= SMOOTH_FACTOR;
+
   if (opdata->is_modal) {
 RNA_float_set(op->ptr, "rotation", uv_rotation);
   }
@@ -281,9 +278,9 @@ static bool gpencil_uv_transform_calc(bContext *C, 
wmOperator *op)
 float mdiff[2];
 mdiff[0] = opdata->mcenter[0] - opdata->mouse[0];
 mdiff[1] = opdata->mcenter[1] - opdata->mouse[1];
-if (opdata->is_shift) {
-  mul_v2_fl(mdiff, SMOOTH_FACTOR);
-}
+
+/* Apply a big amount of smooth always for translate to get smooth result. 
*/
+mul_v2_fl(mdiff, 0.006f);
 
 /* Apply angle in translation. */
 mdiff[0] *= cos(uv_rotation);
@@ -332,9 +329,8 @@ static bool gpencil_uv_transform_calc(bContext *C, 
wmOperator *op)
   ((len_v2(mdiff) - opdata->initial_length) * 
opdata->pixel_size) /
   opdata->ob_scale :
   RNA_float_get(op->ptr, "scale");
-if (opdata->is_shift) {
-  scale *= SMOOTH_FACTOR;
-}
+scale *= SMOOTH_FACTOR;
+
 if (opdata->is_modal) {
   RNA_float_set(op->ptr, "scale", scale);
 }
@@ -411,7 +407,6 @@ static int gpencil_uv_transform_invoke(bContext *C, 
wmOperator *op, const wmEven
   /* initialize mouse values */
   opdata->mouse[0] = event->mval[0];
   opdata->mouse[1] = event->mval[1];
-  opdata->is_shift = event->shift;
 
   copy_v3_v3(center_3d, opdata->ob->loc);
   mlen[0] = opdata->mcenter[0] - event->mval[0];
@@ -447,7 +442,6 @@ static int gpencil_uv_transform_modal(bContext *C, 
wmOperator *op, const wmEvent
 case MOUSEMOVE: {
   opdata->mouse[0] = event->mval[0];
   opdata->mouse[1] = event->mval[1];
-  opdata->is_shift = event->shift;
 
   if (gpencil_uv_transform_calc(C, op)) {
 gpencil_uv_transform_update_header(op, C);

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


[Bf-blender-cvs] [2ab1485cb57] greasepencil-object: GPencil: New Select by Color operator

2019-11-09 Thread Antonio Vazquez
Commit: 2ab1485cb5739dc1b69d569643725d0f9230bcc3
Author: Antonio Vazquez
Date:   Sat Nov 9 11:53:12 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB2ab1485cb5739dc1b69d569643725d0f9230bcc3

GPencil: New Select by Color operator

===

M   release/scripts/startup/bl_ui/properties_paint_common.py
M   release/scripts/startup/bl_ui/space_view3d.py
M   source/blender/editors/gpencil/gpencil_intern.h
M   source/blender/editors/gpencil/gpencil_ops.c
M   source/blender/editors/gpencil/gpencil_select.c

===

diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py 
b/release/scripts/startup/bl_ui/properties_paint_common.py
index b7ea36717ac..3d81662affe 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -501,15 +501,15 @@ def brush_basic_gpencil_vertex_settings(layout, _context, 
brush, tool, *, compac
 gp_settings = brush.gpencil_settings
 
 # Brush details
+row = layout.row(align=True)
+row.prop(brush, "size", text="Radius")
+row.prop(gp_settings, "use_pressure", text="", icon='STYLUS_PRESSURE')
+
 if brush.gpencil_vertex_tool == 'DRAW':
-row = layout.row(align=True)
-row.prop(brush, "size", text="Radius")
-row.prop(gp_settings, "use_pressure", text="", icon='STYLUS_PRESSURE')
 row = layout.row(align=True)
 row.prop(gp_settings, "pen_strength", slider=True)
 row.prop(gp_settings, "use_strength_pressure", text="", 
icon='STYLUS_PRESSURE')
 
-
 classes = (
 VIEW3D_MT_tools_projectpaint_clone,
 )
diff --git a/release/scripts/startup/bl_ui/space_view3d.py 
b/release/scripts/startup/bl_ui/space_view3d.py
index 346bce38bf2..ef810cca0b3 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -833,6 +833,8 @@ class VIEW3D_MT_editor_menus(Menu):
 layout.menu("VIEW3D_MT_edit_gpencil_point")
 elif obj and obj.mode == 'WEIGHT_GPENCIL':
 layout.menu("VIEW3D_MT_weight_gpencil")
+elif obj and obj.mode == 'VERTEX_GPENCIL':
+layout.menu("VIEW3D_MT_vertex_gpencil")
 
 elif edit_object:
 layout.menu("VIEW3D_MT_edit_%s" % edit_object.type.lower())
@@ -4715,6 +4717,15 @@ class VIEW3D_MT_weight_gpencil(Menu):
 layout.menu("VIEW3D_MT_gpencil_autoweights")
 
 
+class VIEW3D_MT_vertex_gpencil(Menu):
+bl_label = "Vertex Paint"
+
+def draw(self, _context):
+layout = self.layout
+
+layout.operator("gpencil.select_color", text="Select Color")
+
+
 class VIEW3D_MT_gpencil_animation(Menu):
 bl_label = "Animation"
 
@@ -6923,6 +6934,7 @@ classes = (
 VIEW3D_MT_edit_gpencil_delete,
 VIEW3D_MT_edit_gpencil_showhide,
 VIEW3D_MT_weight_gpencil,
+VIEW3D_MT_vertex_gpencil,
 VIEW3D_MT_gpencil_animation,
 VIEW3D_MT_gpencil_simplify,
 VIEW3D_MT_gpencil_copy_layer,
diff --git a/source/blender/editors/gpencil/gpencil_intern.h 
b/source/blender/editors/gpencil/gpencil_intern.h
index c63ff173261..e7efe1998fa 100644
--- a/source/blender/editors/gpencil/gpencil_intern.h
+++ b/source/blender/editors/gpencil/gpencil_intern.h
@@ -406,6 +406,7 @@ void GPENCIL_OT_select_less(struct wmOperatorType *ot);
 void GPENCIL_OT_select_first(struct wmOperatorType *ot);
 void GPENCIL_OT_select_last(struct wmOperatorType *ot);
 void GPENCIL_OT_select_alternate(struct wmOperatorType *ot);
+void GPENCIL_OT_select_color(struct wmOperatorType *ot);
 
 void GPENCIL_OT_duplicate(struct wmOperatorType *ot);
 void GPENCIL_OT_delete(struct wmOperatorType *ot);
diff --git a/source/blender/editors/gpencil/gpencil_ops.c 
b/source/blender/editors/gpencil/gpencil_ops.c
index f5b530161e6..b0e348be277 100644
--- a/source/blender/editors/gpencil/gpencil_ops.c
+++ b/source/blender/editors/gpencil/gpencil_ops.c
@@ -376,6 +376,7 @@ void ED_operatortypes_gpencil(void)
   WM_operatortype_append(GPENCIL_OT_select_first);
   WM_operatortype_append(GPENCIL_OT_select_last);
   WM_operatortype_append(GPENCIL_OT_select_alternate);
+  WM_operatortype_append(GPENCIL_OT_select_color);
 
   WM_operatortype_append(GPENCIL_OT_duplicate);
   WM_operatortype_append(GPENCIL_OT_delete);
diff --git a/source/blender/editors/gpencil/gpencil_select.c 
b/source/blender/editors/gpencil/gpencil_select.c
index f38961db07b..9800869ba53 100644
--- a/source/blender/editors/gpencil/gpencil_select.c
+++ b/source/blender/editors/gpencil/gpencil_select.c
@@ -1655,4 +1655,99 @@ void GPENCIL_OT_select(wmOperatorType *ot)
   RNA_def_property_flag(prop, PROP_HIDDEN);
 }
 
+/* Select by Vertex Color. */
+static bool gpencil_select_color_poll(bContext *C)
+{
+  ToolSettings *ts = CTX_data_tool_settings(C);
+  Object *ob = CTX_data_active_object(C);
+  if ((ob == NULL) || (ob->type != 

[Bf-blender-cvs] [9c816eec266] greasepencil-object: GPencil: Initialize Brush only if the brush is new

2019-11-09 Thread Antonio Vazquez
Commit: 9c816eec2662f749f97bd6801a8fc8d8b3bd808a
Author: Antonio Vazquez
Date:   Sat Nov 9 12:09:42 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB9c816eec2662f749f97bd6801a8fc8d8b3bd808a

GPencil: Initialize Brush only if the brush is new

===

M   source/blender/blenkernel/intern/brush.c

===

diff --git a/source/blender/blenkernel/intern/brush.c 
b/source/blender/blenkernel/intern/brush.c
index 881e70d60ad..3f5a9bbd411 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -241,29 +241,29 @@ static void brush_gpencil_curvemap_reset(CurveMap *cuma, 
int tot, int preset)
   }
 }
 
-static Brush *gpencil_brush_ensure(Main *bmain,
-   ToolSettings *ts,
-   char *brush_name,
-   eObjectMode mode)
+static Brush *gpencil_brush_ensure(
+Main *bmain, ToolSettings *ts, char *brush_name, eObjectMode mode, bool 
*new)
 {
+  *new = false;
   Brush *brush = BLI_findstring(>brushes, brush_name, offsetof(ID, 
name) + 2);
   if (brush == NULL) {
 brush = BKE_brush_add_gpencil(bmain, ts, brush_name, mode);
+*new = true;
+
+/* Set default at brush level. */
+brush->rgb[0] = 0.498f;
+brush->rgb[1] = 1.0f;
+brush->rgb[2] = 0.498f;
+
+brush->secondary_rgb[0] = 1.0f;
+brush->secondary_rgb[1] = 1.0f;
+brush->secondary_rgb[2] = 1.0f;
   }
 
   if (brush->gpencil_settings == NULL) {
 BKE_brush_init_gpencil_settings(brush);
   }
 
-  /* Set default at brush level. */
-  brush->rgb[0] = 0.498f;
-  brush->rgb[1] = 1.0f;
-  brush->rgb[2] = 0.498f;
-
-  brush->secondary_rgb[0] = 1.0f;
-  brush->secondary_rgb[1] = 1.0f;
-  brush->secondary_rgb[2] = 1.0f;
-
   /* Set vertex mix factor. */
   if (brush->gpencil_settings) {
 brush->gpencil_settings->vertex_mode = GPPAINT_MODE_STROKE;
@@ -285,9 +285,9 @@ void BKE_brush_gpencil_presets(Main *bmain, ToolSettings 
*ts)
 
   Brush *brush, *deft_draw, *deft_vertex;
   CurveMapping *custom_curve;
-
+  bool new_brush = false;
   /* Airbrush brush. */
-  brush = gpencil_brush_ensure(bmain, ts, "Airbrush", OB_MODE_PAINT_GPENCIL);
+  brush = gpencil_brush_ensure(bmain, ts, "Airbrush", OB_MODE_PAINT_GPENCIL, 
_brush);
 
   brush->size = 300.0f;
   brush->gpencil_settings->flag |= (GP_BRUSH_USE_PRESSURE | 
GP_BRUSH_ENABLE_CURSOR);
@@ -321,7 +321,7 @@ void BKE_brush_gpencil_presets(Main *bmain, ToolSettings 
*ts)
   brush->gpencil_settings->flag |= GP_BRUSH_MATERIAL_PINNED;
 
   /* Ink Pen brush. */
-  brush = gpencil_brush_ensure(bmain, ts, "Ink Pen", OB_MODE_PAINT_GPENCIL);
+  brush = gpencil_brush_ensure(bmain, ts, "Ink Pen", OB_MODE_PAINT_GPENCIL, 
_brush);
 
   brush->size = 60.0f;
   brush->gpencil_settings->flag |= (GP_BRUSH_USE_PRESSURE | 
GP_BRUSH_ENABLE_CURSOR);
@@ -359,7 +359,7 @@ void BKE_brush_gpencil_presets(Main *bmain, ToolSettings 
*ts)
   brush->smooth_stroke_factor = SMOOTH_STROKE_FACTOR;
 
   /* Ink Pen Rough brush. */
-  brush = gpencil_brush_ensure(bmain, ts, "Ink Pen Rough", 
OB_MODE_PAINT_GPENCIL);
+  brush = gpencil_brush_ensure(bmain, ts, "Ink Pen Rough", 
OB_MODE_PAINT_GPENCIL, _brush);
 
   brush->size = 60.0f;
   brush->gpencil_settings->flag |= (GP_BRUSH_USE_PRESSURE | 
GP_BRUSH_ENABLE_CURSOR);
@@ -399,7 +399,7 @@ void BKE_brush_gpencil_presets(Main *bmain, ToolSettings 
*ts)
   brush->smooth_stroke_factor = SMOOTH_STROKE_FACTOR;
 
   /* Marker Bold brush. */
-  brush = gpencil_brush_ensure(bmain, ts, "Marker Bold", 
OB_MODE_PAINT_GPENCIL);
+  brush = gpencil_brush_ensure(bmain, ts, "Marker Bold", 
OB_MODE_PAINT_GPENCIL, _brush);
 
   brush->size = 150.0f;
   brush->gpencil_settings->flag &= ~GP_BRUSH_USE_PRESSURE;
@@ -439,7 +439,7 @@ void BKE_brush_gpencil_presets(Main *bmain, ToolSettings 
*ts)
   brush->smooth_stroke_factor = SMOOTH_STROKE_FACTOR;
 
   /* Marker Chisel brush. */
-  brush = gpencil_brush_ensure(bmain, ts, "Marker Chisel", 
OB_MODE_PAINT_GPENCIL);
+  brush = gpencil_brush_ensure(bmain, ts, "Marker Chisel", 
OB_MODE_PAINT_GPENCIL, _brush);
 
   brush->size = 80.0f;
   brush->gpencil_settings->flag |= (GP_BRUSH_USE_PRESSURE | 
GP_BRUSH_ENABLE_CURSOR);
@@ -472,7 +472,7 @@ void BKE_brush_gpencil_presets(Main *bmain, ToolSettings 
*ts)
   brush->smooth_stroke_factor = SMOOTH_STROKE_FACTOR;
 
   /* Pen brush. */
-  brush = gpencil_brush_ensure(bmain, ts, "Pen", OB_MODE_PAINT_GPENCIL);
+  brush = gpencil_brush_ensure(bmain, ts, "Pen", OB_MODE_PAINT_GPENCIL, 
_brush);
 
   brush->size = 30.0f;
   brush->gpencil_settings->flag |= (GP_BRUSH_USE_PRESSURE | 
GP_BRUSH_ENABLE_CURSOR);
@@ -506,7 +506,7 @@ void BKE_brush_gpencil_presets(Main *bmain, ToolSettings 
*ts)
   brush->smooth_stroke_factor = SMOOTH_STROKE_FACTOR;
 
   /* Pencil Soft brush. */
-  brush = gpencil_brush_ensure(bmain, ts, "Pencil Soft", 

[Bf-blender-cvs] [dca32f2b4f2] master: Fluid Particles: fix threading crash with viscoelastic springs.

2019-11-09 Thread Alexander Gavrilov
Commit: dca32f2b4f290bcf8c110c21d2cdecc04d390934
Author: Alexander Gavrilov
Date:   Sat Oct 26 11:06:19 2019 +0300
Branches: master
https://developer.blender.org/rBdca32f2b4f290bcf8c110c21d2cdecc04d390934

Fluid Particles: fix threading crash with viscoelastic springs.

As correctly pointed out by a comment in the code, adding
new springs wasn't thread safe, and caused crashes.

Fix by buffering new springs in intermediate thread-local
arrays, which are flushed on the main thread. This is valid
because the new springs are not used until the next sim step.

Differential Revision: https://developer.blender.org/D6133

===

M   source/blender/blenkernel/BKE_particle.h
M   source/blender/blenkernel/intern/particle_system.c
M   source/blender/blenlib/BLI_buffer.h

===

diff --git a/source/blender/blenkernel/BKE_particle.h 
b/source/blender/blenkernel/BKE_particle.h
index e9b4c2b5a66..857ed607dd8 100644
--- a/source/blender/blenkernel/BKE_particle.h
+++ b/source/blender/blenkernel/BKE_particle.h
@@ -28,6 +28,7 @@
  */
 
 #include "BLI_utildefines.h"
+#include "BLI_buffer.h"
 
 #include "DNA_particle_types.h"
 #include "DNA_object_types.h"
@@ -108,6 +109,9 @@ typedef struct SPHData {
   float element_size;
   float flow[3];
 
+  /* Temporary thread-local buffer for springs created during this step. */
+  BLI_Buffer new_springs;
+
   /* Integrator callbacks. This allows different SPH implementations. */
   void (*force_cb)(void *sphdata_v, ParticleKey *state, float *force, float 
*impulse);
   void (*density_cb)(void *rangedata_v, int index, const float co[3], float 
squared_dist);
diff --git a/source/blender/blenkernel/intern/particle_system.c 
b/source/blender/blenkernel/intern/particle_system.c
index 43484a57f1c..5985d498606 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -1901,8 +1901,7 @@ static void sph_force_cb(void *sphdata_v, ParticleKey 
*state, float *force, floa
   temp_spring.rest_length = (fluid->flag & SPH_CURRENT_REST_LENGTH) ? 
rij : rest_length;
   temp_spring.delete_flag = 0;
 
-  /* sph_spring_add is not thread-safe. - z0r */
-  sph_spring_add(psys[0], _spring);
+  BLI_buffer_append(>new_springs, ParticleSpring, 
temp_spring);
 }
   }
   else { /* PART_SPRING_HOOKES - Hooke's spring force */
@@ -2124,6 +2123,8 @@ void psys_sph_init(ParticleSimulationData *sim, SPHData 
*sphdata)
   ParticleTarget *pt;
   int i;
 
+  BLI_buffer_field_init(>new_springs, ParticleSpring);
+
   // Add other coupled particle systems.
   sphdata->psys[0] = sim->psys;
   for (i = 1, pt = sim->psys->targets.first; i < 10; i++, pt = (pt ? pt->next 
: NULL)) {
@@ -2156,13 +2157,26 @@ void psys_sph_init(ParticleSimulationData *sim, SPHData 
*sphdata)
   }
 }
 
+static void psys_sph_flush_springs(SPHData *sphdata)
+{
+  for (int i = 0; i < sphdata->new_springs.count; i++) {
+/* sph_spring_add is not thread-safe. - z0r */
+sph_spring_add(sphdata->psys[0], _buffer_at(>new_springs, 
ParticleSpring, i));
+  }
+
+  BLI_buffer_field_free(>new_springs);
+}
+
 void psys_sph_finalise(SPHData *sphdata)
 {
+  psys_sph_flush_springs(sphdata);
+
   if (sphdata->eh) {
 BLI_edgehash_free(sphdata->eh, NULL);
 sphdata->eh = NULL;
   }
 }
+
 /* Sample the density field at a point in space. */
 void psys_sph_density(BVHTree *tree, SPHData *sphdata, float co[3], float 
vars[2])
 {
@@ -3683,6 +3697,14 @@ typedef struct DynamicStepSolverTaskData {
   SpinLock spin;
 } DynamicStepSolverTaskData;
 
+static void dynamics_step_finalize_sphdata(void *__restrict UNUSED(userdata),
+   void *__restrict tls_userdata_chunk)
+{
+  SPHData *sphdata = tls_userdata_chunk;
+
+  psys_sph_flush_springs(sphdata);
+}
+
 static void dynamics_step_sph_ddr_task_cb_ex(void *__restrict userdata,
  const int p,
  const TaskParallelTLS *__restrict 
tls)
@@ -3969,6 +3991,7 @@ static void dynamics_step(ParticleSimulationData *sim, 
float cfra)
 settings.use_threading = (psys->totpart > 100);
 settings.userdata_chunk = 
 settings.userdata_chunk_size = sizeof(sphdata);
+settings.func_finalize = dynamics_step_finalize_sphdata;
 BLI_task_parallel_range(
 0, psys->totpart, _data, dynamics_step_sph_ddr_task_cb_ex, 
);
 
@@ -4000,6 +4023,7 @@ static void dynamics_step(ParticleSimulationData *sim, 
float cfra)
   settings.use_threading = (psys->totpart > 100);
   settings.userdata_chunk = 
   settings.userdata_chunk_size = sizeof(sphdata);
+  settings.func_finalize = dynamics_step_finalize_sphdata;
   BLI_task_parallel_range(0,
   psys->totpart,
  

[Bf-blender-cvs] [064f132000d] greasepencil-object: GPencil: New Vertex Paint Replace Tool

2019-11-09 Thread Antonio Vazquez
Commit: 064f132000d4d2058250723b5b7e5269800a4d7a
Author: Antonio Vazquez
Date:   Sat Nov 9 11:01:27 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB064f132000d4d2058250723b5b7e5269800a4d7a

GPencil: New Vertex Paint Replace Tool

This tool replaces the old mixed color with the current one, but keeps the same 
mix factor. This is not possible with Draw tool, because the draw tool replaces 
the mix factor.

With this tool is very easy tint previous colors, but keeping the same mix and 
pressure values to maintain the same artistic look and feel.

===

M   release/scripts/modules/bl_keymap_utils/keymap_hierarchy.py
M   release/scripts/presets/keyconfig/keymap_data/blender_default.py
M   
release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
M   source/blender/blenkernel/intern/brush.c
M   source/blender/editors/gpencil/gpencil_ops.c
M   source/blender/editors/gpencil/gpencil_vertex_paint.c
M   source/blender/editors/interface/interface_icons.c
M   source/blender/editors/screen/area.c
M   source/blender/makesdna/DNA_brush_types.h
M   source/blender/makesrna/intern/rna_brush.c

===

diff --git a/release/scripts/modules/bl_keymap_utils/keymap_hierarchy.py 
b/release/scripts/modules/bl_keymap_utils/keymap_hierarchy.py
index 1ceb24c68db..3802ecf 100644
--- a/release/scripts/modules/bl_keymap_utils/keymap_hierarchy.py
+++ b/release/scripts/modules/bl_keymap_utils/keymap_hierarchy.py
@@ -203,6 +203,7 @@ _km_hierarchy = [
 ('Grease Pencil Stroke Vertex (Blur)', 'EMPTY', 'WINDOW', []),
 ('Grease Pencil Stroke Vertex (Average)', 'EMPTY', 'WINDOW', []),
 ('Grease Pencil Stroke Vertex (Smear)', 'EMPTY', 'WINDOW', []),
+('Grease Pencil Stroke Vertex (Replace)', 'EMPTY', 'WINDOW', []),
 ]),
 ('Mask Editing', 'EMPTY', 'WINDOW', []),
 ('Frames', 'EMPTY', 'WINDOW', []),# frame navigation (per region)
diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py 
b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 5de0e04c3e5..c84d43c41ba 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -3476,6 +3476,26 @@ def km_grease_pencil_stroke_vertex_smear(params):
 return keymap
 
 
+def km_grease_pencil_stroke_vertex_replace(params):
+items = []
+keymap = (
+"Grease Pencil Stroke Vertex (Replace)",
+{"space_type": 'EMPTY', "region_type": 'WINDOW'},
+{"items": items},
+)
+
+items.extend([
+# Tint
+("gpencil.vertex_paint", {"type": 'LEFTMOUSE', "value": 'PRESS'},
+ {"properties": [("wait_for_input", False)]}),
+# Brush size
+("wm.radial_control", {"type": 'F', "value": 'PRESS'},
+ {"properties": [("data_path_primary", 
'tool_settings.gpencil_vertex_paint.brush.size')]}),
+])
+
+return keymap
+
+
 def km_face_mask(params):
 items = []
 keymap = (
@@ -6279,6 +6299,7 @@ def generate_keymaps(params=None):
 km_grease_pencil_stroke_vertex_blur(params),
 km_grease_pencil_stroke_vertex_average(params),
 km_grease_pencil_stroke_vertex_smear(params),
+km_grease_pencil_stroke_vertex_replace(params),
 km_face_mask(params),
 km_weight_paint_vertex_selection(params),
 km_pose(params),
diff --git 
a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py 
b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
index 037c3462dd7..b9b3d6a6515 100644
--- a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
+++ b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
@@ -2566,7 +2566,7 @@ def km_grease_pencil_stroke_vertex_mode(params):
 op_tool("builtin_brush.Blur", {"type": 'F', "value": 'PRESS'}),
 op_tool("builtin_brush.Average", {"type": 'E', "value": 'PRESS'}),
 op_tool("builtin.brush.Smear", {"type": 'K', "value": 'PRESS'}),
-
+op_tool("builtin.brush.Replace", {"type": 'R', "value": 'PRESS'}),
 ])
 
 return keymap
@@ -2670,6 +2670,26 @@ def km_grease_pencil_stroke_vertex_smear(params):
 
 return keymap
 
+
+def km_grease_pencil_stroke_vertex_replace(params):
+items = []
+keymap = (
+"Grease Pencil Stroke Vertex (Replace)",
+{"space_type": 'EMPTY', "region_type": 'WINDOW'},
+{"items": items},
+)
+
+items.extend([
+# Tint
+("gpencil.vertex_paint", {"type": 'LEFTMOUSE', "value": 'PRESS'},
+ {"properties": [("wait_for_input", False)]}),
+# Brush size
+("wm.radial_control", {"type": 'F', "value": 'PRESS'},
+ {"properties": [("data_path_primary", 

[Bf-blender-cvs] [b60b92abd45] greasepencil-object: GPencil: Display Fill colors in Vertex Paint in Multiedit always

2019-11-09 Thread Antonio Vazquez
Commit: b60b92abd45b081b0caef2b139a9408fefb4df5a
Author: Antonio Vazquez
Date:   Sat Nov 9 09:04:12 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rBb60b92abd45b081b0caef2b139a9408fefb4df5a

GPencil: Display Fill colors in Vertex Paint in Multiedit always

Don't use the option of multiedit "use_gpencil_multiedit_line_only"

===

M   source/blender/draw/engines/gpencil/gpencil_draw_utils.c

===

diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c 
b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index 236b15e45b5..f9c37a72cb4 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -1240,7 +1240,8 @@ static void gpencil_draw_strokes(GpencilBatchCache *cache,
   const bool playing = stl->storage->is_playing;
   const bool is_render = (bool)stl->storage->is_render;
   const bool is_mat_preview = (bool)stl->storage->is_mat_preview;
-  const bool overlay_multiedit = v3d != NULL ? !(v3d->gp_flag & 
V3D_GP_SHOW_MULTIEDIT_LINES) :
+  const bool overlay_multiedit = v3d != NULL ? ((!(v3d->gp_flag & 
V3D_GP_SHOW_MULTIEDIT_LINES)) ||
+(GPENCIL_VERTEX_MODE(gpd))) :
true;
 
   /* Get evaluation context */

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