Commit: 052105b72f60fe3e671e5aeae0558687ddcc39b7
Author: Antonio Vazquez
Date:   Fri Mar 9 10:29:03 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB052105b72f60fe3e671e5aeae0558687ddcc39b7

Reorganize Stroke panel grouping Settings

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

M       release/scripts/startup/bl_ui/space_view3d_toolbar.py
M       source/blender/editors/gpencil/gpencil_paint.c
M       source/blender/makesdna/DNA_gpencil_types.h
M       source/blender/makesrna/intern/rna_scene.c

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

diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py 
b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 0a12a967ed0..5fa093e9d04 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -2187,21 +2187,17 @@ class VIEW3D_PT_tools_grease_pencil_brush_option(Panel):
                 row.prop(brush, "angle_factor", text="Factor", slider=True)
                 col.separator()
 
-            col.prop(brush, "enable_smooth", text="Post-processing Smooth")
-            if brush.enable_smooth is True:
+            col.prop(brush, "enable_settings", text="Post-processing Settings")
+            if brush.enable_settings is True:
                 col.label(text="Stroke Quality:")
                 col.prop(brush, "pen_smooth_factor")
                 col.prop(brush, "pen_smooth_steps")
 
-                col = layout.column(align=True)
                 col.label(text="Thickness:")
                 col.prop(brush, "pen_thick_smooth_factor")
                 col.prop(brush, "pen_thick_smooth_steps")
-                col.separator()
 
-            col.prop(brush, "enable_subdiv", text="Post-processing Subdivide")
-            if brush.enable_subdiv is True:
-                col.separator()
+                col.label(text="Subdivide:")
                 col.prop(brush, "pen_subdivision_steps")
                 col.prop(brush, "random_subdiv", text="Randomness", 
slider=True)
 
diff --git a/source/blender/editors/gpencil/gpencil_paint.c 
b/source/blender/editors/gpencil/gpencil_paint.c
index 0c942beaff0..34c66ada4df 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1096,7 +1096,7 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
                }
 
                /* subdivide and smooth the stroke */
-               if ((brush->flag_group & GP_BRUSH_GROUP_SUBDIVIDE) && (sublevel 
> 0)) {
+               if ((brush->flag_group & GP_BRUSH_GROUP_SETTINGS) && (sublevel 
> 0)) {
                        gp_subdivide_stroke(gps, sublevel);
                }
                /* apply randomness to stroke */
@@ -1108,7 +1108,7 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
                 * for each iteration, the factor is reduced to get a better 
smoothing without changing too much
                 * the original stroke
                 */
-               if ((brush->flag_group & GP_BRUSH_GROUP_SMOOTH) && 
(brush->draw_smoothfac > 0.0f)) {
+               if ((brush->flag_group & GP_BRUSH_GROUP_SETTINGS) && 
(brush->draw_smoothfac > 0.0f)) {
                        float reduce = 0.0f;
                        for (int r = 0; r < brush->draw_smoothlvl; r++) {
                                for (i = 0; i < gps->totpoints; i++) {
@@ -1119,7 +1119,7 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
                        }
                }
                /* smooth thickness */
-               if (brush->thick_smoothfac > 0.0f) {
+               if ((brush->flag_group & GP_BRUSH_GROUP_SETTINGS) && 
(brush->thick_smoothfac > 0.0f)) {
                        for (int r = 0; r < brush->thick_smoothlvl * 2; r++) {
                                for (i = 0; i < gps->totpoints; i++) {
                                        BKE_gp_smooth_stroke_thickness(gps, i, 
brush->thick_smoothfac);
diff --git a/source/blender/makesdna/DNA_gpencil_types.h 
b/source/blender/makesdna/DNA_gpencil_types.h
index b889fc3b692..07929210a01 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -179,12 +179,10 @@ typedef enum eGPDbrush_Flag {
 
 /* bGPDbrush->flag_group */
 typedef enum eGPDbrush_FlagGroup {
-       /* smooth group */
-       GP_BRUSH_GROUP_SMOOTH = (1 << 0),
-       /* subdivide group */
-       GP_BRUSH_GROUP_SUBDIVIDE = (1 << 1),
+       /* settings group */
+       GP_BRUSH_GROUP_SETTINGS = (1 << 0),
        /* Random settings group */
-       GP_BRUSH_GROUP_RANDOM = (1 << 2),
+       GP_BRUSH_GROUP_RANDOM = (1 << 1),
 } eGPDbrush_FlagGroup;
 
 /* ***************************************** */
diff --git a/source/blender/makesrna/intern/rna_scene.c 
b/source/blender/makesrna/intern/rna_scene.c
index 0fb6c46582a..fbee68d48d5 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -2531,13 +2531,9 @@ static void rna_def_gpencil_brush(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Default Eraser", "Use this brush when 
enable eraser with fast switch key");
        RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, 
"rna_GPencil_brush_default_eraser");
 
-       prop = RNA_def_property(srna, "enable_smooth", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_boolean_sdna(prop, NULL, "flag_group", 
GP_BRUSH_GROUP_SMOOTH);
-       RNA_def_property_ui_text(prop, "Smooth", "Enable post smooth processing 
for new strokes");
-
-       prop = RNA_def_property(srna, "enable_subdiv", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_boolean_sdna(prop, NULL, "flag_group", 
GP_BRUSH_GROUP_SUBDIVIDE);
-       RNA_def_property_ui_text(prop, "Subdivide", "Enable post subdivide 
processing for new strokes");
+       prop = RNA_def_property(srna, "enable_settings", PROP_BOOLEAN, 
PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "flag_group", 
GP_BRUSH_GROUP_SETTINGS);
+       RNA_def_property_ui_text(prop, "Settings", "Enable additional post 
processing options for new strokes");
 
        prop = RNA_def_property(srna, "enable_random", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag_group", 
GP_BRUSH_GROUP_RANDOM);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to