CGTalk > Software > Autodesk Maya > Maya Character Setup
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 07-08-2013, 05:00 AM   #1
fghajhe
student
portfolio
fghajhe
United States Minor Outlying Islands
 
Join Date: Jul 2008
Posts: 203
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-08-2013 at 05:04 AM.
 
Old 07-10-2013, 01:01 PM   #2
djx
Where's my pony?
 
djx's Avatar
David Johnson
vfx & creature td
Melbourne, Australia
 
Join Date: Jun 2003
Posts: 3,464
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.

David
__________________
http://www.djx.com.au
 
Old 07-10-2013, 01:42 PM   #3
fghajhe
student
portfolio
fghajhe
United States Minor Outlying Islands
 
Join Date: Jul 2008
Posts: 203
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.


Code:
import pymel.core as pm sel = pm.ls(selection = True, flatten = True) vi = [] for vertex in sel: vi.append (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 Mesh pm.copySkinWeights(ss=sCluster[0], ds = sCluster[0], mirrorMode = 'YZ', surfaceAssociation = 'closestPoint', influenceAssociation = 'closestJoint') ji = [] #jointIndices weight = [] #weightValues for i in vi: #copy weights ji.append( 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) pm.undo() for i in vi: #paste weights tempJi = pm.getAttr( sCluster[0]+'.wl[' + str(i) + '].w' , mi = True) for t in tempJi: #zeroOut joint influences pm.setAttr( 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 weights pm.setAttr( sCluster[0]+'.wl[' + str(vi[i]) + '].w['+ str(ji[i][w])+']', weight[i][w])
 
Old 07-10-2013, 02:59 PM   #4
djx
Where's my pony?
 
djx's Avatar
David Johnson
vfx & creature td
Melbourne, Australia
 
Join Date: Jun 2003
Posts: 3,464
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.

David
__________________
http://www.djx.com.au
 
Old 07-10-2013, 03:11 PM   #5
fghajhe
student
portfolio
fghajhe
United States Minor Outlying Islands
 
Join Date: Jul 2008
Posts: 203
wow that's awesome, many thanks for the heads up. I will check that out!
 
Old 07-12-2013, 03:38 PM   #6
tonytouch
it is a misery
 
tonytouch's Avatar
Simon Leykamm
Munich, DE
 
Join Date: Oct 2004
Posts: 325
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.

e.g.
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.





----------
@edit:
wow , seems , like i am wrong .... sorry

Last edited by tonytouch : 07-13-2013 at 05:57 PM.
 
Old 07-12-2013, 03:59 PM   #7
fghajhe
student
portfolio
fghajhe
United States Minor Outlying Islands
 
Join Date: Jul 2008
Posts: 203
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!
 
Old 07-13-2013, 01:48 PM   #8
tonytouch
it is a misery
 
tonytouch's Avatar
Simon Leykamm
Munich, DE
 
Join Date: Oct 2004
Posts: 325
@edit:
holy crap .... guess this was wrong

Last edited by tonytouch : 07-13-2013 at 05:55 PM.
 
Old 07-13-2013, 05:55 PM   #9
tonytouch
it is a misery
 
tonytouch's Avatar
Simon Leykamm
Munich, DE
 
Join Date: Oct 2004
Posts: 325
ok ---- i guess i was wrong , sorry .
 
Old 07-13-2013, 06:57 PM   #10
fghajhe
student
portfolio
fghajhe
United States Minor Outlying Islands
 
Join Date: Jul 2008
Posts: 203
hey - no problem. What I like about this forum is people are always trying to be helpful.
 
Old 07-14-2013, 06:22 AM   #11
refract
Expert
 
refract's Avatar
portfolio
John John
Character modeling, Lighting, Compositing
Work
Los Angeles, United States
 
Join Date: Mar 2003
Posts: 714
Send a message via ICQ to refract Send a message via AIM to refract Send a message via MSN to refract Send a message via Yahoo to refract
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.
 
Old 07-14-2013, 06:22 AM   #12
CGTalk Moderation
Expert
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,478
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
CGSociety
Society of Digital Artists
www.cgsociety.org

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

All times are GMT. The time now is 12:23 AM.


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