diff options
author | Gaia Clary <gaia.clary@machinimatrix.org> | 2013-06-12 14:39:27 +0400 |
---|---|---|
committer | Gaia Clary <gaia.clary@machinimatrix.org> | 2013-06-12 14:39:27 +0400 |
commit | 793e582d1a65bf2fbe285ae624916a569a8fdc17 (patch) | |
tree | 8f26fe0daebba12112897dcc079d0dd6caae4981 /source/blender | |
parent | 69153c7089e8af5a2539bd314caca11010952cff (diff) |
Vertex weight panel now uses same sort order as Vertex Group list
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_buttons.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 9d4da4c7e13..f7edb2949bc 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -70,6 +70,7 @@ #include "ED_armature.h" #include "ED_gpencil.h" +#include "ED_object.h" #include "ED_mesh.h" #include "ED_screen.h" #include "ED_transform.h" @@ -1005,8 +1006,10 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa) if (dv && dv->totweight) { uiLayout *col; bDeformGroup *dg; - MDeformWeight *dw = dv->dw; unsigned int i; + int subset_count, vgroup_tot; + bool *vgroup_validmap; + eVGroupSelect subset_type = WT_VGROUP_ALL; int yco = 0; uiBlockSetHandleFunc(block, do_view3d_vgroup_buttons, NULL); @@ -1016,16 +1019,21 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa) uiBlockBeginAlign(block); - for (i = dv->totweight; i != 0; i--, dw++) { - dg = BLI_findlink(&ob->defbase, dw->def_nr); - if (dg) { - uiDefButF(block, NUM, B_VGRP_PNL_EDIT_SINGLE + dw->def_nr, dg->name, 0, yco, 180, 20, - &dw->weight, 0.0, 1.0, 1, 3, ""); - uiDefBut(block, BUT, B_VGRP_PNL_COPY_SINGLE + dw->def_nr, "C", 180, yco, 20, 20, - NULL, 0, 0, 0, 0, TIP_("Copy this group's weight to other selected verts")); - yco -= 20; + 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) { + if (vgroup_validmap[i]) { + MDeformWeight *dw = defvert_find_index(dv, i); + if (dw) { + uiDefButF(block, NUM, B_VGRP_PNL_EDIT_SINGLE + i, dg->name, 0, yco, 180, 20, + &dw->weight, 0.0, 1.0, 1, 3, ""); + uiDefBut(block, BUT, B_VGRP_PNL_COPY_SINGLE + i, "C", 180, yco, 20, 20, + NULL, 0, 0, 0, 0, TIP_("Copy this group's weight to other selected verts")); + yco -= 20; + } } } + MEM_freeN(vgroup_validmap); + yco -= 2; uiBlockEndAlign(block); |