Cleanup: use standard prefix for boolean settings

Avoid using 'add' as a prefix, it reads like a method.
This commit is contained in:
Campbell Barton 2018-10-01 11:56:41 +10:00
parent 12c49d05c6
commit 1f2c4f8809
7 changed files with 32 additions and 31 deletions

View File

@ -1652,10 +1652,10 @@ class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, Panel):
row = layout.row(align=True)
row.label(text="Affect:")
row = layout.row(align=True)
row.prop(md, "affect_position", text="Position", icon='MESH_DATA', toggle=True)
row.prop(md, "affect_strength", text="Strength", icon='COLOR', toggle=True)
row.prop(md, "affect_thickness", text="Thickness", icon='LINE_DATA', toggle=True)
row.prop(md, "affect_uv", text="UV", icon='MOD_UVPROJECT', toggle=True)
row.prop(md, "use_edit_position", text="Position", icon='MESH_DATA', toggle=True)
row.prop(md, "use_edit_strength", text="Strength", icon='COLOR', toggle=True)
row.prop(md, "use_edit_thickness", text="Thickness", icon='LINE_DATA', toggle=True)
row.prop(md, "use_edit_uv", text="UV", icon='MOD_UVPROJECT', toggle=True)
def GP_SMOOTH(self, layout, ob, md):
gpd = ob.data
@ -1683,10 +1683,10 @@ class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, Panel):
row = layout.row(align=True)
row.label(text="Affect:")
row = layout.row(align=True)
row.prop(md, "affect_position", text="Position", icon='MESH_DATA', toggle=True)
row.prop(md, "affect_strength", text="Strength", icon='COLOR', toggle=True)
row.prop(md, "affect_thickness", text="Thickness", icon='LINE_DATA', toggle=True)
row.prop(md, "affect_uv", text="UV", icon='MOD_UVPROJECT', toggle=True)
row.prop(md, "use_edit_position", text="Position", icon='MESH_DATA', toggle=True)
row.prop(md, "use_edit_strength", text="Strength", icon='COLOR', toggle=True)
row.prop(md, "use_edit_thickness", text="Thickness", icon='LINE_DATA', toggle=True)
row.prop(md, "use_edit_uv", text="UV", icon='MOD_UVPROJECT', toggle=True)
def GP_SUBDIV(self, layout, ob, md):
gpd = ob.data

View File

@ -298,14 +298,14 @@ class GreasePencilSculptOptionsPanel:
brush = settings.brush
if tool in {'SMOOTH', 'RANDOMIZE'}:
layout.prop(settings, "affect_position", text="Affect Position")
layout.prop(settings, "affect_strength", text="Affect Strength")
layout.prop(settings, "affect_thickness", text="Affect Thickness")
layout.prop(settings, "use_edit_position", text="Affect Position")
layout.prop(settings, "use_edit_strength", text="Affect Strength")
layout.prop(settings, "use_edit_thickness", text="Affect Thickness")
if tool == 'SMOOTH':
layout.prop(brush, "affect_pressure")
layout.prop(brush, "use_edit_pressure")
layout.prop(settings, "affect_uv", text="Affect UV")
layout.prop(settings, "use_edit_uv", text="Affect UV")
# GP Object Tool Settings
@ -584,9 +584,9 @@ class GPENCIL_MT_pie_sculpt(Menu):
col.prop(brush, "use_falloff")
if settings.tool in {'SMOOTH', 'RANDOMIZE'}:
row = col.row(align=True)
row.prop(settings, "affect_position", text="Position", icon='MESH_DATA', toggle=True)
row.prop(settings, "affect_strength", text="Strength", icon='COLOR', toggle=True)
row.prop(settings, "affect_thickness", text="Thickness", icon='LINE_DATA', toggle=True)
row.prop(settings, "use_edit_position", text="Position", icon='MESH_DATA', toggle=True)
row.prop(settings, "use_edit_strength", text="Strength", icon='COLOR', toggle=True)
row.prop(settings, "use_edit_thickness", text="Thickness", icon='LINE_DATA', toggle=True)
# S - Change Brush Type Shortcuts
row = pie.row()

View File

@ -217,7 +217,7 @@ class TOPBAR_HT_lower_bar(Header):
)
layout.prop(context.tool_settings, "use_gpencil_draw_onback", text="", icon='ORTHO')
layout.prop(context.tool_settings, "add_gpencil_weight_data", text="", icon='WPAINT_HLT')
layout.prop(context.tool_settings, "use_gpencil_weight_data_add", text="", icon='WPAINT_HLT')
layout.prop(context.tool_settings, "use_gpencil_additive_drawing", text="", icon='FREEZE')
elif mode in {'GPENCIL_EDIT', 'GPENCIL_SCULPT', 'GPENCIL_WEIGHT'}:
layout.label(text="Layer:")

View File

