GP: Remove Target Weight switch
This commit is contained in:
@@ -408,11 +408,7 @@ class _draw_left_context_mode:
|
|||||||
row.prop(brush, "strength", slider=True)
|
row.prop(brush, "strength", slider=True)
|
||||||
row.prop(brush, "use_pressure_strength", text="")
|
row.prop(brush, "use_pressure_strength", text="")
|
||||||
|
|
||||||
row = layout.row(align=True)
|
layout.prop(brush, "target_weight", slider=True)
|
||||||
row.prop(brush, "use_target_weight", text="", icon='WPAINT_HLT')
|
|
||||||
sub = row.row(align=True)
|
|
||||||
sub.enabled = brush.use_target_weight
|
|
||||||
sub.prop(brush, "target_weight", slider=True)
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def PARTICLE(context, layout, tool):
|
def PARTICLE(context, layout, tool):
|
||||||
|
|||||||
@@ -2276,6 +2276,20 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Grease pencil target weight */
|
||||||
|
if (!DNA_struct_elem_find(fd->filesdna, "GP_Sculpt_Settings", "float", "target_weight")) {
|
||||||
|
for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
|
||||||
|
/* sculpt brushes */
|
||||||
|
GP_Sculpt_Settings *gset = &scene->toolsettings->gp_sculpt;
|
||||||
|
if (gset) {
|
||||||
|
for (int i = 0; i < GP_SCULPT_TYPE_MAX; i++) {
|
||||||
|
GP_Sculpt_Data *gp_brush = &gset->brush[i];
|
||||||
|
gp_brush->target_weight = 1.0f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!DNA_struct_elem_find(fd->filesdna, "SceneEEVEE", "float", "overscan")) {
|
if (!DNA_struct_elem_find(fd->filesdna, "SceneEEVEE", "float", "overscan")) {
|
||||||
for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
|
for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
|
||||||
scene->eevee.overscan = 3.0f;
|
scene->eevee.overscan = 3.0f;
|
||||||
|
|||||||
@@ -911,9 +911,7 @@ static bool gp_brush_weight_apply(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* verify target weight */
|
/* verify target weight */
|
||||||
if (gso->gp_brush->flag & GP_SCULPT_FLAG_TARGET_WEIGHT) {
|
CLAMP_MAX(curweight, gso->gp_brush->target_weight);
|
||||||
CLAMP_MAX(curweight, gso->gp_brush->target_weight);
|
|
||||||
}
|
|
||||||
|
|
||||||
CLAMP(curweight, 0.0f, 1.0f);
|
CLAMP(curweight, 0.0f, 1.0f);
|
||||||
if (dw) {
|
if (dw) {
|
||||||
|
|||||||
@@ -1017,8 +1017,6 @@ typedef enum eGP_Sculpt_Flag {
|
|||||||
GP_SCULPT_FLAG_TMP_INVERT = (1 << 5),
|
GP_SCULPT_FLAG_TMP_INVERT = (1 << 5),
|
||||||
/* adjust radius using pen pressure */
|
/* adjust radius using pen pressure */
|
||||||
GP_SCULPT_FLAG_PRESSURE_RADIUS = (1 << 6),
|
GP_SCULPT_FLAG_PRESSURE_RADIUS = (1 << 6),
|
||||||
/* paint weight, define a target */
|
|
||||||
GP_SCULPT_FLAG_TARGET_WEIGHT = (1 << 7),
|
|
||||||
} eGP_Sculpt_Flag;
|
} eGP_Sculpt_Flag;
|
||||||
|
|
||||||
/* GPencil Stroke Sculpting Settings */
|
/* GPencil Stroke Sculpting Settings */
|
||||||
|
|||||||
@@ -1293,13 +1293,6 @@ static void rna_def_gpencil_sculpt(BlenderRNA *brna)
|
|||||||
RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
|
RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
|
||||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_target_weight", PROP_BOOLEAN, PROP_NONE);
|
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_SCULPT_FLAG_TARGET_WEIGHT);
|
|
||||||
RNA_def_property_ui_text(prop, "Target",
|
|
||||||
"Use predefined target weight to any point affected by the brush");
|
|
||||||
RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
|
|
||||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_pressure_strength", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_pressure_strength", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_SCULPT_FLAG_USE_PRESSURE);
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_SCULPT_FLAG_USE_PRESSURE);
|
||||||
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
|
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user