ImagePaint Refactoring:

- ImagePaint now uses ImBuf directly, and the rect blending functions
  were moved into the imbuf module.
- The brush spacing, timing and sampling was abstracted into brush.c, for
  later reuse in other paint modes.

Float ImagePaint support.

Textured Brushes:
- Only the first texture channel is used now.
- Options for size and offset should be added, but need to find some space
  in the panel, or add a second one ..
This commit is contained in:
2006-07-31 15:53:03 +00:00
parent 6bc2ada6fc
commit e168d67b32
19 changed files with 1270 additions and 778 deletions

View File

@@ -1183,26 +1183,36 @@ static void test_pointer_array(FileData *fd, void **mat)
}
}
/* ************ READ BRUSH *************** */
/* ************ READ Brush *************** */
/* library brush linking after fileread */
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;
/* nothing to do yet - until brush gets textures */
for(a=0; a<MAX_MTEX; a++) {
mtex= brush->mtex[a];
if(mtex)
mtex->tex= newlibadr_us(fd, brush->id.lib, mtex->tex);
}
}
}
}
/* brush itself has been read! */
static void direct_link_brush(FileData *fd, Brush *brush)
{
/* nothing to do yet - until brush gets textures */
/* brush itself has been read */
int a;
for(a=0; a<MAX_MTEX; a++)
brush->mtex[a]= newdataadr(fd, brush->mtex[a]);
}
/* ************ READ CurveMapping *************** */
@@ -5802,7 +5812,12 @@ static void expand_texture(FileData *fd, Main *mainvar, Tex *tex)
static void expand_brush(FileData *fd, Main *mainvar, Brush *brush)
{
/* nothing to do yet - until brush gets texture */
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->clone.image);
}
static void expand_nodetree(FileData *fd, Main *mainvar, bNodeTree *ntree)

View File

@@ -1596,10 +1596,16 @@ 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)
for(brush=idbase->first; brush; brush= brush->id.next) {
if(brush->id.us>0 || wd->current) {
writestruct(wd, ID_BR, "Brush", 1, brush);
for(a=0; a<MAX_MTEX; a++)
if(brush->mtex[a])
writestruct(wd, DATA, "MTex", 1, brush->mtex[a]);
}
}
}
static void write_global(WriteData *wd)