copying skin weights..


#1

Hi,

I’ve set up a character with a rig, and bound it all and sorted out the skin weights so it deforms reasonably. I had to make some modifications to the model, like combining all the seperate parts of it into one mesh, and now I’ve got a duplicate model that isn’t bound to the rig, but has correct UVs and is all one.

My problem is, i’d like to get it bound to the rig with exactly the same weights as the previous model. I’ve read in the docs about the copy skin weights tool, but it always gives an error, saying I haven’t selected a certain skin or something.

What are the specific steps to usng the copy skin weights tool - or is this not the right way to go about doing what i’m doing?

Anyhelp greatly appreciated!


#2

Both meshes need to be bound to the rig. Select your source mesh(the one with correct weights), shift+select your target mesh, and then use the copy weights tool.


#3

Hi , thanks for the reply!

I tried what you suggested, but it gives the error:

// Error: Must select a source and a destination skin, or components on a source and destination skin.

Both meshes are bound to the skeleton, and I selected the one with the correct weights in the outliner, then the one without the correct weights in the outliner too. Then went to copy skin weights with standard settings.

I was selecting both objects in object mode, which I’d assume is right?


#4

Yeah, object mode is right. I’m not really sure why you’re getting that error. Are you able to upload the scene file? I’ve used copy weights on many projects and never had that problem.


#5

I had this exact same issue not two days ago. I think it may be cos you are trying to select a number of seperate skins (i.e Arm one skin, legs skin, head one skin etc) and apply a set of weights that are designed to work with one whole character skin.

I couldnt get it to work at all, and in the end had to repaint the weights for the single mesh, on a rush job too :frowning:

But the benefits of having a seperate meshes for each body parts are greater i think than having just one single mesh. Unless you’re putting it into a game that is…Then its one skin city.

:smiley:


#6

Hmm… that is mighty odd. I’m not really able to upload a copy of the file, unfortunately, but perhaps somebody has had this problem and knows the solution?

I would think it’s just a slight problem with how i’m selecting the elements i want to copy between, or something like that?

Anyone else?


#7

Could you clarify something for me? You had a model that had separate pieces that were skinned to joints and now have a combined model (with merged verts?) and want to take the skinning from the separated one to the combined one? Correct?

One quick note too, you could use these zooScripts(zooWeightsSave to be exact). If you run the script on all the pieces of geometry, it will allow you to delete history, combine your meshes, even merge the vertices and reapply the weights to this new combined mesh with little fuss. May have a couple of verts to mess with but I’ved used this before many times where I had to take many skinned pieces and combine them so it was one mesh for a game engine.

-Sean


#8

Hey,

Yeah, the mesh was previously a lot of different meshes, and I skinned the lot of them, and did the weights. Then I sorted out the UVs, and combined all the pieces. Not done any vert merging, is that something i need to do?

I’ll check out those scripts, they sound like they’ll do the job exactly as I want. I’m going through all this mainly because once I sorted the UVs of the mesh, moving the joints didn’t affect the texture, so I guessed it needed rebinding. Plus there’s a lot of history that needs removing.

It’s odd that the copy weights tool doesnt just work, it seems it should be a simple command. but ill look at the zooScripts :smiley:


#9

Another way to achieve your end result would be to blendshape your uv’d and textured mesh to your original skinned mesh and just hide the skin. Also turn on World in your origin option. If you’re in a hurry, this is a quick method. Of course, your target and base meshes have to be idnetical (in which case it would be better to re-separate your combined geometry).

The second way, that is if you want to have your new geometry skinned, is as follows. First off, if you’ve combined your new geometry you’re going to have a hard time matching weights, so you might want to think of deleting the combine node (if you haven’t deleted history) and just skin your new geometry the way you skinned your old geom.Then bring your rig to it’s default pose (at the origin), then with the new geometry on top of the old geometry, go to the hypergraph and show inputs and outputs on your old geom’s skin mesh. Select all the joints connected to it then shift select your new mesh, smooth skin (make sure selected joints is on instead of hierarchy). Then unlock the transform attributes for both. Translate the orignal by a whole number in one direction and translate your new mesh in the opposite direction using the exact negative value, then set your new mesh’s appropriate scale axis to negative 1. Select you old mesh, select new mesh, mirror skin weights. After which, return both meshes to their original positions and lock transforms.


#10

yeah,… since you combined it all, “copy weights” isn’t going to work. You can use it to transfer, say,… the body,… but the rest of it needs to be reweighted.


#11

Hey again,

Thanks for the detailed suggestions, I might try that mirroring method, it sounds like that actually ought to work! Perhaps I’ve given the impression that i’m trying to copy weights from a mesh where nothing is combined, to one where everything is, but actually they’re both identical - both combined.

I’m going to have to leave this for a while, it being christmas now, but I’ll try some of these suggestions soon afterwards, and report back with how it goes.

Again thanks a lot for all the suggestions and help, really much appreciated!

:smiley:


#12

I used Zoo Scripts (zooCST in the mel box) to do this yesterday and it works a treat for what you’re describing. i didnt think that 3 button window in the zooCST Weights option would work but gosh did it work well! no tweaking required and allowed me to change bind poses over and over for use in a game engine.

Get zooCST from highend plugins. you need it in your life.


#13

i think i’ve encountered this bug before- if memory serves me correctly you can fix it by deleting all the bindPoses in your scene- they get created with every skinCluster, and as far as I’ve seen have never had a use for them.

delete ls -type "bindPose";


#14

Oh, deleting bindposes? i tried the little MEL line you posted, should I have selected the mesh then pasted that into the MEL box at the bottom? it says: // Error: Unknown object type: bindPose.

any idea what’s going on there?


#15

hey again - i decided i’d try the zoo scripts, as that’s what i’d meant to do before i went away before xmas.

got them installed and found the little skin saver box (with 3 buttons). i havent managed to get it working, so i’m just wanting to check how you use it.

currently i’ve got the 2 meshes that are the exact same geom, just one has correctly arranged UVs. both are skinned to the same joint skeleton. one (the bad UV one) has good weights, the other doesnt.

So I selected the one with good weights, and pressed the ‘store weights’ button. It went through and said it had successfully stored the weights. I then selected the new mesh, with bad weights, and pressed ‘restore weights’. it says it’s done it, but there’s no change to how the mesh deforms.

what am i doing wrong?


#16

oops sorry, it’s been awhile, the object type is ‘dagPose’ i think… don’t have maya installed at the moment:

delete ls -type "dagPose";


#17

same error as before:

// Error: Must select a source and a destination skin, or components on a source and destination skin.

hmmp :frowning:

so what about this zoo script, how exactly does it work?


#18

anyone give me a few pointers on this?


#19

Ok, lets start over here.

Q: Is the first mesh one mesh or multiple meshes?
Q: If so, is the the mesh with the good uvs a single mesh or multiple meshes?

The zooWeightSave will only save and restore weights onto the same mesh. The script saves the weight data on the actual mesh vertices. This is handy if you have weighted multiple meshes to a joint hierarchy and you want to combine the meshes and restore the weights. So you would select all the skinned meshes, hit the “save” button, delete the history on all the meshes, combine the meshes, delete history, rename the new mesh and then hit “restore” button.

Once you’ve replied there is a couple more steps I can suggest on how to transfer the weighting to the good UV mesh plus a workflow I use that will make this process a whole lot easier.


#20

Michael Comet’s cometSaveWeights works regardless of edited geometry, provided the points are roughly in the same spot. I’d recommend using it, with settings on “world position.” You’ll lose some of your weighting around edited areas, most likely, but should work.

http://www.comet-cartoons.com/melscript.php