Cleanup: rename target_weight -> weight
authorCampbell Barton <ideasman42@gmail.com>
Wed, 2 Jan 2019 04:31:56 +0000 (15:31 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 2 Jan 2019 04:31:56 +0000 (15:31 +1100)
Match name of mesh weight paint.

release/scripts/startup/bl_ui/properties_paint_common.py
source/blender/blenloader/intern/versioning_280.c
source/blender/editors/gpencil/gpencil_brush.c
source/blender/makesdna/DNA_scene_types.h
source/blender/makesrna/intern/rna_sculpt_paint.c

index 32c5acdf3b787fdf221922d543c656685368e115..f36e5616c6e8ff637292227f2fbb00ac6e274fbe 100644 (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 = (
index f81705a2c6132f833a186a55ad761ab53e84eb0b..85dfbdd1fec4942463eae58637e719236c2f32d1 100644 (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;
+                                       }
+                               }
+                       }
+               }
        }
 }
index 95644bd690ce42e19435d5b0460c1425d1a62d4a..412330ccf5c8c43d369b8821cfd71f6a4c7ab4e1 100644 (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) {
index d100449c3536dfd44ab93e499e477bf6fa9af58f..5721dbfade0c077c6fb0a1e0dfe9ca0d3604b7d7 100644 (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;
 
index bfd4b71daf5fb6b183023382b31a9d21a337c333..581b0e94aad19c7cfe416f5fa2bb85dba1b00aba 100644 (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);