[Bf-blender-cvs] [fca9b055a54] greasepencil-object: GPencil: Use Standard Falloff curves for Sculpt/Weight Paint
Antonio Vazquez
noreply at git.blender.org
Fri Nov 22 16:29:55 CET 2019
Commit: fca9b055a542252374e4ec921435717718643846
Author: Antonio Vazquez
Date: Fri Nov 22 16:29:32 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rBfca9b055a542252374e4ec921435717718643846
GPencil: Use Standard Falloff curves for Sculpt/Weight Paint
As the tools are bruhes, we can use the standard Curves.
===================================================================
M release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M release/scripts/startup/bl_ui/properties_paint_common.py
M release/scripts/startup/bl_ui/space_view3d_toolbar.py
M source/blender/blenkernel/intern/brush.c
M source/blender/editors/gpencil/gpencil_sculpt_paint.c
M source/blender/editors/gpencil/gpencil_weight_paint.c
M source/blender/makesdna/DNA_brush_types.h
M source/blender/makesrna/intern/rna_brush.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index 44a47c3e41d..f75904cb618 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -310,6 +310,48 @@ class GreasePencilAppearancePanel:
layout.prop(brush, "cursor_color_add", text="Color")
+class GreasePencilBrushFalloff:
+ 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 = None
+ if context.mode == 'SCULPT_GPENCIL':
+ settings = ts.gpencil_sculpt_paint
+ elif context.mode == 'WEIGHT_GPENCIL':
+ settings = ts.gpencil_weight_paint
+ elif context.mode == 'VERTEX_GPENCIL':
+ settings = ts.gpencil_vertex_paint
+
+ if settings:
+ 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 GPENCIL_MT_snap(Menu):
bl_label = "Snap"
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index b09df7fdcfe..87939cfd27e 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -462,8 +462,6 @@ def brush_basic_gpencil_sculpt_settings(layout, _context, brush, tool, *, compac
row.prop(brush, "strength", slider=True)
row.prop(brush, "use_pressure_strength", text="")
- layout.prop(gp_settings, "use_falloff")
-
if compact:
if tool in {'THICKNESS', 'STRENGTH', 'PINCH', 'TWIST'}:
row.separator()
@@ -492,8 +490,6 @@ def brush_basic_gpencil_weight_settings(layout, _context, brush, tool, *, compac
row.prop(brush, "strength", slider=True)
row.prop(brush, "use_pressure_strength", text="")
- layout.prop(gp_settings, "use_falloff")
-
layout.prop(gp_settings, "weight", slider=True)
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 790d3308da0..0f071f8d13d 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -23,6 +23,7 @@ from bl_ui.properties_grease_pencil_common import (
GreasePencilSculptOptionsPanel,
GreasePencilAppearancePanel,
GreasePencilFlipTintColors,
+ GreasePencilBrushFalloff,
)
from bl_ui.properties_paint_common import (
UnifiedPaintPanel,
@@ -2336,7 +2337,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_vertex_color(View3DPanel, Panel):
sub_row.operator("gpencil.tint_flip", icon='FILE_REFRESH', text="")
-class VIEW3D_PT_tools_grease_pencil_brush_vertex_falloff(Panel, View3DPaintPanel):
+class VIEW3D_PT_tools_grease_pencil_brush_vertex_falloff(GreasePencilBrushFalloff, Panel, View3DPaintPanel):
bl_context = ".greasepencil_vertex"
bl_label = "Falloff"
bl_options = {'DEFAULT_CLOSED'}
@@ -2348,27 +2349,31 @@ class VIEW3D_PT_tools_grease_pencil_brush_vertex_falloff(Panel, View3DPaintPanel
brush = settings.brush
return (settings and settings.brush and settings.brush.curve)
- def draw(self, context):
- layout = self.layout
+
+class VIEW3D_PT_tools_grease_pencil_brush_sculpt_falloff(GreasePencilBrushFalloff, Panel, View3DPaintPanel):
+ bl_context = ".greasepencil_sculpt"
+ bl_label = "Falloff"
+ bl_options = {'DEFAULT_CLOSED'}
+
+ @classmethod
+ def poll(cls, context):
ts = context.tool_settings
- settings = ts.gpencil_vertex_paint
+ settings = ts.gpencil_sculpt_paint
brush = settings.brush
+ return (settings and settings.brush and settings.brush.curve)
- 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)
+class VIEW3D_PT_tools_grease_pencil_brush_weight_falloff(GreasePencilBrushFalloff, Panel, View3DPaintPanel):
+ bl_context = ".greasepencil_weight"
+ bl_label = "Falloff"
+ bl_options = {'DEFAULT_CLOSED'}
- 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'
+ @classmethod
+ def poll(cls, context):
+ ts = context.tool_settings
+ settings = ts.gpencil_weight_paint
+ brush = settings.brush
+ return (settings and settings.brush and settings.brush.curve)
class VIEW3D_PT_tools_grease_pencil_brush_vertex_palette(View3DPanel, Panel):
@@ -2657,7 +2662,9 @@ classes = (
VIEW3D_PT_tools_grease_pencil_weight_paint,
VIEW3D_PT_tools_grease_pencil_paint_appearance,
VIEW3D_PT_tools_grease_pencil_sculpt_options,
+ VIEW3D_PT_tools_grease_pencil_brush_sculpt_falloff,
VIEW3D_PT_tools_grease_pencil_sculpt_appearance,
+ VIEW3D_PT_tools_grease_pencil_brush_weight_falloff,
VIEW3D_PT_tools_grease_pencil_weight_appearance,
VIEW3D_PT_tools_grease_pencil_interpolate,
VIEW3D_PT_tools_grease_pencil_vertex_brush,
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 889d51e2d6a..0049ecee48e 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -773,8 +773,7 @@ void BKE_brush_gpencil_sculpt_presets(Main *bmain, ToolSettings *ts)
brush->gpencil_settings->draw_strength = 0.3f;
brush->gpencil_settings->flag |= GP_BRUSH_USE_STENGTH_PRESSURE;
- brush->gpencil_settings->sculpt_flag = GP_SCULPT_FLAG_USE_FALLOFF |
- GP_SCULPT_FLAG_SMOOTH_PRESSURE;
+ brush->gpencil_settings->sculpt_flag = GP_SCULPT_FLAG_SMOOTH_PRESSURE;
brush->gpencil_settings->sculpt_mode_flag |= GP_SCULPT_FLAGMODE_APPLY_POSITION;
}
@@ -789,8 +788,7 @@ void BKE_brush_gpencil_sculpt_presets(Main *bmain, ToolSettings *ts)
brush->gpencil_settings->draw_strength = 0.3f;
brush->gpencil_settings->flag |= GP_BRUSH_USE_STENGTH_PRESSURE;
- brush->gpencil_settings->sculpt_flag = GP_SCULPT_FLAG_USE_FALLOFF |
- GP_SCULPT_FLAG_SMOOTH_PRESSURE;
+ brush->gpencil_settings->sculpt_flag = GP_SCULPT_FLAG_SMOOTH_PRESSURE;
brush->gpencil_settings->sculpt_mode_flag |= GP_SCULPT_FLAGMODE_APPLY_POSITION;
}
@@ -805,7 +803,6 @@ void BKE_brush_gpencil_sculpt_presets(Main *bmain, ToolSettings *ts)
brush->gpencil_settings->draw_strength = 0.5f;
brush->gpencil_settings->flag |= GP_BRUSH_USE_STENGTH_PRESSURE;
- brush->gpencil_settings->sculpt_flag = GP_SCULPT_FLAG_USE_FALLOFF;
brush->gpencil_settings->sculpt_mode_flag |= GP_SCULPT_FLAGMODE_APPLY_POSITION;
}
@@ -821,7 +818,6 @@ void BKE_brush_gpencil_sculpt_presets(Main *bmain, ToolSettings *ts)
brush->gpencil_settings->draw_strength = 0.3f;
brush->gpencil_settings->flag |= GP_BRUSH_USE_STENGTH_PRESSURE;
- brush->gpencil_settings->sculpt_flag = GP_SCULPT_FLAG_USE_FALLOFF;
brush->gpencil_settings->sculpt_mode_flag |= GP_SCULPT_FLAGMODE_APPLY_POSITION;
}
@@ -836,7 +832,6 @@ void BKE_brush_gpencil_sculpt_presets(Main *bmain, ToolSettings *ts)
brush->gpencil_settings->draw_strength = 0.3f;
brush->gpencil_settings->flag |= GP_BRUSH_USE_STENGTH_PRESSURE;
- brush->gpencil_settings->sculpt_flag = GP_SCULPT_FLAG_USE_FALLOFF;
brush->gpencil_settings->sculpt_mode_flag |= GP_SCULPT_FLAGMODE_APPLY_POSITION;
}
@@ -851,7 +846,6 @@ void BKE_brush_gpencil_sculpt_presets(Main *bmain, ToolSettings *ts)
brush->gpencil_settings->draw_strength = 0.3f;
brush->gpencil_settings->flag |= GP_BRUSH_USE_STENGTH_PRESSURE;
- brush->gpencil_settings->sculpt_flag = GP_SCULPT_FLAG_USE_FALLOFF;
brush->gpencil_settings->sculpt_mode_flag |= GP_SCULPT_FLAGMODE_APPLY_POSITION;
}
@@ -866,7 +860,6 @@ void BKE_brush_gpencil_sculpt_presets(Main *bmain, ToolSettings *ts)
brush->gpencil_settings->draw_strength = 0.5f;
brush->gpencil_settings->flag |= GP_BRUSH_USE_STENGTH_PRESSURE;
- brush->gpencil_settings->sculpt_flag = GP_SCULPT_FLAG_USE_FALLOFF;
brush->gpencil_settings->sculpt_mode_flag |= GP_SCULPT_FLAGMODE_APPLY_POSITION;
}
@@ -881,7 +874,6 @@ void BKE_brush_gpencil_sculpt_presets(Main *bmain, ToolSettings *ts)
brush->gpencil_settings->draw_strength = 0.5f;
brush->gpenci
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list