[Bf-blender-cvs] [3a64d7ca48c] blender2.8: GP: Remove Target Weight switch

Antonioya noreply at git.blender.org
Wed Nov 21 09:03:25 CET 2018


Commit: 3a64d7ca48cc238c706197eebecfc19e7ec15053
Author: Antonioya
Date:   Wed Nov 21 09:03:17 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB3a64d7ca48cc238c706197eebecfc19e7ec15053

GP: Remove Target Weight switch

===================================================================

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

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index 9303bbb47c0..8b9c47839e9 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -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):
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 70c8e374096..a28b4ae7784 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -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;
diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c
index 84a05025cd7..657c3c8b9b6 100644
--- a/source/blender/editors/gpencil/gpencil_brush.c
+++ b/source/blender/editors/gpencil/gpencil_brush.c
@@ -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) {
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 6737420b97c..029e8765c8d 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -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 */
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index 83ce1a3bb23..d106e2db6eb 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -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);



More information about the Bf-blender-cvs mailing list