Cleanup: rename target_weight -> weight

Match name of mesh weight paint.
This commit is contained in:
Campbell Barton 2019-01-02 15:31:56 +11:00
parent 46a6085c47
commit 2b3effe0ce
5 changed files with 18 additions and 18 deletions

View File

@ -476,7 +476,7 @@ def brush_basic_gpencil_weight_settings(layout, context, brush, *, compact=False
layout.prop(brush, "use_falloff")
layout.prop(brush, "target_weight", slider=True)
layout.prop(brush, "weight", slider=True)
classes = (

View File

@ -2238,20 +2238,6 @@ 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")) {
for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
scene->eevee.overscan = 3.0f;
@ -2742,5 +2728,19 @@ 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", "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->weight = 1.0f;
}
}
}
}
}
}

View File

@ -914,7 +914,7 @@ static bool gp_brush_weight_apply(
}
/* verify target weight */
CLAMP_MAX(curweight, gso->gp_brush->target_weight);
CLAMP_MAX(curweight, gso->gp_brush->weight);
CLAMP(curweight, 0.0f, 1.0f);
if (dw) {

View File

@ -991,7 +991,7 @@ typedef struct GP_Sculpt_Data {
float strength; /* strength of effect */
float curcolor_add[3]; /* cursor color for add */
float curcolor_sub[3]; /* cursor color for sub */
float target_weight; /* target weight */
float weight; /* target weight */
char pad_[4];
} GP_Sculpt_Data;

View File

@ -1304,7 +1304,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, "target_weight", PROP_FLOAT, PROP_FACTOR);
prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_text(prop, "Weight", "Target weight");
RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);