diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-02-17 19:51:48 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-02-17 19:51:48 +0400 |
commit | 4c66e696fbcaefe40f0394fea8fc4a55bb7d6994 (patch) | |
tree | e8f60920e276ec1fec3c8014b77790a6c790deba /source/blender/editors/space_view3d | |
parent | 02987fd5e1fa3715d25bb7b9bd659fd509f40c57 (diff) | |
parent | b7f3887a3a8a66aeba3a16ae5d76b934af3ccc7c (diff) |
svn merge ^/trunk/blender -r44136:44189
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_header.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 60da368321f..61f08a84ac7 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -473,6 +473,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) uiBut *but; uiLayout *row; const float dpi_fac= UI_DPI_FAC; + int is_paint = 0; RNA_pointer_create(&screen->id, &RNA_SpaceView3D, v3d, &v3dptr); RNA_pointer_create(&scene->id, &RNA_ToolSettings, ts, &toolsptr); @@ -487,6 +488,8 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) /* mode */ if(ob) { v3d->modeselect = ob->mode; + is_paint = ELEM5(ob->mode, OB_MODE_SCULPT, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, + OB_MODE_TEXTURE_PAINT, OB_MODE_PARTICLE_EDIT); } else { v3d->modeselect = OB_MODE_OBJECT; @@ -499,20 +502,21 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) /* Draw type */ uiItemR(layout, &v3dptr, "viewport_shade", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); - if (obedit==NULL && ((ob && ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT)))) { - /* Manipulators aren't used in weight paint mode */ - - PointerRNA meshptr; + if (obedit==NULL && is_paint) { + /* Manipulators aren't used in paint modes */ + if (!ELEM(ob->mode, OB_MODE_SCULPT, OB_MODE_PARTICLE_EDIT)) { + /* masks aren't used for sculpt and particle painting */ + PointerRNA meshptr; - RNA_pointer_create(&ob->id, &RNA_Mesh, ob->data, &meshptr); - if(ob->mode & (OB_MODE_TEXTURE_PAINT|OB_MODE_VERTEX_PAINT)) { - uiItemR(layout, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); - } - else { - - row= uiLayoutRow(layout, 1); - uiItemR(row, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); - uiItemR(row, &meshptr, "use_paint_mask_vertex", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); + RNA_pointer_create(&ob->id, &RNA_Mesh, ob->data, &meshptr); + if(ob->mode & (OB_MODE_TEXTURE_PAINT|OB_MODE_VERTEX_PAINT)) { + uiItemR(layout, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); + } + else { + row= uiLayoutRow(layout, 1); + uiItemR(row, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); + uiItemR(row, &meshptr, "use_paint_mask_vertex", UI_ITEM_R_ICON_ONLY, "", ICON_NONE); + } } } else { const char *str_menu; |