diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2009-08-16 01:46:25 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2009-08-16 01:46:25 +0400 |
commit | b8aff064662d5c89f909c31ffac216286270d185 (patch) | |
tree | a27469c270cabd35a52ce3dbee381e5048c7d220 /source/blender/editors/sculpt_paint | |
parent | e182d653709a9abd664deaa874f0727ebba83832 (diff) |
2.5/Paint:
* Weightpaint is now object-local like sculpt and vertexpaint.
* Fixed a bug spotted by DingTo, going from editmode to sculptmode didn't fully leave editmode
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_vertex.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index b8ee2710152..8419c3fd188 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -123,7 +123,9 @@ static int vp_poll(bContext *C) static int wp_poll(bContext *C) { - if(G.f & G_WEIGHTPAINT) { + Object *ob = CTX_data_active_object(C); + + if(ob && ob->mode & OB_MODE_WEIGHT_PAINT) { ScrArea *sa= CTX_wm_area(C); if(sa->spacetype==SPACE_VIEW3D) { ARegion *ar= CTX_wm_region(C); @@ -1094,12 +1096,12 @@ static int set_wpaint(bContext *C, wmOperator *op) /* toggle */ if(me && me->totface>=MAXINDEX) { error("Maximum number of faces: %d", MAXINDEX-1); - G.f &= ~G_WEIGHTPAINT; + ob->mode &= ~OB_MODE_WEIGHT_PAINT; return OPERATOR_CANCELLED; } - if(G.f & G_WEIGHTPAINT) G.f &= ~G_WEIGHTPAINT; - else G.f |= G_WEIGHTPAINT; + if(ob->mode & OB_MODE_WEIGHT_PAINT) ob->mode &= ~OB_MODE_WEIGHT_PAINT; + else ob->mode |= OB_MODE_WEIGHT_PAINT; /* Weightpaint works by overriding colors in mesh, @@ -1109,7 +1111,7 @@ static int set_wpaint(bContext *C, wmOperator *op) /* toggle */ */ DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - if(G.f & G_WEIGHTPAINT) { + if(ob->mode & OB_MODE_WEIGHT_PAINT) { Object *par; if(wp==NULL) @@ -1612,7 +1614,7 @@ static int set_vpaint(bContext *C, wmOperator *op) /* toggle */ ob->mode |= OB_MODE_VERTEX_PAINT; /* Turn off weight painting */ - if (G.f & G_WEIGHTPAINT) + if (ob->mode & OB_MODE_WEIGHT_PAINT) set_wpaint(C, op); if(vp==NULL) |