[#20487] Small bug in 3d window's header in edit mode.

[#20713] vertex, edge and face toggling acts like shift select (in 2.49) with or without shift pressed

revert own changes from 26035
- python buttons were toggles so clicking on 1 didnt disable the others.
- for some reason the layout engine wasnt working right here and made the buttons skilly in localview.
This commit is contained in:
Campbell Barton 2010-01-30 01:25:02 +00:00
parent dd0db63a5c
commit ada9ca9687
2 changed files with 17 additions and 0 deletions

@ -56,11 +56,15 @@ class VIEW3D_HT_header(bpy.types.Header):
row.template_header_3D()
# do in C for now since these buttons cant be both toggle AND exclusive.
'''
if obj and obj.mode == 'EDIT' and obj.type == 'MESH':
row_sub = row.row(align=True)
row_sub.prop(toolsettings, "mesh_selection_mode", text="", index=0, icon='VERTEXSEL')
row_sub.prop(toolsettings, "mesh_selection_mode", text="", index=1, icon='EDGESEL')
row_sub.prop(toolsettings, "mesh_selection_mode", text="", index=2, icon='FACESEL')
'''
# Particle edit
if obj and obj.mode == 'PARTICLE_EDIT':

@ -533,4 +533,17 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
/* Scene lock */
uiItemR(layout, "", 0, &v3dptr, "lock_camera_and_layers", UI_ITEM_R_ICON_ONLY);
}
/* selection modus, dont use python for this since it cant do the toggle buttons with shift+click as well as clicking to set one. */
if(obedit && (obedit->type == OB_MESH)) {
EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data);
row= uiLayoutRow(layout, 1);
block= uiLayoutGetBlock(row);
uiDefIconButBitS(block, TOG, SCE_SELECT_VERTEX, B_SEL_VERT, ICON_VERTEXSEL, 0,0,XIC,YIC, &em->selectmode, 1.0, 0.0, 0, 0, "Vertex select mode");
uiDefIconButBitS(block, TOG, SCE_SELECT_EDGE, B_SEL_EDGE, ICON_EDGESEL, 0,0,XIC,YIC, &em->selectmode, 1.0, 0.0, 0, 0, "Edge select mode");
uiDefIconButBitS(block, TOG, SCE_SELECT_FACE, B_SEL_FACE, ICON_FACESEL, 0,0,XIC,YIC, &em->selectmode, 1.0, 0.0, 0, 0, "Face select mode");
BKE_mesh_end_editmesh(obedit->data, em);
}
}