@ -986,6 +986,7 @@ typedef enum eGP_EditBrush_Flag {
/* strength of brush falls off with distance from cursor */
GP_EDITBRUSH_FLAG_USE_FALLOFF = (1 << 2),
/* XXX: currently unused. */
/* smooth brush affects pressure values as well */
GP_EDITBRUSH_FLAG_SMOOTH_PRESSURE = (1 << 3),
/* enable screen cursor */

View File

@ -304,22 +304,22 @@ static void rna_def_modifier_gpencilnoise(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Random", "Use random values");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
prop = RNA_def_property(srna, "affect_position", PROP_BOOLEAN, PROP_NONE);
prop = RNA_def_property(srna, "use_edit_position", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_NOISE_MOD_LOCATION);
RNA_def_property_ui_text(prop, "Affect Position", "The modifier affects the position of the point");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
prop = RNA_def_property(srna, "affect_strength", PROP_BOOLEAN, PROP_NONE);
prop = RNA_def_property(srna, "use_edit_strength", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_NOISE_MOD_STRENGTH);
RNA_def_property_ui_text(prop, "Affect Strength", "The modifier affects the color strength of the point");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
prop = RNA_def_property(srna, "affect_thickness", PROP_BOOLEAN, PROP_NONE);
prop = RNA_def_property(srna, "use_edit_thickness", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_NOISE_MOD_THICKNESS);
RNA_def_property_ui_text(prop, "Affect Thickness", "The modifier affects the thickness of the point");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
prop = RNA_def_property(srna, "affect_uv", PROP_BOOLEAN, PROP_NONE);
prop = RNA_def_property(srna, "use_edit_uv", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_NOISE_MOD_UV);
RNA_def_property_ui_text(prop, "Affect UV", "The modifier affects the UV rotation factor of the point");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
@ -389,22 +389,22 @@ static void rna_def_modifier_gpencilsmooth(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Factor", "Amount of smooth to apply");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
prop = RNA_def_property(srna, "affect_position", PROP_BOOLEAN, PROP_NONE);
prop = RNA_def_property(srna, "use_edit_position", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_SMOOTH_MOD_LOCATION);
RNA_def_property_ui_text(prop, "Affect Position", "The modifier affects the position of the point");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
prop = RNA_def_property(srna, "affect_strength", PROP_BOOLEAN, PROP_NONE);
prop = RNA_def_property(srna, "use_edit_strength", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_SMOOTH_MOD_STRENGTH);
RNA_def_property_ui_text(prop, "Affect Strength", "The modifier affects the color strength of the point");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
prop = RNA_def_property(srna, "affect_thickness", PROP_BOOLEAN, PROP_NONE);
prop = RNA_def_property(srna, "use_edit_thickness", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_SMOOTH_MOD_THICKNESS);
RNA_def_property_ui_text(prop, "Affect Thickness", "The modifier affects the thickness of the point");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
prop = RNA_def_property(srna, "affect_uv", PROP_BOOLEAN, PROP_NONE);
prop = RNA_def_property(srna, "use_edit_uv", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_SMOOTH_MOD_UV);
RNA_def_property_ui_text(prop, "Affect UV", "The modifier affects the UV rotation factor of the point");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");

View File

@ -2432,7 +2432,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
"Show compact list of color instead of thumbnails");
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
prop = RNA_def_property(srna, "add_gpencil_weight_data", PROP_BOOLEAN, PROP_NONE);
prop = RNA_def_property(srna, "use_gpencil_weight_data_add", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gpencil_flags", GP_TOOL_FLAG_CREATE_WEIGHTS);
RNA_def_property_ui_text(prop, "Add weight data for new strokes",
"When creating new strokes, the weight data is added according to the current vertex group and weight, "

View File

@ -1143,25 +1143,25 @@ static void rna_def_gpencil_sculpt(BlenderRNA *brna)
RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
prop = RNA_def_property(srna, "affect_position", PROP_BOOLEAN, PROP_NONE);
prop = RNA_def_property(srna, "use_edit_position", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSHEDIT_FLAG_APPLY_POSITION);
RNA_def_property_ui_text(prop, "Affect Position", "The brush affects the position of the point");
RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
prop = RNA_def_property(srna, "affect_strength", PROP_BOOLEAN, PROP_NONE);
prop = RNA_def_property(srna, "use_edit_strength", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSHEDIT_FLAG_APPLY_STRENGTH);
RNA_def_property_ui_text(prop, "Affect Strength", "The brush affects the color strength of the point");
RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
prop = RNA_def_property(srna, "affect_thickness", PROP_BOOLEAN, PROP_NONE);
prop = RNA_def_property(srna, "use_edit_thickness", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSHEDIT_FLAG_APPLY_THICKNESS);
RNA_def_property_ui_text(prop, "Affect Thickness", "The brush affects the thickness of the point");
RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
prop = RNA_def_property(srna, "affect_uv", PROP_BOOLEAN, PROP_NONE);
prop = RNA_def_property(srna, "use_edit_uv", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSHEDIT_FLAG_APPLY_UV);
RNA_def_property_ui_text(prop, "Affect UV", "The brush affects the UV rotation of the point");
RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
@ -1230,7 +1230,7 @@ static void rna_def_gpencil_sculpt(BlenderRNA *brna)
RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
prop = RNA_def_property(srna, "affect_pressure", PROP_BOOLEAN, PROP_NONE);
prop = RNA_def_property(srna, "use_edit_pressure", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_EDITBRUSH_FLAG_SMOOTH_PRESSURE);
RNA_def_property_ui_text(prop, "Affect Pressure", "Affect pressure values as well when smoothing strokes");
RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);