diff options
author | Matt Ebb <matt@mke3.net> | 2010-01-03 11:37:18 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-01-03 11:37:18 +0300 |
commit | 251ef0a47f34806b911ab18b59f604dd0ef3ea5b (patch) | |
tree | 23574564a0d36337c8d2338197c1527cc77e76ca /source/blender/blenloader | |
parent | ca4a5f309eed9922eb7d5188173942f36a5adc0d (diff) |
Changes to Brush texture workflow
This changes how textures are accessed from Brushes, with the intention of simplifying
the workflow, and reducing the amount of clicking. Rather than the previous texture slots
(which didn't work as a stack anyway), brushes now have a single texture linked. Rather
than taking time having to set up your slots in advance, you can now select and change
textures directly as you sculpt/paint on the fly. For complex brushes, node textures can
be used, or for fast access, it's easy to make a duplicate of your brush with the texture
you like and assign a hotkey.
Brush textures can now be chosen from a new Textures panel in the brush tool
properties - click on the thumbnail to open a texture selector. This is done using a new
variation on the ID template - the number of rows and columns to display in the popup
can be customised in the UI scripts.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 27 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 6 |
2 files changed, 9 insertions, 24 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index de9841ec1c7..18fc7b8e3be 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1532,22 +1532,13 @@ static void direct_link_curvemapping(FileData *fd, CurveMapping *cumap) static void lib_link_brush(FileData *fd, Main *main) { Brush *brush; - MTex *mtex; - int a; /* only link ID pointers */ for(brush= main->brush.first; brush; brush= brush->id.next) { if(brush->id.flag & LIB_NEEDLINK) { brush->id.flag -= LIB_NEEDLINK; - brush->clone.image= newlibadr_us(fd, brush->id.lib, brush->clone.image); - - for(a=0; a<MAX_MTEX; a++) { - mtex= brush->mtex[a]; - if(mtex) - mtex->tex= newlibadr_us(fd, brush->id.lib, mtex->tex); - } - + brush->mtex.tex= newlibadr_us(fd, brush->id.lib, brush->mtex.tex); brush->clone.image= newlibadr_us(fd, brush->id.lib, brush->clone.image); } } @@ -1556,10 +1547,6 @@ static void lib_link_brush(FileData *fd, Main *main) static void direct_link_brush(FileData *fd, Brush *brush) { /* brush itself has been read */ - int a; - - for(a=0; a<MAX_MTEX; a++) - brush->mtex[a]= newdataadr(fd, brush->mtex[a]); /* fallof curve */ brush->curve= newdataadr(fd, brush->curve); @@ -10336,6 +10323,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) if (1) { Scene *sce; Object *ob; + Brush *brush; /* game engine changes */ for(sce = main->scene.first; sce; sce = sce->id.next) { @@ -10393,6 +10381,11 @@ static void do_versions(FileData *fd, Library *lib, Main *main) avs->path_step= arm->pathsize; } } + + /* brush texture changes */ + for (brush= main->brush.first; brush; brush= brush->id.next) { + default_mtex(&brush->mtex); + } } /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ @@ -10891,11 +10884,7 @@ static void expand_texture(FileData *fd, Main *mainvar, Tex *tex) static void expand_brush(FileData *fd, Main *mainvar, Brush *brush) { - int a; - - for(a=0; a<MAX_MTEX; a++) - if(brush->mtex[a]) - expand_doit(fd, mainvar, brush->mtex[a]->tex); + expand_doit(fd, mainvar, brush->mtex.tex); expand_doit(fd, mainvar, brush->clone.image); } diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 3373cc1ca71..98d3dc5188a 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2317,16 +2317,12 @@ static void write_nodetrees(WriteData *wd, ListBase *idbase) static void write_brushes(WriteData *wd, ListBase *idbase) { Brush *brush; - int a; for(brush=idbase->first; brush; brush= brush->id.next) { if(brush->id.us>0 || wd->current) { writestruct(wd, ID_BR, "Brush", 1, brush); if (brush->id.properties) IDP_WriteProperty(brush->id.properties, wd); - for(a=0; a<MAX_MTEX; a++) - if(brush->mtex[a]) - writestruct(wd, DATA, "MTex", 1, brush->mtex[a]); - + if(brush->curve) write_curvemapping(wd, brush->curve); } |