Fixed bug #23042, Sculpting + Multires + Noise texture tears mesh

Noise texture moved the edges of multires grids different, causing
tears in the mesh. Fixed with a call to re-stitch grids (but only done
if the brush texture is set to noise)
This commit is contained in:
Nicholas Bishop
2010-12-15 03:53:56 +00:00
parent 32e6f862e9
commit ff6e631c86

View File

@@ -2584,6 +2584,18 @@ static void do_radial_symmetry(Sculpt *sd, SculptSession *ss, Brush *brush, cons
}
}
/* noise texture gives different values for the same input coord; this
can tear a multires mesh during sculpting so do a stitch in this
case */
static void sculpt_fix_noise_tear(Sculpt *sd, SculptSession *ss)
{
Brush *brush = paint_brush(&sd->paint);
MTex *mtex = &brush->mtex;
if(ss->multires && mtex->tex && mtex->tex->type == TEX_NOISE)
multires_stitch_grids(ss->ob);
}
static void do_symmetrical_brush_actions(Sculpt *sd, SculptSession *ss)
{
Brush *brush = paint_brush(&sd->paint);
@@ -2614,6 +2626,9 @@ static void do_symmetrical_brush_actions(Sculpt *sd, SculptSession *ss)
sculpt_combine_proxies(sd, ss);
/* hack to fix noise texture tearing mesh */
sculpt_fix_noise_tear(sd, ss);
cache->first_time= 0;
}