diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-01-23 01:54:44 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-01-23 01:54:44 +0400 |
commit | cba88c17786baf83d535a051449491a083666e65 (patch) | |
tree | a7e05d41a7b72e59acef3bb56d0213b8337cfa8e /source/blender/editors/armature | |
parent | aa8fda324bfb8b224810441b4e98d625cbfda3ad (diff) |
tweak to recent commit to clamp vertex range so new empty vgroups are in fact empty.
- don't clamp if no empty groups are created
- no need to call ED_vgroup_data_create, this was very old code for weight paint r1596 - weight paint works without adding 'dvert'array.
Diffstat (limited to 'source/blender/editors/armature')
-rw-r--r-- | source/blender/editors/armature/editarmature.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index f56bf8d5dfd..4a15d73c064 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -4997,17 +4997,18 @@ void create_vgroups_from_armature(ReportList *reports, Scene *scene, Object *ob, bArmature *arm = par->data; if (mode == ARM_GROUPS_NAME) { - /* its possible there are DWeight's outside the range of the current - * objects deform groups, in this case the new groups wont be empty [#33889] */ - ED_vgroup_data_clamp_range(ob->data, BLI_countlist(&ob->defbase)); - + const int defbase_tot = BLI_countlist(&ob->defbase); + int defbase_add; /* Traverse the bone list, trying to create empty vertex * groups corresponding to the bone. */ - bone_looper(ob, arm->bonebase.first, NULL, vgroup_add_unique_bone_cb); + defbase_add = bone_looper(ob, arm->bonebase.first, NULL, vgroup_add_unique_bone_cb); - if (ob->type == OB_MESH) - ED_vgroup_data_create(ob->data); + if (defbase_add) { + /* its possible there are DWeight's outside the range of the current + * objects deform groups, in this case the new groups wont be empty [#33889] */ + ED_vgroup_data_clamp_range(ob->data, defbase_tot); + } } else if (mode == ARM_GROUPS_ENVELOPE || mode == ARM_GROUPS_AUTO) { /* Traverse the bone list, trying to create vertex groups |