From 1fea6220a2418b07bec8bbf49da00cc77094076f Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Sun, 31 Mar 2013 00:38:50 +0000 Subject: Woot woot commit. Stencil style texture mapping. Ready for field testing and user feedback. This commit adds stencil like brushes, like those that existed on old ptex branch. (with the exception of clip colour) To control the position of the stencil, you use Q: translation Shift - Q: scaling Ctrl - Q: rotation There's extra work that has been done to make this work: * Support for coloured overlay in vertex/texture painting * Also made A button do stroke mode selection like in sculpt mode, when mask painting is inactive. There are some TODOs to work on during bcon3: * Support tiled and stencil mode in 2D painting. Support alpha textures also. * Tidy up overlay code. There's some confusion there due to the way we use the primary brush texture sometimes for alpha, other times for colour control. WIP design docs will be in http://wiki.blender.org/index.php/User:Psy-Fi/New_Brush_Tool_Design --- source/blender/blenloader/intern/readfile.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 682680e53c5..b605747c020 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -9077,7 +9077,18 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } if (main->versionfile < 267) { - + //if(!DNA_struct_elem_find(fd->filesdna, "Brush", "int", "stencil_pos")) { + Brush *brush; + + for (brush = main->brush.first; brush; brush = brush->id.next) { + if (brush->stencil_dimension[0] == 0) { + brush->stencil_dimension[0] = 256; + brush->stencil_dimension[1] = 256; + brush->stencil_pos[0] = 256; + brush->stencil_pos[1] = 256; + } + } + /* TIP: to initialize new variables added, use the new function DNA_struct_elem_find(fd->filesdna, "structname", "typename", "varname") example: -- cgit v1.2.3