[Bf-blender-cvs] [79ff9a0e190] blender2.8: 3D View: use 1.0 opacity for wpaint shading

Campbell Barton noreply at git.blender.org
Mon Oct 29 22:52:18 CET 2018


Commit: 79ff9a0e19018982baa6dbc9fe6c68b7819f5b9a
Author: Campbell Barton
Date:   Tue Oct 30 08:32:06 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB79ff9a0e19018982baa6dbc9fe6c68b7819f5b9a

3D View: use 1.0 opacity for wpaint shading

Now the colors are multiplied, faded color isn't useful to see weights.

Matches 2.7x behavior.

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

M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/blenloader/intern/versioning_defaults.c
M	source/blender/editors/space_view3d/space_view3d.c
M	source/blender/makesrna/intern/rna_space.c

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

diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 25c243fa589..7ae445ab476 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -1786,9 +1786,10 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
 						if (sl->spacetype == SPACE_VIEW3D) {
 							View3D *v3d = (View3D *)sl;
 							float alpha = v3d->flag2 & V3D_SHOW_MODE_SHADE_OVERRIDE ? 0.0f : 0.8f;
+							float alpha_full = v3d->flag2 & V3D_SHOW_MODE_SHADE_OVERRIDE ? 0.0f : 1.0f;
 							v3d->overlay.texture_paint_mode_opacity = alpha;
 							v3d->overlay.vertex_paint_mode_opacity = alpha;
-							v3d->overlay.weight_paint_mode_opacity = alpha;
+							v3d->overlay.weight_paint_mode_opacity = alpha_full;
 						}
 					}
 				}
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index c843ebe6765..5f4f8ddbabb 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -82,8 +82,8 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
 {
 	/* For all startup.blend files. */
 	for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
-		for (ScrArea *area = screen->areabase.first; area; area = area->next) {
-			for (ARegion *ar = area->regionbase.first; ar; ar = ar->next) {
+		for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+			for (ARegion *ar = sa->regionbase.first; ar; ar = ar->next) {
 				/* Remove all stored panels, we want to use defaults (order, open/closed) as defined by UI code here! */
 				BKE_area_region_panels_free(&ar->panels);
 
@@ -93,6 +93,16 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
 					ar->v2d.flag &= ~V2D_IS_INITIALISED;
 				}
 			}
+
+			for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+				switch (sl->spacetype) {
+					case SPACE_VIEW3D:
+					{
+						View3D *v3d = (View3D *)sl;
+						v3d->overlay.weight_paint_mode_opacity = 1.0f;
+					}
+				}
+			}
 		}
 	}
 
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index dbec52de1a1..04eec211338 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -328,7 +328,7 @@ static SpaceLink *view3d_new(const ScrArea *UNUSED(sa), const Scene *scene)
 	v3d->overlay.wireframe_threshold = 0.5f;
 	v3d->overlay.bone_select_alpha = 0.5f;
 	v3d->overlay.texture_paint_mode_opacity = 0.8;
-	v3d->overlay.weight_paint_mode_opacity = 0.8;
+	v3d->overlay.weight_paint_mode_opacity = 1.0f;
 	v3d->overlay.vertex_paint_mode_opacity = 0.8;
 	v3d->overlay.edit_flag = V3D_OVERLAY_EDIT_FACES |
 	                         V3D_OVERLAY_EDIT_SEAMS |
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 56385ee5447..53aad570c2b 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -2935,7 +2935,7 @@ static void rna_def_space_view3d_overlay(BlenderRNA *brna)
 
 	prop = RNA_def_property(srna, "weight_paint_mode_opacity", PROP_FLOAT, PROP_FACTOR);
 	RNA_def_property_float_sdna(prop, NULL, "overlay.weight_paint_mode_opacity");
-	RNA_def_property_float_default(prop, 0.8f);
+	RNA_def_property_float_default(prop, 1.0f);
 	RNA_def_property_ui_text(prop, "Weight Paint Opacity", "Opacity of the weight paint mode overlay");
 	RNA_def_property_range(prop, 0.0f, 1.0f);
 	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);



More information about the Bf-blender-cvs mailing list