diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2009-08-17 06:49:31 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2009-08-17 06:49:31 +0400 |
commit | 9d2d3a8be7c3c0b101e7f0f33bb1a04c69deaf67 (patch) | |
tree | 93345dd6c9c76d3c3052573d45e7230918a197a8 /source/blender/blenkernel/intern/paint.c | |
parent | 1e0fd0d4c14824e856424000e1122dcb1c8b44dd (diff) |
2.5 Paint:
* Converted vertex paint and weight paint to use the new Paint type
Diffstat (limited to 'source/blender/blenkernel/intern/paint.c')
-rw-r--r-- | source/blender/blenkernel/intern/paint.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index 3f6eed8528a..8e774e4c85a 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -41,17 +41,20 @@ Paint *paint_get_active(Scene *sce) { if(sce && sce->basact && sce->basact->object) { + ToolSettings *ts = sce->toolsettings; + switch(sce->basact->object->mode) { case OB_MODE_SCULPT: - return &sce->toolsettings->sculpt->paint; + return &ts->sculpt->paint; + case OB_MODE_VERTEX_PAINT: + return &ts->vpaint->paint; + case OB_MODE_WEIGHT_PAINT: + return &ts->wpaint->paint; + case OB_MODE_TEXTURE_PAINT: + break; + //return &ts->imapaint->paint; } } - /*else if(G.f & G_VERTEXPAINT) - return &sce->toolsettings->vpaint->paint; - else if(G.f & G_WEIGHTPAINT) - return &sce->toolsettings->wpaint->paint; - else if(G.f & G_TEXTUREPAINT) - return &sce->toolsettings->imapaint.paint;*/ return NULL; } @@ -137,6 +140,16 @@ int paint_facesel_test(Object *ob) } +void paint_init(Paint *p, const char *name) +{ + Brush *brush; + + /* If there's no brush, create one */ + brush = paint_brush(p); + brush_check_exists(&brush, name); + paint_brush_set(p, brush); +} + void free_paint(Paint *paint) { if(paint->brushes) |