Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Bishop <nicholasbishop@gmail.com>2009-08-16 00:36:15 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2009-08-16 00:36:15 +0400
commite182d653709a9abd664deaa874f0727ebba83832 (patch)
treea91df79e87cc7d7d919a7f4bc8d0e4fc6d78c24d /source/blender/blenkernel/intern/brush.c
parent2b3d2b72ea157a218e1a6e49759e64de77f99850 (diff)
2.5/Vertex paint:
* Made vertex paint local to object, like sculpt mode. * New test for vertex paint is (ob->mode & OB_MODE_VERTEX_PAINT)
Diffstat (limited to 'source/blender/blenkernel/intern/brush.c')
-rw-r--r--source/blender/blenkernel/intern/brush.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index eddca8d0073..392872dafd1 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -188,10 +188,14 @@ void make_local_brush(Brush *brush)
Brush **current_brush_source(Scene *sce)
{
- if(sce->basact && sce->basact->object->mode & OB_MODE_SCULPT)
- return &sce->toolsettings->sculpt->brush;
- else if(G.f & G_VERTEXPAINT)
- return &sce->toolsettings->vpaint->brush;
+ Object *ob = sce->basact ? sce->basact->object : NULL;
+
+ if(ob) {
+ if(ob->mode & OB_MODE_SCULPT)
+ return &sce->toolsettings->sculpt->brush;
+ else if(ob->mode & OB_MODE_VERTEX_PAINT)
+ return &sce->toolsettings->vpaint->brush;
+ }
else if(G.f & G_WEIGHTPAINT)
return &sce->toolsettings->wpaint->brush;
else if(G.f & G_TEXTUREPAINT)