GP: Remove Target Weight switch
authorAntonioya <blendergit@gmail.com>
Wed, 21 Nov 2018 08:03:17 +0000 (09:03 +0100)
committerAntonioya <blendergit@gmail.com>
Wed, 21 Nov 2018 08:03:17 +0000 (09:03 +0100)
release/scripts/startup/bl_ui/space_topbar.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 9303bbb47c0b206355cd2d671a8c07aa2b2d206e..8b9c47839e99496956cb4ba0bfa5eedb389be118 100644 (file)
@@ -408,11 +408,7 @@ class _draw_left_context_mode:
             row.prop(brush, "strength", slider=True)
             row.prop(brush, "use_pressure_strength", text="")
 
-            row = layout.row(align=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)
+            layout.prop(brush, "target_weight", slider=True)
 
         @staticmethod
         def PARTICLE(context, layout, tool):
index 70c8e3740969b12f9af68c1f1098b1003527f168..a28b4ae77844ddde12dbe7d9ccee15d27aa08c31 100644 (file)
@@ -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")) {
                        for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
                                scene->eevee.overscan = 3.0f;
index 84a05025cd7419576daca9bdb7c686df5bdda78d..657c3c8b9b650179502a960a9a1327d89afe5ee2 100644 (file)
@@ -911,9 +911,7 @@ static bool gp_brush_weight_apply(
        }
 
        /* 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);
        if (dw) {
index 6737420b97cb07bbd3aeb13526f4fce682da0ad2..029e8765c8d7d70410a009c17838df390e828319 100644 (file)
@@ -1017,8 +1017,6 @@ typedef enum eGP_Sculpt_Flag {
        GP_SCULPT_FLAG_TMP_INVERT = (1 << 5),
        /* adjust radius using pen pressure */
        GP_SCULPT_FLAG_PRESSURE_RADIUS = (1 << 6),
-       /* paint weight, define a target */
-       GP_SCULPT_FLAG_TARGET_WEIGHT = (1 << 7),
 } eGP_Sculpt_Flag;
 
 /* GPencil Stroke Sculpting Settings */
index 83ce1a3bb233692c994eeb4dbb9bafbd15ebbf10..d106e2db6ebaa770b3fd99633cd2825214278245 100644 (file)
@@ -1293,13 +1293,6 @@ 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, "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);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_SCULPT_FLAG_USE_PRESSURE);
        RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);