Compatibility and robustness:

* Make masking depend on texture mode only if there's an actual texture
present
* New stroke system uses diameter to calculate stroke spacing, while old
texture painting brushes and system used radius. So divide spacing of
brushes in old files to half. Since I expect trunk users to have already
adapted this, I do this for an old subversion of blender.
This commit is contained in:
Antony Riakiotakis 2013-04-08 19:56:38 +00:00
parent 2b2099cd51
commit eaa577dfc9
2 changed files with 7 additions and 1 deletions

@ -9266,6 +9266,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
Brush *brush;
for (brush = main->brush.first; brush; brush = brush->id.next) {
default_mtex(&brush->mask_mtex);
if (brush->ob_mode & OB_MODE_TEXTURE_PAINT) {
brush->spacing /= 2;
}
}
}

@ -4158,7 +4158,9 @@ static void project_state_init(bContext *C, Object *ob, ProjPaintState *ps, int
ps->blend = brush->blend;
/* disable for 3d mapping also because painting on mirrored mesh can create "stripes" */
ps->do_masking = (brush->flag & BRUSH_AIRBRUSH || brush->mtex.brush_map_mode != MTEX_MAP_MODE_TILED) ? false : true;
ps->do_masking = (brush->flag & BRUSH_AIRBRUSH || (brush->mtex.tex &&
!ELEM(brush->mtex.brush_map_mode, MTEX_MAP_MODE_TILED, MTEX_MAP_MODE_STENCIL)))
? false : true;
ps->is_texbrush = (brush->mtex.tex && brush->imagepaint_tool == PAINT_TOOL_DRAW) ? true : false;
ps->is_maskbrush = (brush->mask_mtex.tex) ? true : false;
}