Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-10-14 15:42:36 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-10-14 15:42:36 +0400
commitbca37c29d8b43f8e3cc85a435b46c4e42f55017b (patch)
tree606296b382cbc96a856a8d0ca7ce55362dba6407 /source/blender/editors/sculpt_paint
parenta00c693f995c655dc29d19e6bde1837e6d30881f (diff)
FIx #37005: Mask tool + "Area" Brush Mapping + "Anchored" Stroke = crash
Was caused by area normal calvultion using undo nodes to get coords from and undo nodes does not contain coords whe using mask tool.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 2a6b6d4b3d9..b41a2d0f4c9 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -1082,6 +1082,7 @@ static void calc_area_normal(Sculpt *sd, Object *ob, float an[3], PBVHNode **nod
float out_flip[3] = {0.0f, 0.0f, 0.0f};
SculptSession *ss = ob->sculpt;
+ const Brush *brush = BKE_paint_brush(&sd->paint);
int n, original;
/* Grab brush requires to test on original data (see r33888 and
@@ -1090,8 +1091,14 @@ static void calc_area_normal(Sculpt *sd, Object *ob, float an[3], PBVHNode **nod
TRUE : ss->cache->original);
/* In general the original coords are not available with dynamic
- * topology */
- if (ss->bm)
+ * topology
+ *
+ * Mask tool could not use undo nodes to get coordinates from
+ * since the coordinates are not stored in those odes.
+ * And mask tool is not gonna to modify vertex coordinates,
+ * so we don't actually need to use modified coords.
+ */
+ if (ss->bm || brush->sculpt_tool == SCULPT_TOOL_MASK)
original = FALSE;
(void)sd; /* unused w/o openmp */