copying skin weights..


#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


#21

hi again,

thanks both of you, after reading your posts I thought I’d have this sorted.

I was trying to restore the stored weights on an (admitedly identical) other mesh, so that’s clearly why i was having no success with the zooscript. So I stored the weights for the mesh, then deleted its history. I deleted history so that it wouldnt be bound to the joints anymore, possibly this isnt the best way to do this? anyway, once i’d done that I restored the weights with zoo. but it doesnt work properly at all, only some of the joints actually influence the mesh, and they don’t influence it right at all, it’s pretty weird.

so i tried the comet script, but when i try to load the geom into the weight save script box it says ‘// Error: Cannot find procedure “libSkin_getSkinFromGeo”.’ I checked his site again, and he says he doesnt support any versions over v8, so I guess that wont work anyway with me.

so, hm… for what seemed a few weeks ago like such a simple task, this sure is proving hard!

as one of you asked, ill tell you what exactly i’m trying to do.

i have a model skinned to a skeleton, and i’ve changed the weights so i’m happy with them. i then sorted out the UVs for this mesh, but found that having done so, when i move an IK handle around, the texture goes crazy - it doesnt stay as it should according to the UV mapping.

So what i need to do is rebind the mesh to the joints, but i dont want to have to do all the weightings again. there be the problem :frowning:


#22

He doesn’t support anything above Maya 8, mostly because he now works for Disney (IIRC correctly), and because people kept bugging him to recompile poseDeformer. But MEL is MEL. There are scripts around from Maya 4.5 that still work fine today.

Make sure you copy all the MEL files in the archive (download his whole package of scripts) into a spot where Maya can find them. You can’t just source the main file – it has to be able to find libSkin, which is used by a few of his tools.

When you get a message like that, you should check the log to see if a source statement failed or read through the script to see if it sources other MEL files that aren’t in your include path. (If you’re not a programmer but are using Maya, you’ll become a programmer. Mr. Smith voice It’s inevitable.)

As for your issue, I actually ran into that at work too. First rule is to not rig until you have proper UVs. :wink: But yeah, save the weights with Comet’s script (just keep at it and you’ll get it working), then detach the skin and delete history, making sure the UVs held. Rebind the skin to the same joints (if you’re unsure which, Comet’s tool has a function to select the joints mentioned in the file), and re-apply the weights through cometSaveWeights.

I’ve been using the tool for about a year now and it hasn’t failed me once. You just need to find the workflow.


#23

hey again man,

thanks a lot for your help once again :slight_smile:

unfortunately this problem isnt any closer to getting solved… I checked and double checked that the libSkin.mel script is in the same directory (the scripts one) as all the rest of comet’s scripts, and still it says it can’t find the procedure '“libSkin_getSkinFromGeo”. I checked the script itself, it’s just looking in the source folder for the file, it’s all correctly named, etc. For some reason it just doesn’t find what’s in libSkin.mel…

I found another weight saving script, but that one didn’t work either. I have to assume I’m doing something fundamentally wrong here, like selecting the wrong objects or something. The zooCST script seems like it should work fine, as I select the mesh that’s skinned and press store weights, and the progress bar fills up as it stores them. It just doesn’t manage to put them back on correctly, as I described a few posts ago.

This is getting to the point where I’m going to have to give up and re-weight the whole thing… Which considering how annoying Maya’s weight painting tools can be, I don’t much fancy… :frowning:


#24

have you tried maya’s standard skin weight exporter? I believe you can get to it under the paint tool under export…? It’s not particularly efficient, as it creates an image for every joint, and the image resolution needs to be large depending on your model. I usually use it starting out with 2048x2048 and go up if it looks like I’ve lost accuracy. also need to make sure your model does not have overlapping UVs. if it hasn’t been uv’d yet an automatic mapping will solve that.

If your meshes are identical why do you need to copy weights from one to the other?

If i have some time today at work I’ll try gettin’ comet to work. I remember running into the same problem a while back… had to make a small change to one of the scripts I think to get it to run properly-


#25

I think te problem with zooWeightSave is that you may be perhaps changing the bone structure? i had trouble gettin the weights to restore if i added another bone to the mesh. I think the way weights are recorded is by loggin how each bone effects each vertex clump?

Thast the impression i got from it anyway so t might be wrong, but i know for sure that if you change your bone structure when re-binding it will fail


#26

I’ll try and create a quick video of how to solve this issue this weekend and post it here. I’ll show a step by step process.

Now here is a workflow you can use in the future that can help.
Instead of having the mesh and joints in the same file, you would have them in separate files.
In maya you would create a new scene and then reference both of them in. Do your skinning here with these both referenced. Now if you mesh file gets updated with new UV’s, the scene with the referenced mesh and joints will get updated with the new uv’s and the skinning should be the same but now has the proper UV’s.

Now you use this reference file as say a working file. Once the skinning is completed you could select the mesh and the joints and export selected into a new file. Now the referencing will be broken. All you have to do is remove the namespace from each object. Plus this baked out file is good to have as a backup. If the topology is to ever change in the reference and the skinning gets wacked, you can bring in the baked out skinned mesh into the reference scene and copy weights over which will get you back 90% or so of your pervious weighting. You may have to fix some of it but shouldn’t take as long as having to start over.


#27

Ahhh, thanks a lot to you guys who’re gonna spend your time trying to help me with this, I really appreciate it a lot! I’ll be around all weekend if you manage to come up with the reason the zooscript isnt working.

the reason I have 2 meshes is just because one is skinned and weighted correctly, with UVs organised, BUT because I sorted the UVs after skinning when I move bones around the textures goes crazy. So I duplicated the mesh, with the intention of copying just the weights over from the previous skinned mesh. I’m happy to do it that way, or to copy the weights for the skinned one, then delete its history and reskin.

anyway Nolan that other workflow sounds really great, assuming I’ve understood. It means you can go into the mesh file and edit UVs, etc, and then in the file which references them both your skinned mesh wont screw up the texture when you move joints? sounds mint if so :smiley:

thanks again for all your help!


#29

Ok, just finished the tutorial and uploaded it. Take a look and hope this helps. I made with the presumption that no one has read this thread. Short video. Just 6 min long.

http://www.snolan.net/2009/01/17/copytransfer-skin-weight/

cheers,
-sean