Cleanup: remove redundant 'gpencil_' prefix
Also rename 'gpencil_brush_type' -> 'tool' & correct typo.
This commit is contained in:
parent
40412e3579
commit
3224b79289
@ -341,10 +341,10 @@ class GreasePencilAppearancePanel:
|
||||
|
||||
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")
|
||||
|
||||
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'}:
|
||||
|
@ -1370,7 +1370,7 @@ class _defs_gpencil_paint:
|
||||
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')
|
||||
@ -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')
|
||||
elif gp_settings.gpencil_brush_type == 'FILL':
|
||||
elif gp_settings.tool == 'FILL':
|
||||
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(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)
|
||||
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')
|
||||
|
@ -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 gp_settings.gpencil_brush_type == 'ERASE':
|
||||
if gp_settings.tool == 'ERASE':
|
||||
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')
|
||||
@ -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")
|
||||
elif gp_settings.gpencil_brush_type == 'FILL':
|
||||
elif gp_settings.tool == 'FILL':
|
||||
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.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)
|
||||
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.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.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')
|
||||
@ -1430,7 +1430,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_option(View3DPanel, Panel):
|
||||
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)
|
||||
@ -1468,7 +1468,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_stabilizer(View3DPanel, Panel):
|
||||
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
|
||||
@ -1500,7 +1500,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_settings(View3DPanel, Panel):
|
||||
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
|
||||
@ -1541,7 +1541,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_random(View3DPanel, Panel):
|
||||
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
|
||||
@ -1578,7 +1578,7 @@ class VIEW3D_PT_tools_grease_pencil_brushcurves(View3DPanel, Panel):
|
||||
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):
|
||||
|
@ -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 */
|
||||
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",
|
||||
@ -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 */
|
||||
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",
|
||||
@ -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 */
|
||||
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",
|
||||
@ -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);
|
||||
|
||||
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");
|
||||
@ -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");
|
||||
|
||||
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");
|
||||
@ -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");
|
||||
|
||||
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);
|
||||
|
||||
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");
|
||||
|
Loading…
Reference in New Issue
Block a user