mirror Skin weights

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  07 July 2013
mirror Skin weights

I am relatively new to ins and outs of skinning and running in to some issues trying to mirror weights.

If I select my whole skinned mesh and use mirror weights it works as expected. However I want to only mirror weights on the character's torso. So I select all the vertices in the torso and then mirror the weights. Nothing happens, the old weights on the left side are still there, no changes.

If I manually select from the mirror from side 3 vertices and then select in the exact same order on the mirror to side, the exact same mirrored vertices and then hit mirror, it works on those vertices.

So do I seriously have to select vertices in the exact same order to mirror weights when using it on selected components. That makes it unusable unless for just 1 or 2 verts. I must be doing something wrong. Is this how the tool is intended to work when working on selected verts or am I using it incorrectly? I am using maya 2013, thanks for any ideas!

Last edited by fghajhe : 07 July 2013 at 05:04 AM.
  07 July 2013
Selected verts act like a mask for the skin weight functions. Try turning on the reflection option in the selection tool settings (and choose the appropriate reflection axis) then you can easily select them on both sides simultaneously.

  07 July 2013
thank you David. I will keep that in mind. For now I have a sure method via a small script, my second in python so it could be written nicer but for now it works. To use just select the vertices you want to mirror too. What it does is perform the mirror weights on the whole mesh, then stores the new weights of the selected vertices in an array, undos the mirror weights, and reapplies the stored weights to the specified vertices.

import pymel.core as pm
sel = pm.ls(selection = True, 
flatten = True)
vi = []
for vertex in sel:
(int(vertex.rsplit("[")[-1].rsplit("]")[0]))#return the vertex indices
sCluster =  pm.listConnections(pm.ls(sl = True, o = 
True), type = 'skinCluster')#get the skinCluster of the selected 
pm.copySkinWeights(ss=sCluster[0], ds = sCluster[0], mirrorMode = 'YZ', 
surfaceAssociation = 'closestPoint',  influenceAssociation = 
ji = [] #jointIndices
weight = []  
for i in vi: #copy weights
pm.getAttr( sCluster[0]+'.wl[' + str(i) + '].w' , mi = True) 
	weight.append( pm.getAttr( sCluster[0]+'.wl[' + str(i) + 
'].w') )
	##pm.getAttr( sCluster[0]+'.wl[' + i + '].w' , mi 
= True) 
for i in vi: #paste weights
tempJi = pm.getAttr( sCluster[0]+'.wl[' + str(i) + '].w' , mi = 
	for t in tempJi: #zeroOut joint 
sCluster[0]+'.wl[' + str(i) + '].w['+ str(t)+']', 0 
for i in 
range(len(vi)): #paste weights	
	for w in 
range(len(weight[i])): #paste stored 
sCluster[0]+'.wl[' + str(vi[i]) + '].w['+ str(ji[i][w])+']', 
  07 July 2013
Its great that you can write such a script, but I think the best advice I can give is... don't even bother with maya's skin weights tool. The ngSkinTools plugin is much, much better. You should look it up and give it a try. And if you are into scripting you can take advantage of the ngSkinTools api to automate certain parts of the process.

  07 July 2013
wow that's awesome, many thanks for the heads up. I will check that out!
  07 July 2013
actually there is a bug in maya 2013, 2013.5 and 2014. but it seems to be fixed in maya2014 SP1 now ( according to the "whats fixed" in the release notes )

the bug only happens , when you have components selected and just want to mirror certain vertecies

how it works anyways ( workaround ):
- after you do a mirrorWeights ( via the UI ) , make an UNDO
- then take a look in the script editor ( since this seems to be an UI_bug ) .
- there you find the exact MEL-command , that was called.

copySkinWeights -ss skinCluster1 -ds skinCluster1 -mirrorMode YZ -mirrorInverse -surfaceAssociation closestPoint -influenceAssociation closestJoint;

- now just copy and paste the command , and call it manually in your scripteditor . it should work then .

so no need for a script here . at least it worked for me , that way . during a heavy skinning-job i did lately .

it is actually a really annoying bug ..... and the solution is super-simple , you just have to know it.

wow , seems , like i am wrong .... sorry

Last edited by tonytouch : 07 July 2013 at 05:57 PM.
  07 July 2013
Thank you for the idea but that function just performs a mirror on the whole mesh, not selected components (at least for me in maya 2013 prior to bug fix). Perhaps your mesh was for the most part symmetrical so it appeared to only affect the selection. No worries though I have finished the skinning. Thanks again!
  07 July 2013
holy crap .... guess this was wrong

Last edited by tonytouch : 07 July 2013 at 05:55 PM.
  07 July 2013
ok ---- i guess i was wrong , sorry .
  07 July 2013
hey - no problem. What I like about this forum is people are always trying to be helpful.
  07 July 2013
I always make sure my character is at 0,0,0 standing on the ground plane with Maya's default cm units,...... and weight skin on one side. I do the right side...... And mirror a symmetrical character's weights from that.
If you skinned multiple meshes on the bind pose, go to frame zero and delete the {outdated} bind pose. (which deletes the bind pose matrix for your multiple objects which you originally bound)
This should reset the skin bind for the 'separate' objects, but not destroy it.
Try mirror from that.
  07 July 2013
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 05:55 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.