[Bf-blender-cvs] [4be1a79a14d] soc-2017-normal-tools: Partially revert "Fixed vertex groups not respected with keep sharp in modifier."

Bastien Montagne noreply at git.blender.org
Sun Mar 11 11:39:00 CET 2018


Commit: 4be1a79a14d4fa893ec1a78d1b47833b8f378015
Author: Bastien Montagne
Date:   Sun Mar 11 10:57:43 2018 +0100
Branches: soc-2017-normal-tools
https://developer.blender.org/rB4be1a79a14d4fa893ec1a78d1b47833b8f378015

Partially revert "Fixed vertex groups not respected with keep sharp in modifier."

This reverts some changes from commit a7a4beecb208d12a00d550e3ebf4e2a37730fa6b.

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

M	release/datafiles/locale
M	release/scripts/addons
M	release/scripts/addons_contrib
M	source/blender/modifiers/intern/MOD_weighted_normal.c
M	source/tools

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

diff --git a/release/datafiles/locale b/release/datafiles/locale
index 59495b4b590..d3349b42856 160000
--- a/release/datafiles/locale
+++ b/release/datafiles/locale
@@ -1 +1 @@
-Subproject commit 59495b4b59077aa1cc68fffbdae1463af980f08e
+Subproject commit d3349b42856d00c278f72f2a5909a6c96b9cdb5e
diff --git a/release/scripts/addons b/release/scripts/addons
index 27970761a18..827c5e62e8f 160000
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit 27970761a18926abe1b0020aa350305e3109a537
+Subproject commit 827c5e62e8f121f8f946f1f5f514f7751b1d684a
diff --git a/release/scripts/addons_contrib b/release/scripts/addons_contrib
index 6a4f93c9b8f..310578043de 160000
--- a/release/scripts/addons_contrib
+++ b/release/scripts/addons_contrib
@@ -1 +1 @@
-Subproject commit 6a4f93c9b8f36b19bd02087abf3d7f5983df035a
+Subproject commit 310578043dec1aae382eb6a447ae1d103792d7e6
diff --git a/source/blender/modifiers/intern/MOD_weighted_normal.c b/source/blender/modifiers/intern/MOD_weighted_normal.c
index 8dc009e86a3..ffd16397c59 100644
--- a/source/blender/modifiers/intern/MOD_weighted_normal.c
+++ b/source/blender/modifiers/intern/MOD_weighted_normal.c
@@ -177,7 +177,6 @@ static void apply_weights_sharp_loops(
 	zero_v3(wn_data->vert_normals[0]);
 	wn_data->vert_loops_count[0] = 0;
 	wn_data->curr_vert_val[0] = 0.0f;
-
 	if (has_face_influence) {
 		wn_data->curr_vert_strength[0] = FACE_STRENGTH_WEAK;
 	}
@@ -316,7 +315,7 @@ static void aggregate_vertex_normal(
 	const bool has_vgroup = dvert != NULL;
 	const bool vert_of_group = has_vgroup && defvert_find_index(&dvert[mv_index], defgrp_index) != NULL;
 
-	if (has_vgroup && ((vert_of_group && !use_invert_vgroup) || (vert_of_group && !use_invert_vgroup))) {
+	if (has_vgroup && ((vert_of_group && use_invert_vgroup) || (!vert_of_group && !use_invert_vgroup))) {
 		return;
 	}
 
@@ -440,8 +439,7 @@ static void apply_weights_vertex_normal(WeightedNormalModifierData *wnmd, Weight
 		 * will generate it for us if we don't have it yet. */
 		if (loop_to_poly == NULL) {
 			loop_to_poly_mem = MEM_malloc_arrayN((size_t)numLoops, sizeof(*loop_to_poly_mem), __func__);
-			loop_to_poly = loop_to_poly_mem;
-			wn_data->loop_to_poly = loop_to_poly;
+			wn_data->loop_to_poly = loop_to_poly = loop_to_poly_mem;
 		}
 
 		BKE_mesh_normals_loop_split(mvert, numVerts, medge, numEdges, mloop, loop_normal, numLoops, mpoly, polynors,
@@ -510,21 +508,14 @@ static void apply_weights_vertex_normal(WeightedNormalModifierData *wnmd, Weight
 					int *e2l_curr = edge_to_loops[ml_curr->e];
 					int *e2l_prev = edge_to_loops[ml_prev->e];
 
-					const bool use_invert_vgroup = wn_data->use_invert_vgroup;
-					const int defgrp_index = wn_data->defgrp_index;
-					const bool vert_of_group = has_vgroup && defvert_find_index(&dvert[mloop[ml_curr_index].v], defgrp_index) != NULL;
-					/* Check for vertex groups before proceeding, not sure how to make this cleaner */
-
-					if (has_vgroup && ((vert_of_group && !use_invert_vgroup) || (!vert_of_group && use_invert_vgroup))) {
-						if (IS_EDGE_SHARP(e2l_curr)) {
-							if (IS_EDGE_SHARP(e2l_curr) && IS_EDGE_SHARP(e2l_prev)) {
-								loop_split_worker(wnmd, wn_data, ml_curr, ml_prev, ml_curr_index, -1, NULL,
-									mp_index, loop_normal, edge_to_loops);
-							}
-							else {
-								loop_split_worker(wnmd, wn_data, ml_curr, ml_prev, ml_curr_index, ml_prev_index, e2l_prev,
-									mp_index, loop_normal, edge_to_loops);
-							}
+					if (IS_EDGE_SHARP(e2l_curr)) {
+						if (IS_EDGE_SHARP(e2l_curr) && IS_EDGE_SHARP(e2l_prev)) {
+							loop_split_worker(wnmd, wn_data, ml_curr, ml_prev, ml_curr_index, -1, NULL,
+							                  mp_index, loop_normal, edge_to_loops);
+						}
+						else {
+							loop_split_worker(wnmd, wn_data, ml_curr, ml_prev, ml_curr_index, ml_prev_index, e2l_prev,
+							                  mp_index, loop_normal, edge_to_loops);
 						}
 					}
 					ml_prev = ml_curr;
@@ -670,10 +661,12 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *dm,
 
 	bool free_polynors = false;
 
-	/* Right now if wnmd->weight = 50 then all faces are given equal weight
-	   If weight > 50 then more weight given to faces with larger vals (face area / corner angle)
-	   If weight < 50 then more weight given to faces with lesser vals. However current calculation
-	   does not converge to min/max */
+	/* Right now:
+	 * If weight = 50 then all faces are given equal weight.
+	 * If weight > 50 then more weight given to faces with larger vals (face area / corner angle).
+	 * If weight < 50 then more weight given to faces with lesser vals. However current calculation
+	 * does not converge to min/max.
+	 */
 	float weight = ((float)wnmd->weight) / 50.0f;
 	if (wnmd->weight == 100) {
 		weight = (float)SHRT_MAX;
diff --git a/source/tools b/source/tools
index 88a1758d2d2..7695e14cfc5 160000
--- a/source/tools
+++ b/source/tools
@@ -1 +1 @@
-Subproject commit 88a1758d2d2e862cc69c08b5b40a4e75f71592d3
+Subproject commit 7695e14cfc5820ac66546e0e515914d85ab81af3



More information about the Bf-blender-cvs mailing list