diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2009-08-16 00:36:15 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2009-08-16 00:36:15 +0400 |
commit | e182d653709a9abd664deaa874f0727ebba83832 (patch) | |
tree | a91df79e87cc7d7d919a7f4bc8d0e4fc6d78c24d /source/blender/editors/space_view3d/view3d_header.c | |
parent | 2b3d2b72ea157a218e1a6e49759e64de77f99850 (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/editors/space_view3d/view3d_header.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_header.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index a451dbaef63..26e2918c032 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -139,8 +139,6 @@ static void ED_toggle_paint_modes(bContext *C, int mode) { if(mode & G_TEXTUREPAINT) WM_operator_name_call(C, "PAINT_OT_texture_paint_toggle", WM_OP_EXEC_REGION_WIN, NULL); - if(mode & G_VERTEXPAINT) - WM_operator_name_call(C, "PAINT_OT_vertex_paint_toggle", WM_OP_EXEC_REGION_WIN, NULL); else if(mode & G_WEIGHTPAINT) WM_operator_name_call(C, "PAINT_OT_weight_paint_toggle", WM_OP_EXEC_REGION_WIN, NULL); @@ -155,7 +153,7 @@ int ED_view3d_exit_paint_modes(bContext *C) ED_toggle_paint_modes(C, G.f); - G.f &= ~(G_VERTEXPAINT+G_TEXTUREPAINT+G_WEIGHTPAINT+G_PARTICLEEDIT); + G.f &= ~(G_TEXTUREPAINT+G_WEIGHTPAINT+G_PARTICLEEDIT); return restore; } @@ -985,8 +983,7 @@ static void view3d_select_metaballmenu(bContext *C, uiLayout *layout, void *arg_ void uiTemplate_view3d_select_metaballmenu(uiLayout *layout, bContext *C) { void *arg_unused = NULL; - ARegion *ar= CTX_wm_region(C); - view3d_select_metaballmenu(C, ar, arg_unused); + view3d_select_metaballmenu(C, layout, arg_unused); } static void view3d_select_armaturemenu(bContext *C, uiLayout *layout, void *arg_unused) @@ -3476,7 +3473,7 @@ static void do_view3d_header_buttons(bContext *C, void *arg, int event) } } else if (v3d->modeselect == V3D_VERTEXPAINTMODE_SEL) { - if (!(G.f & G_VERTEXPAINT)) { + if (ob && !(ob->mode & OB_MODE_VERTEX_PAINT)) { v3d->flag &= ~V3D_MODE; ED_view3d_exit_paint_modes(C); ED_object_toggle_modes(C, ob->mode); @@ -3710,7 +3707,7 @@ static void view3d_header_pulldowns(const bContext *C, uiBlock *block, Object *o uiDefPulldownBut(block, view3d_wpaintmenu, NULL, "Paint", xco,yco, xmax-3, 20, ""); xco+= xmax; } - else if (G.f & G_VERTEXPAINT) { + else if (ob && ob->mode & OB_MODE_VERTEX_PAINT) { xmax= GetButStringLength("Paint"); uiDefPulldownBut(block, view3d_vpaintmenu, NULL, "Paint", xco,yco, xmax-3, 20, ""); xco+= xmax; @@ -3804,7 +3801,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) else if(ob && (ob->flag & OB_POSEMODE)) v3d->modeselect = V3D_POSEMODE_SEL; else if (ob && (ob->mode & OB_MODE_SCULPT)) v3d->modeselect = V3D_SCULPTMODE_SEL; else if (G.f & G_WEIGHTPAINT) v3d->modeselect = V3D_WEIGHTPAINTMODE_SEL; - else if (G.f & G_VERTEXPAINT) v3d->modeselect = V3D_VERTEXPAINTMODE_SEL; + else if (ob && (ob->mode & OB_MODE_VERTEX_PAINT)) v3d->modeselect = V3D_VERTEXPAINTMODE_SEL; else if (G.f & G_TEXTUREPAINT) v3d->modeselect = V3D_TEXTUREPAINTMODE_SEL; /*else if(G.f & G_FACESELECT) v3d->modeselect = V3D_FACESELECTMODE_SEL;*/ else if(G.f & G_PARTICLEEDIT) v3d->modeselect = V3D_PARTICLEEDITMODE_SEL; @@ -3814,7 +3811,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) /* not sure what the v3d->flag is useful for now... modeselect is confusing */ if(obedit) v3d->flag |= V3D_EDITMODE; if(ob && (ob->flag & OB_POSEMODE)) v3d->flag |= V3D_POSEMODE; - if(G.f & G_VERTEXPAINT) v3d->flag |= V3D_VERTEXPAINT; + if(ob && (ob->mode & OB_MODE_VERTEX_PAINT)) v3d->flag |= V3D_VERTEXPAINT; if(G.f & G_WEIGHTPAINT) v3d->flag |= V3D_WEIGHTPAINT; if (G.f & G_TEXTUREPAINT) v3d->flag |= V3D_TEXTUREPAINT; if(paint_facesel_test(ob)) v3d->flag |= V3D_FACESELECT; @@ -3860,7 +3857,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) uiBlockEndAlign(block); } } else { - if (obedit==NULL && (G.f & (G_VERTEXPAINT|G_WEIGHTPAINT|G_TEXTUREPAINT))) { + if (obedit==NULL && ((ob && ob->mode & OB_MODE_VERTEX_PAINT) || G.f & (G_WEIGHTPAINT|G_TEXTUREPAINT))) { uiDefIconButBitI(block, TOG, G_FACESELECT, B_VIEW_BUTSEDIT, ICON_FACESEL_HLT,xco,yco,XIC,YIC, &G.f, 0, 0, 0, 0, "Painting Mask (FKey)"); header_xco_step(ar, &xco, &yco, &maxco, XIC+10); } else { |