2.5 Texture paint:
[blender.git] / source / blender / editors / space_buttons / buttons_context.c
index 318e0b0f5587d0c6150b5406c5b45c744468394f..6b89532cdafdb5f823ef0df20406a70029507148 100644 (file)
@@ -322,16 +322,8 @@ static int buttons_context_path_brush(const bContext *C, ButsContextPath *path)
                scene= path->ptr[path->len-1].data;
                ts= scene->toolsettings;
 
-               if(obact) {
-                       if(obact->mode & OB_MODE_SCULPT)
-                               paint_brush(&ts->sculpt->paint);
-                       else if(obact->mode & OB_MODE_VERTEX_PAINT)
-                               paint_brush(&ts->vpaint->paint);
-                       else if(obact->mode & OB_MODE_WEIGHT_PAINT)
-                               paint_brush(&ts->wpaint->paint);
-                       else if(obact->mode & OB_MODE_TEXTURE_PAINT)
-                               br= ts->imapaint.brush;
-               }
+               if(scene)
+                       br= paint_brush(paint_get_active(scene));
 
                if(br) {
                        RNA_id_pointer_create(&br->id, &path->ptr[path->len]);