PDA

View Full Version : Way to reposition joints without smooth bind skin updating position?


TechnicallyArtistic
08-17-2010, 01:25 AM
I'm working with some legacy files and somebody made a rig where the hip joint is sorta at the bottom of the hips rather than about mid way up where they should be bending from.

Does anybody know a way where I can reposition the joints without the smooth bind adjusting the position of weighted geo? I know I could always make a copy and then copy back over the skin weights, but there's a lot of files, and I'd rather not have to go that route if possible.

mduvekot
08-17-2010, 02:53 PM
The [Animation] Skin->Edit Smooth Skin->Move Skinned Joints Tool perhaps?

TechnicallyArtistic
08-17-2010, 05:57 PM
Oh! Ha! I've never noticed that tool in there before. Thanks.

TechnicallyArtistic
08-17-2010, 06:53 PM
[EDIT] Never mind. I figured out that I had to select the mesh first so it could find the skin clusters.[EDIT]

Actually, I'm still having troubles with this tool. It seems like it works only sometimes, and I can't figure out why. Even when I have the tool selected, sometimes it's still moving the mesh when I reposition the joints and I have to do things like jump back and forth between it and the move tool, or reset the tool before it seems to start working.

As well, when I try to script the reposition, it appears to be happening like a normal translation on the joint, and takes the skin with it.

Any advice on scripting the reposition?

Morganism
08-26-2010, 12:14 AM
I do something like this:
import maya.cmds as mc

mesh = mc.ls(sl=True)[0]

#get skincluster from mesh
history = mc.listHistory(mesh)
skinCluster = mc.ls(history,type='skinCluster')

#delete bindposes:
try:
dagPose = mc.dagPose(mesh, query=True, bindPose=True)
for d in dagPose:
mc.delete(d)
except StandardError:
pass

#get the joints
joints = mc.skinCluster(skinCluster, query=True, influence=True)

#finally, the actual work. unbind and rebind
mc.skinCluster(skinCluster, edit=True, unbindKeepHistory=True)
mc.skinCluster(joints, mesh, toSelectedBones=True)


Basically, delete the bindposes, unbind keeping history, and then rebind to the same joints.

So I move the joint around, if you don't want to see the mesh move with it, just turn off the skin cluster. Then select the mesh and run this and it snaps back to default.

Hopefully that works, I didn't actually check this exact code...

CGTalk Moderation
08-26-2010, 12:14 AM
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.