I need to mirror my weight paint from one side to the other. The mirror modifier isn't working for me because I have existing weight paint and groups for both sides. Unfortunately it's not feasible for me to manually copy and mirror each group like what has been done in a way suggested by another answer.
But it did inspire me to put myself into the position of not yet having the other side of groups yet. I tested this theory out by deleting my 'b__L' groups then using this script:
import bpy obj = bpy.context.active_object vg = obj.vertex_groups[:] for g in vg: if not g.name.endswith('.L'): obj.vertex_groups.new(g.name+'.R') g.name = g.name+'.L' else: obj.vertex_groups.new(g.name.replace('.L', '.R'))
I added the modifier and this worked! So is there a way for the script above to be modified to:
- DELETE all starts with 'b__L' groups
- Ignore anything that doesn't start with 'b__R'
- Add suffix '.R' to groups starting with 'b__R'
- Duplicate the remaining 'b__R' groups (ignore others)
- Replace title text of duplicates ('b__R' to 'b__L')
- Change the suffix of duplicates, '.R' to '.L.'
THEN something to simply remove the suffixes finally for import to game.
I'm aware this means I will have to remember to always delete the left hand side of my model to use mirror w this. I have no experience with Python and I’ve tried making some changes myself and it’s just returning me errors. Appreciate any help.