diff options
author | Gaia Clary <gaia.clary@machinimatrix.org> | 2013-06-16 19:44:17 +0400 |
---|---|---|
committer | Gaia Clary <gaia.clary@machinimatrix.org> | 2013-06-16 19:44:17 +0400 |
commit | 965462c183f4e5e9cb6c2e650b43f868119b1f43 (patch) | |
tree | b15c9e7cad3ab0340c744bf3b19f59d6037de3fc /source/blender/editors/space_view3d | |
parent | edfeaae9180de01df64f35c86c1f751840e4c252 (diff) |
Improved layout of Vertex Weights panel, added option to change active vgroup
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_buttons.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 8e5bd45e54d..8018be8eb95 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -1134,6 +1134,8 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa) if (dv && dv->totweight) { uiLayout *col; uiLayout *row; + uiLayout *box; + uiBut *but; bDeformGroup *dg; unsigned int i; int subset_count, vgroup_tot; @@ -1142,8 +1144,9 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa) int yco = 0; uiBlockSetHandleFunc(block, do_view3d_vgroup_buttons, NULL); + box = uiLayoutBox(pa->layout); - col = uiLayoutColumn(pa->layout, true); + col = uiLayoutColumn(box, true); vgroup_validmap = ED_vgroup_subset_from_select_type(ob, subset_type, &vgroup_tot, &subset_count); for (i = 0, dg = ob->defbase.first; dg; i++, dg = dg->next) { @@ -1153,9 +1156,24 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa) int x, xco = 0; row = uiLayoutRow(col, true); (void)row; - uiDefButF(block, NUM, B_VGRP_PNL_EDIT_SINGLE + i, dg->name, - xco, yco, (x = UI_UNIT_X * 9), UI_UNIT_Y, + + uiBlockSetEmboss(block, UI_EMBOSSN); + but = uiDefBut(block, BUT, B_VGRP_PNL_ACTIVE + i, dg->name, + xco, yco, (x = UI_UNIT_X * 5), UI_UNIT_Y, + NULL, 0.0, 1.0, 1, 3, ""); + uiButSetFlag(but, UI_TEXT_LEFT); + + if (ob->actdef != i + 1) { + uiButSetFlag(but, UI_BUT_INACTIVE); + } + xco += x; + + //uiBlockSetEmboss(block, UI_EMBOSS); + + but = uiDefButF(block, NUM, B_VGRP_PNL_EDIT_SINGLE + i, "", + xco, yco, (x = UI_UNIT_X * 4), UI_UNIT_Y, &dw->weight, 0.0, 1.0, 1, 3, ""); + uiButSetFlag(but, UI_TEXT_LEFT); xco += x; uiDefIconBut(block, BUT, B_VGRP_PNL_COPY_SINGLE + i, ICON_PASTEDOWN, @@ -1177,6 +1195,7 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa) yco -= 2; + uiBlockSetEmboss(block, UI_EMBOSS); col = uiLayoutColumn(pa->layout, true); row = uiLayoutRow(col, true); |