left a print in and didnt account for no vgroups BPyMesh also had an error when meshW...
authorCampbell Barton <ideasman42@gmail.com>
Sun, 12 Aug 2007 01:38:12 +0000 (01:38 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 12 Aug 2007 01:38:12 +0000 (01:38 +0000)
release/scripts/bpymodules/BPyMesh.py
release/scripts/mesh_vgroup_average.py

index 70fc1a87a52faef22486182e12d54a07ce97a4f7..415c2a12c6972374f7a5542859645054405549f4 100644 (file)
@@ -56,7 +56,7 @@ def meshWeight2List(me):
        
        if not len_groupNames:
                # no verts? return a vert aligned empty list
-               return [[] for i in xrange(len(me.verts))]
+               return [[] for i in xrange(len(me.verts))], []
        
        else:
                vWeightList= [[0.0]*len_groupNames for i in xrange(len(me.verts))]
index c01a458a2989ae0ced7c8495d522c747bc45c7a6..3832bf37a965b1852d8b46a7d9139c1ca856f7b7 100644 (file)
@@ -38,11 +38,11 @@ def faceGroups2VertSets(face_groups):
 
 
 def vgroup_average(ob_orig, me, sce):
+       if not me.getVertGroupNames():
+               return
+       
        weight_names, weight_list = meshWeight2List(me)
        
-       if not weight_names:
-               return
-               
        weight_names_len = len(weight_names)
        vgroup_dummy = [0.0] * weight_names_len
        vgroup_range = range(weight_names_len)
@@ -59,7 +59,6 @@ def vgroup_average(ob_orig, me, sce):
                        weight_list[i] = collected_group        # replace with the collected group
                        
                        for j in vgroup_range: # iter through the vgroups
-                               print collected_group, vert_group[j]
                                collected_group[j] += vert_group[j]
                
                for j in vgroup_range: