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.
This commit is contained in:
Sergey Sharybin
2013-10-14 11:42:36 +00:00
parent a00c693f99
commit bca37c29d8

View File

@@ -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 */