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
path: root/source
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-02-17 10:59:32 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-02-17 10:59:32 +0400
commit283ab431a50e89643eb496c934584e29e118b812 (patch)
treeeed64f1d3db84ced468fa8d48c6237af0fd2b860 /source
parenta56eeb70247e55ac15239c70b8ade4c3567b798f (diff)
Cleanup of 3D viewport header in painting modes:
- Hide Manipulate center points in sculpt and particle edit modes - Hide 3D manipulators and orientation from sculpt mode - Hide snap buttons in sculpt, weight, texture, vertex and particle painting modes All this options weren't make sense in this modes and might only confuse user. This will resolve issue #30180: 3D View header buttons and modes
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/space_view3d/view3d_header.c30
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 e9b339c0baf..8acfd43f3ed 100644
--- a/source/blender/editors/space_view3d/view3d_header.c
+++ b/source/blender/editors/space_view3d/view3d_header.c
@@ -478,6 +478,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);
@@ -492,6 +493,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;
@@ -504,20 +507,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;