Cleanup: remove redundant 'gpencil_' prefix
authorCampbell Barton <ideasman42@gmail.com>
Tue, 30 Oct 2018 21:54:27 +0000 (08:54 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 31 Oct 2018 00:51:15 +0000 (11:51 +1100)
Also rename 'gpencil_brush_type' -> 'tool' & correct typo.

release/scripts/startup/bl_ui/properties_grease_pencil_common.py
release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
release/scripts/startup/bl_ui/space_view3d_toolbar.py
source/blender/makesrna/intern/rna_brush.c

index a4d62f1757ce498b111bcccbd7bad26ce1c9fef2..9f6a98bc7871644c4c2087bb8efa4730ef4e73ba 100644 (file)
@@ -341,10 +341,10 @@ class GreasePencilAppearancePanel:
 
             layout.prop(gp_settings, "use_cursor", text="Show Brush")
 
 
             layout.prop(gp_settings, "use_cursor", text="Show Brush")
 
-            if gp_settings.gpencil_brush_type == 'DRAW':
+            if gp_settings.tool == 'DRAW':
                 layout.prop(gp_settings, "disable_lasso", text="Hide fill color while drawing")
 
                 layout.prop(gp_settings, "disable_lasso", text="Hide fill color while drawing")
 
-            if gp_settings.gpencil_brush_type == 'FILL':
+            if gp_settings.tool == 'FILL':
                 layout.prop(brush, "cursor_color_add", text="Color")
 
         elif ob.mode in {'GPENCIL_SCULPT', 'GPENCIL_WEIGHT'}:
                 layout.prop(brush, "cursor_color_add", text="Color")
 
         elif ob.mode in {'GPENCIL_SCULPT', 'GPENCIL_WEIGHT'}:
index c698327e5d900bc052b8040114bd27e4ee8d8ff5..3c7e7309fa4ab48d0767bf06f32202a62c93d10a 100644 (file)
@@ -1370,7 +1370,7 @@ class _defs_gpencil_paint:
             brush = context.active_gpencil_brush
             gp_settings = brush.gpencil_settings
 
             brush = context.active_gpencil_brush
             gp_settings = brush.gpencil_settings
 
-            if gp_settings.gpencil_brush_type == 'ERASE':
+            if gp_settings.tool == 'ERASE':
                 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(brush, "size", text="Radius")
                 row.prop(gp_settings, "use_pressure", text="", icon='STYLUS_PRESSURE')
@@ -1378,19 +1378,19 @@ class _defs_gpencil_paint:
                     row = layout.row(align=True)
                     row.prop(gp_settings, "pen_strength", slider=True)
                     row.prop(gp_settings, "use_strength_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')
-            elif gp_settings.gpencil_brush_type == 'FILL':
+            elif gp_settings.tool == 'FILL':
                 row = layout.row()
                 row = layout.row()
-                row.prop(gp_settings, "gpencil_fill_leak", text="Leak Size")
+                row.prop(gp_settings, "fill_leak", text="Leak Size")
                 row.prop(brush, "size", text="Thickness")
                 row.prop(brush, "size", text="Thickness")
-                row.prop(gp_settings, "gpencil_fill_simplyfy_level", text="Simplify")
+                row.prop(gp_settings, "fill_simplify_level", text="Simplify")
 
                 _defs_gpencil_paint.draw_color_selector(context, layout)
 
                 row = layout.row(align=True)
 
                 _defs_gpencil_paint.draw_color_selector(context, layout)
 
                 row = layout.row(align=True)
-                row.prop(gp_settings, "gpencil_fill_draw_mode", text="")
-                row.prop(gp_settings, "gpencil_fill_show_boundary", text="", icon='GRID')
+                row.prop(gp_settings, "fill_draw_mode", text="")
+                row.prop(gp_settings, "fill_show_boundary", text="", icon='GRID')
 
 
-            else:  # bgpsettings.gpencil_brush_type == 'DRAW':
+            else:  # bgpsettings.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(brush, "size", text="Radius")
                 row.prop(gp_settings, "use_pressure", text="", icon='STYLUS_PRESSURE')
index 1b5d78f093c91deac7574011dd19234f1b40f6db..5f3052fd3dcf6a02be218babf786bc8102720743 100644 (file)
@@ -1370,11 +1370,11 @@ class VIEW3D_PT_tools_grease_pencil_brush(View3DPanel, Panel):
 
         if brush is not None:
             # XXX: Items in "sub" currently show up beside the brush selector in a separate column
 
         if brush is not None:
             # XXX: Items in "sub" currently show up beside the brush selector in a separate column
-            if gp_settings.gpencil_brush_type == 'ERASE':
+            if gp_settings.tool == 'ERASE':
                 sub.prop(gp_settings, "default_eraser", text="")
 
             # Brush details
                 sub.prop(gp_settings, "default_eraser", text="")
 
             # Brush details
-            if gp_settings.gpencil_brush_type == 'ERASE':
+            if gp_settings.tool == 'ERASE':
                 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(brush, "size", text="Radius")
                 row.prop(gp_settings, "use_pressure", text="", icon='STYLUS_PRESSURE')
@@ -1387,27 +1387,27 @@ class VIEW3D_PT_tools_grease_pencil_brush(View3DPanel, Panel):
                     row.prop(gp_settings, "eraser_strength_factor")
                     row = layout.row(align=True)
                     row.prop(gp_settings, "eraser_thickness_factor")
                     row.prop(gp_settings, "eraser_strength_factor")
                     row = layout.row(align=True)
                     row.prop(gp_settings, "eraser_thickness_factor")
-            elif gp_settings.gpencil_brush_type == 'FILL':
+            elif gp_settings.tool == 'FILL':
                 col = layout.column(align=True)
                 col = layout.column(align=True)
-                col.prop(gp_settings, "gpencil_fill_leak", text="Leak Size")
+                col.prop(gp_settings, "fill_leak", text="Leak Size")
                 col.separator()
                 col.prop(brush, "size", text="Thickness")
                 col.separator()
                 col.prop(brush, "size", text="Thickness")
-                col.prop(gp_settings, "gpencil_fill_simplyfy_level", text="Simplify")
+                col.prop(gp_settings, "fill_simplify_level", text="Simplify")
 
                 col = layout.row(align=True)
                 col.template_ID(gp_settings, "material")
 
                 row = layout.row(align=True)
 
                 col = layout.row(align=True)
                 col.template_ID(gp_settings, "material")
 
                 row = layout.row(align=True)
-                row.prop(gp_settings, "gpencil_fill_draw_mode", text="Boundary Draw Mode")
-                row.prop(gp_settings, "gpencil_fill_show_boundary", text="", icon='GRID')
+                row.prop(gp_settings, "fill_draw_mode", text="Boundary Draw Mode")
+                row.prop(gp_settings, "fill_show_boundary", text="", icon='GRID')
 
                 col = layout.column(align=True)
 
                 col = layout.column(align=True)
-                col.enabled = gp_settings.gpencil_fill_draw_mode != 'STROKE'
-                col.prop(gp_settings, "gpencil_fill_hide", text="Ignore Transparent Strokes")
+                col.enabled = gp_settings.fill_draw_mode != 'STROKE'
+                col.prop(gp_settings, "fill_hide", text="Ignore Transparent Strokes")
                 sub = col.row(align=True)
                 sub = col.row(align=True)
-                sub.enabled = gp_settings.gpencil_fill_hide
-                sub.prop(gp_settings, "gpencil_fill_threshold", text="Threshold")
-            else:  # bgpsettings.gpencil_brush_type == 'DRAW':
+                sub.enabled = gp_settings.fill_hide
+                sub.prop(gp_settings, "fill_threshold", text="Threshold")
+            else:  # bgpsettings.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(brush, "size", text="Radius")
                 row.prop(gp_settings, "use_pressure", text="", icon='STYLUS_PRESSURE')
@@ -1430,7 +1430,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_option(View3DPanel, Panel):
         brush = context.active_gpencil_brush
         gp_settings = brush.gpencil_settings
 
         brush = context.active_gpencil_brush
         gp_settings = brush.gpencil_settings
 
-        return brush is not None and gp_settings.gpencil_brush_type != 'ERASE'
+        return brush is not None and gp_settings.tool != 'ERASE'
 
     def draw_header_preset(self, context):
         VIEW3D_PT_gpencil_brush_presets.draw_panel_header(self.layout)
 
     def draw_header_preset(self, context):
         VIEW3D_PT_gpencil_brush_presets.draw_panel_header(self.layout)
@@ -1468,7 +1468,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_stabilizer(View3DPanel, Panel):
         brush = context.active_gpencil_brush
         gp_settings = brush.gpencil_settings
 
         brush = context.active_gpencil_brush
         gp_settings = brush.gpencil_settings
 
-        return brush is not None and gp_settings.gpencil_brush_type == 'DRAW'
+        return brush is not None and gp_settings.tool == 'DRAW'
 
     def draw_header(self, context):
         brush = context.active_gpencil_brush
 
     def draw_header(self, context):
         brush = context.active_gpencil_brush
@@ -1500,7 +1500,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_settings(View3DPanel, Panel):
         brush = context.active_gpencil_brush
         gp_settings = brush.gpencil_settings
 
         brush = context.active_gpencil_brush
         gp_settings = brush.gpencil_settings
 
-        return brush is not None and gp_settings.gpencil_brush_type != 'ERASE'
+        return brush is not None and gp_settings.tool != 'ERASE'
 
     def draw_header(self, context):
         brush = context.active_gpencil_brush
 
     def draw_header(self, context):
         brush = context.active_gpencil_brush
@@ -1541,7 +1541,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_random(View3DPanel, Panel):
         brush = context.active_gpencil_brush
         gp_settings = brush.gpencil_settings
 
         brush = context.active_gpencil_brush
         gp_settings = brush.gpencil_settings
 
-        return brush is not None and gp_settings.gpencil_brush_type != 'ERASE'
+        return brush is not None and gp_settings.tool != 'ERASE'
 
     def draw_header(self, context):
         brush = context.active_gpencil_brush
 
     def draw_header(self, context):
         brush = context.active_gpencil_brush
@@ -1578,7 +1578,7 @@ class VIEW3D_PT_tools_grease_pencil_brushcurves(View3DPanel, Panel):
         brush = context.active_gpencil_brush
         gp_settings = brush.gpencil_settings
 
         brush = context.active_gpencil_brush
         gp_settings = brush.gpencil_settings
 
-        return brush is not None and gp_settings.gpencil_brush_type != 'ERASE'
+        return brush is not None and gp_settings.tool != 'ERASE'
 
     @staticmethod
     def draw(self, context):
 
     @staticmethod
     def draw(self, context):
index 53fdf9793ffad459b61985f0c6649cb7cb4250a0..f3d02c2f90514fa905d5785fd4a16396d5a2630e 100644 (file)
@@ -1121,7 +1121,7 @@ static void rna_def_gpencil_options(BlenderRNA *brna)
        RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
 
        /* fill threshold for transparence */
        RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
 
        /* fill threshold for transparence */
-       prop = RNA_def_property(srna, "gpencil_fill_threshold", PROP_FLOAT, PROP_NONE);
+       prop = RNA_def_property(srna, "fill_threshold", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "fill_threshold");
        RNA_def_property_range(prop, 0.0f, 1.0f);
        RNA_def_property_ui_text(prop, "Threshold",
        RNA_def_property_float_sdna(prop, NULL, "fill_threshold");
        RNA_def_property_range(prop, 0.0f, 1.0f);
        RNA_def_property_ui_text(prop, "Threshold",
@@ -1130,7 +1130,7 @@ static void rna_def_gpencil_options(BlenderRNA *brna)
        RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
 
        /* fill leak size */
        RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
 
        /* fill leak size */
-       prop = RNA_def_property(srna, "gpencil_fill_leak", PROP_INT, PROP_PIXEL);
+       prop = RNA_def_property(srna, "fill_leak", PROP_INT, PROP_PIXEL);
        RNA_def_property_int_sdna(prop, NULL, "fill_leak");
        RNA_def_property_range(prop, 0, 100);
        RNA_def_property_ui_text(prop, "Leak Size",
        RNA_def_property_int_sdna(prop, NULL, "fill_leak");
        RNA_def_property_range(prop, 0, 100);
        RNA_def_property_ui_text(prop, "Leak Size",
@@ -1139,7 +1139,7 @@ static void rna_def_gpencil_options(BlenderRNA *brna)
        RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
 
        /* fill simplify steps */
        RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
 
        /* fill simplify steps */
-       prop = RNA_def_property(srna, "gpencil_fill_simplyfy_level", PROP_INT, PROP_NONE);
+       prop = RNA_def_property(srna, "fill_simplify_level", PROP_INT, PROP_NONE);
        RNA_def_property_int_sdna(prop, NULL, "fill_simplylvl");
        RNA_def_property_range(prop, 0, 10);
        RNA_def_property_ui_text(prop, "Simplify",
        RNA_def_property_int_sdna(prop, NULL, "fill_simplylvl");
        RNA_def_property_range(prop, 0, 10);
        RNA_def_property_ui_text(prop, "Simplify",
@@ -1230,7 +1230,7 @@ static void rna_def_gpencil_options(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Enable Cursor", "Enable cursor on screen");
        RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
 
        RNA_def_property_ui_text(prop, "Enable Cursor", "Enable cursor on screen");
        RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
 
-       prop = RNA_def_property(srna, "gpencil_brush_type", PROP_ENUM, PROP_NONE);
+       prop = RNA_def_property(srna, "tool", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "brush_type");
        RNA_def_property_enum_items(prop, rna_enum_gpencil_brush_types_items);
        RNA_def_property_ui_text(prop, "Type", "Category of the brush");
        RNA_def_property_enum_sdna(prop, NULL, "brush_type");
        RNA_def_property_enum_items(prop, rna_enum_gpencil_brush_types_items);
        RNA_def_property_ui_text(prop, "Type", "Category of the brush");
@@ -1243,7 +1243,7 @@ static void rna_def_gpencil_options(BlenderRNA *brna)
        RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
        RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_eraser_mode_update");
 
        RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
        RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_eraser_mode_update");
 
-       prop = RNA_def_property(srna, "gpencil_fill_draw_mode", PROP_ENUM, PROP_NONE);
+       prop = RNA_def_property(srna, "fill_draw_mode", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "fill_draw_mode");
        RNA_def_property_enum_items(prop, rna_enum_gpencil_fill_draw_modes_items);
        RNA_def_property_ui_text(prop, "Mode", "Mode to draw boundary limits");
        RNA_def_property_enum_sdna(prop, NULL, "fill_draw_mode");
        RNA_def_property_enum_items(prop, rna_enum_gpencil_fill_draw_modes_items);
        RNA_def_property_ui_text(prop, "Mode", "Mode to draw boundary limits");
@@ -1258,13 +1258,13 @@ static void rna_def_gpencil_options(BlenderRNA *brna)
        RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
        RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_Brush_material_update");
 
        RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
        RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_Brush_material_update");
 
-       prop = RNA_def_property(srna, "gpencil_fill_show_boundary", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "fill_show_boundary", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_FILL_SHOW_HELPLINES);
        RNA_def_property_boolean_default(prop, true);
        RNA_def_property_ui_text(prop, "Show Lines", "Show help lines for filling to see boundaries");
        RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
 
        RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_FILL_SHOW_HELPLINES);
        RNA_def_property_boolean_default(prop, true);
        RNA_def_property_ui_text(prop, "Show Lines", "Show help lines for filling to see boundaries");
        RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
 
-       prop = RNA_def_property(srna, "gpencil_fill_hide", PROP_BOOLEAN, PROP_NONE);
+       prop = RNA_def_property(srna, "fill_hide", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_FILL_HIDE);
        RNA_def_property_boolean_default(prop, true);
        RNA_def_property_ui_text(prop, "Hide", "Hide transparent lines to use as boundary for filling");
        RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_FILL_HIDE);
        RNA_def_property_boolean_default(prop, true);
        RNA_def_property_ui_text(prop, "Hide", "Hide transparent lines to use as boundary for filling");