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:
authorCampbell Barton <ideasman42@gmail.com>2011-12-04 00:26:53 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-12-04 00:26:53 +0400
commitf0b3ec33f6994f3385b5fb1142543071923b68ad (patch)
treebf078fd8bfd95c6c4c5570ed9a45fa61c02c986a /source/blender/blenkernel/intern/paint.c
parentf2ae6b158913e817c0aab43eafb599af337a274e (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.c17
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;