diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-12-04 00:26:53 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-12-04 00:26:53 +0400 |
commit | f0b3ec33f6994f3385b5fb1142543071923b68ad (patch) | |
tree | bf078fd8bfd95c6c4c5570ed9a45fa61c02c986a /source/blender/blenkernel/intern/paint.c | |
parent | f2ae6b158913e817c0aab43eafb599af337a274e (diff) |
fix for weight paint mode drawing selected verts even when it wasnt the active object.
Diffstat (limited to 'source/blender/blenkernel/intern/paint.c')
-rw-r--r-- | source/blender/blenkernel/intern/paint.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index 56ce853bfb9..fe848f3d76c 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -90,15 +90,28 @@ void paint_brush_set(Paint *p, Brush *br) } } +/* are we in vertex paint or weight pain face select mode? */ int paint_facesel_test(Object *ob) { - return (ob && ob->type==OB_MESH && ob->data && (((Mesh *)ob->data)->editflag & ME_EDIT_PAINT_MASK) && (ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT))); + return ( (ob != NULL) && + (ob->type == OB_MESH) && + (ob->data != NULL) && + (((Mesh *)ob->data)->editflag & ME_EDIT_PAINT_MASK) && + (ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT)) + ); } +/* are we in weight paint vertex select mode? */ int paint_vertsel_test(Object *ob) { - return (ob && ob->type==OB_MESH && ob->data && (((Mesh *)ob->data)->editflag & ME_EDIT_VERT_SEL) && (ob->mode & OB_MODE_WEIGHT_PAINT)); + return ( (ob != NULL) && + (ob->type == OB_MESH) && + (ob->data != NULL) && + (((Mesh *)ob->data)->editflag & ME_EDIT_VERT_SEL) && + (ob->mode & OB_MODE_WEIGHT_PAINT) + ); } + void paint_init(Paint *p, const char col[3]) { Brush *brush; |