[Bf-blender-cvs] [55d482bf405] sculpt-mode-features: Mask tools: Fix crash with dyntopo and lasso mask

Pablo Dobarro noreply at git.blender.org
Wed Mar 20 20:35:45 CET 2019


Commit: 55d482bf405076bb2715072f67e5c15edf5bee92
Author: Pablo Dobarro
Date:   Wed Mar 20 20:35:28 2019 +0100
Branches: sculpt-mode-features
https://developer.blender.org/rB55d482bf405076bb2715072f67e5c15edf5bee92

Mask tools: Fix crash with dyntopo and lasso mask

Ignore the front facing option with dyntopo. I will properly fix this
later.

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

M	source/blender/editors/sculpt_paint/paint_mask.c

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

diff --git a/source/blender/editors/sculpt_paint/paint_mask.c b/source/blender/editors/sculpt_paint/paint_mask.c
index c08ae425395..19be5da7aa3 100644
--- a/source/blender/editors/sculpt_paint/paint_mask.c
+++ b/source/blender/editors/sculpt_paint/paint_mask.c
@@ -394,13 +394,15 @@ static void mask_gesture_lasso_task_cb(
 	const float value = data->value;
 
 	PBVHVertexIter vi;
-	float vertex_normal[3];
+	float vertex_normal[3], dp = 1;
 	bool any_masked = false;
 
 	BKE_pbvh_vertex_iter_begin(data->pbvh, node, vi, PBVH_ITER_UNIQUE) {
-		normal_short_to_float_v3(vertex_normal, vi.no);
-		float dp = dot_v3v3(lasso_data->task_data.viewDir, vertex_normal);
-		if (!lasso_data->task_data.front_faces_only) dp = 1;
+		if (BKE_pbvh_type(data->pbvh) == PBVH_FACES){
+			normal_short_to_float_v3(vertex_normal, vi.no);
+			dp = dot_v3v3(lasso_data->task_data.viewDir, vertex_normal);
+			if (!lasso_data->task_data.front_faces_only) dp = 1;
+		}
 		if (is_effected_lasso(lasso_data, vi.co) && dp > 0) {
 			if (!any_masked) {
 				any_masked = true;



More information about the Bf-blender-cvs mailing list