Revision: 54012
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54012
Author:   campbellbarton
Date:     2013-01-22 21:54:44 +0000 (Tue, 22 Jan 2013)
Log Message:
-----------
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.

Revision Links:
--------------
    
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=1596

Modified Paths:
--------------
    trunk/blender/source/blender/editors/armature/editarmature.c

Modified: trunk/blender/source/blender/editors/armature/editarmature.c
===================================================================
--- trunk/blender/source/blender/editors/armature/editarmature.c        
2013-01-22 21:35:33 UTC (rev 54011)
+++ trunk/blender/source/blender/editors/armature/editarmature.c        
2013-01-22 21:54:44 UTC (rev 54012)
@@ -4997,17 +4997,18 @@
        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 

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to