unintended influence

hello

when i put weight onto the vertices, i often accidentally have bones that are not suppose to influence some vertice,  so the animation looks weird,  is there a way to find out all the bones influencing a single vertice  or maybe delete all influence on a vertice so i can do it more carefully the second time?

Yes . In Edit Mode for the mesh, in the Links and Materials panel you should have vertex groups that were created when you parented the armature to the mesh or when you started to weight paint, just select the bone name (vertex groups for armatures are named after bones) from the dropdown list and hit the “Select” button . This will show you all the vertices that the selected bone influences . If you find some that you don’t want to be a part of that group, just select those and hit “Remove” and those vertices will no longer be controlled by that bone .

For future reference you can use the face select mode when you weight paint (hit F while in Weight Paint) to limit the weight painting to selected faces . This can help avoid unintentional weighting to the wrong bone .

These might be helpful. The tooltips tell you what they do.


#!BPY
"""
Name: 'Find multiple weight patches'
Blender: 241
Group: 'Mesh'
Tooltip: 'Finds and lists bones which have more than one associated patch of
non-zero weight paint separated by zero weighted vertices.'
"""

## 

import sys        
import Blender
from Blender import Mesh
from Blender import Armature as A

def collect_non_zeros(array,vert,connecteddict,weightsdict,countverts):
    if (vert in weightsdict.keys() and weightsdict[vert] > 0):
        countverts.extend([vert])
        array.extend([vert])
        for neighbor in connected[vert].keys():            
            if neighbor not in countverts: 
                collect_non_zeros(array,neighbor,connecteddict,weightsdict,countverts)

bonenames = []
arms = A.Get()
for arm in arms.values():
    bonenames.extend(arm.bones.keys())

object = Blender.Object.GetSelected()
replace = Blender.Mesh.AssignModes.REPLACE
if (len(object) == 1) & (object[0].getType() == 'Mesh'):
    mymesh = object[0]
    mymeshdata = mymesh.getData(mesh=True) 
    groups = mymeshdata.getVertGroupNames()
        connected = dict()
        bone_group_patches = dict()
        g_v_weights = dict()
        
        #collect the neighbors for each vert  
     
        for v in mymeshdata.verts:
            connected[v.index] = dict()
        for e in mymeshdata.edges:
            if not connected[e.v1.index].has_key(e.v2.index):
                connected[e.v1.index][e.v2.index] = 1
            if not connected[e.v2.index].has_key(e.v1.index):
                connected[e.v2.index][e.v1.index] = 1
                
        #collect the weights for each vert in each group
        for vgroup in groups:
            if vgroup in bonenames:
                g_v_weights[vgroup] = dict()
                gverts = mymeshdata.getVertsFromGroup(vgroup,1,)
                for gv in gverts:
                    g_v_weights[vgroup][gv[0]] = gv[1]

        for vgroup in groups:
            if vgroup in bonenames:
                countedverts = []
                bone_group_patches[vgroup] = []
                gverts = mymeshdata.getVertsFromGroup(vgroup,1,)
                for gv in gverts:            
                    if gv[0] not in countedverts:
                        bone_group_patches[vgroup].append([])
                        collect_non_zeros(bone_group_patches[vgroup][-1], gv[0],connected, g_v_weights[vgroup],countedverts)
                        if bone_group_patches[vgroup][-1] == []:
                            bone_group_patches[vgroup].pop()                
                if len(bone_group_patches[vgroup]) > 1:
                    print vgroup, ": ", len(bone_group_patches[vgroup]) , "patches found"
            
else:
    print "You must select a single mesh object"


#!BPY
"""
Name: 'Remove from bone groups'
Blender: 243
Group: 'Mesh'
Tooltip: 'Remove selected vertices from all bone vertex groups.'
"""

##remove_from_bone_groups.py removes selected vertices from all 
##bone vertex groups to which they belong (non-bone vertex group
##weights remain unchanged)

import Blender
from Blender import Mesh

object = Blender.Object.GetSelected()
for obj in object:
    if obj.getType() == 'Mesh':        
        mymesh = obj
        mymeshdata = mymesh.getData(mesh=True)
        groups = mymeshdata.getVertGroupNames()
        mods = mymesh.modifiers  
        for mod in mods:
                    if mod.type == 'ARMATURE'
                    print mod.bones.keys        
        for vgroup in groups:
             gverts = mymeshdata.getVertsFromGroup(vgroup,1)
            for v in gverts:
                                        if v.sel == 1:
                                            mymeshdata.removeVertsFromGroup(vgroup,[v[0]])
    else:
        print "Warning, selected object ", obj.name , " is not a mesh."



#!BPY
"""
Name: 'Clean Groups'
Blender: 241
Group: 'Mesh'
Tooltip: 'Remove vertices with very small weights from vertex groups.'
"""
##cleangroups.py clears all vertex groups in 
##selected objects of all vertices with a very 
##low weight (in this case below .1).
##The weight cutoff can be edited in line 24,
##and uncommenting line 23 and commenting 24 will
##remove only zero weighted vertices 
##Bugman_2000
##March 2006, Python 2.4, Blender 2.41

import Blender
from Blender import Mesh

object = Blender.Object.GetSelected()
for obj in object:
    if obj.getType() == 'Mesh':        
        mymesh = obj
        mymeshdata = mymesh.getData(mesh=True)
        groups = mymeshdata.getVertGroupNames()
        for vgroup in groups:
             gverts = mymeshdata.getVertsFromGroup(vgroup,1)
            for v in gverts:
                #if v[1] == 0:
                if v[1] < .1:
                    mymeshdata.removeVertsFromGroup(vgroup,[v[0]])
    else:
        print "Warning, selected object ", obj.name , " is not a mesh."