Bone Weight Copy [Blender]

The_Coyote

Emperor
Joined
Mar 1, 2008
Messages
1,367
Location
Europe
more than a tutorial is a kind of introduction to a script included in the later version of blender which seems to reduce the amount of work rigging a model to an armature. Also i consider this not a basic tutorial, at least basic knowledge about the civ4 modding process and blender is required

http://wiki.blender.org/index.php/Extensions:Py/Scripts/Manual/Object/mesh_boneweight_copy

The script copies the bone weights from one rigged mesh to another unrigged using the position of the vertices. This tutorial shows as example how to rig the wolf to warrior armature ot have a gnoll warrior.

the first step is in oru case to prepare the wolf mesh, because we want to rerig the model, we must get rid of the actual rigging. It can be easily done removing the entire SkinInstance of the mesh. pic(1)

After this import the prepared nif in Blender and remove all objects beside of the two models, move the wolf a bit forward in Blender. pic(2)

import the warrior.nif in Blender pic(3)

change the wolf match to match the warrior mesh, especially imo important are the joints [but your are free to try what happens if you don´t match the position]. In thsi case, because the mesh was heavily transformed, also the uv must be adjusted (pic4)

move the wolf back to match the position of the warrior, especially important are the positions of paarts which will interact with other parts of the nif, eg the hand which holds the weapons [in this case, match the position of the hand of the warrior, not the weapon itself]. After this, start the script and let to it the rigging work for you (pic5)

before you can export the model, you must parent the armature, select first the mesh, afterwards the armature. After this options -> parent -> make parent [ctrl p] -> armature -> don´t create groups (they are already created throught the weight copy). If needed you can now adjust the shape of some parts and check and adjust the rigging for certain in the original mesh not existing parts [here the tail]. After this you can test the rigging using the pose mode of the armature and export the model (after this nifswap and ...) (pic6)

if you have already a similar shaped model the process will be much faster, could be interesting if the same works fine for leaderheads ...

Ciao
The_Coyote
 

Attachments

  • p1.jpg
    p1.jpg
    73.4 KB · Views: 695
  • p2.jpg
    p2.jpg
    44 KB · Views: 818
  • p3.jpg
    p3.jpg
    49.2 KB · Views: 733
  • p6.jpg
    p6.jpg
    34.1 KB · Views: 733
  • p5.jpg
    p5.jpg
    274.5 KB · Views: 924
  • p4.jpg
    p4.jpg
    205.9 KB · Views: 829
Nice, Coyote!!!
I think I experimented with it in an earlier version and it messed up too much.
So, glad it works nowadays ;)

thanks for the tut.
 
i think i also tried it before and failed greatly in using it, beside having wrong modelled joints, i think the position of them was a bit of (and after a small lh experiment, it´s seems that is the important part, having the joints at the same position when running the script)

and made a 'quick' lh experiment, Ceasar to Isabella, worked (~20 min for the copy process), but also had some errors which must be fixed by hand, also the Ceasarbelle has because of some not matching hand joints while doing this a funny hand animation (disortation), but in general the copying worked. Attached the model, even if has still too much errors to be called working, it shows that it could be possible
 
I'm not finding this method very useful for copying rigging between two archer meshes. It makes the vertex groups overlap too much. It's taking me more time to manually correct it's mistakes than it would have been to rig it manually in the first place.
 
tbh i have never rigged a human unit in Blender - all my units so far i did have a one vertice one bone rigging [no overlapping vertex groups] while vanilla human units have different weights and also vertices which are rigged to more than one bone (affected by the bones through the weight - overlapping vertex groups - one of the reasons why i avoided it so far).

The units i did so far seems to work fine [the very 'huge' number of 3 :lol: ], but i can imagine that the tool can also fail. So i wouldn´t say it´s a must use tool, but at least it´s an interesting option.

And thanks for the input that archer seems to make trouble (could you post a blend directly before you would start the script)
 
.
before you can export the model, you must parent the armature, select first the mesh, afterwards the armature. After this options -> parent -> make parent [ctrl p] -> armature -> don´t create groups (they are already created throught the weight copy)..(pic6).

I failed this step.

I got object -> parent -> make parent [ctrl p] -> OK? instead.
Nothing seems to happen; after export I got the same initial mesh without skininstance :(
 
normally i have this if i had the wrong selection order (it´s important to first select the mesh and afterwards add the armature to the selection [i hope i didn´t twisted the both as i wrote this])

if all fails, could you post the blend so that i can spend a minute or more to investigate?
 
I didn't save the blend.
In the afternoon I'll repeat the whole process till step 6, saving the blend.
See you later.
Thanks Coyote ;)
 
I've repeat the process and it fails again.

I've attached two blend: the initial and the one just before step 6.

Thanks
 

Attachments

  • blender.7z
    77.9 KB · Views: 247
:confused: ok, i used your bcw_test and it worked fine

selected the female mesh (and only this one), afterwards added the armature (shift and select the armature) [like said, this order is critical], objects, afterwards parent, make parent, [this time] name groups

which Blender version do you use? another idea i havn´t at the moment
 

Attachments

  • export.zip
    44.7 KB · Views: 189
Ok, finally I got it ! :goodjob:

The trick was shift and select the armature, because I always did multiselection using B key. In this case it doesn't work.

Thanks again, Coyote.

My next problem will be to get rid of the ugly shoulders of my amazon warrior. Based on your experience, is this a "bone copy weight" consequence?
 

Attachments

  • amazon.jpg
    amazon.jpg
    12.5 KB · Views: 354
yes, more or less the reason is that the joints hadn´t the same position in Blender (the vertices are moved relativ to the rigged distance of the bone, eg a turret not centered rigged will move on a circle [and not rotate])

one possibility i can imagine, make the shoulders maskulin in Blender (to fit the joints), afterwards add link (help) bones in Blender (or do this before you import the warrior) between torso and arms to adjust the shoulder size
 
is this really necessary now? i've been just doing a nifswap of a leaderhead to another skeleton, say caesar to isabella. if the bones are missing i just rename the closest one (like if no shoulder_clavicl i just amke it clavicle). then when i finish the nifswap i import into blender. the mesh isnt ditorted and then move and rotae until they fit in place. i think it might be easier. unless i'm missing something.
 
nifswap can be best done in nifscope, it´s simply means that you copy the model from one nif to another. As long as there are fitting names for the bones, the rigging is copied (i think you will have done it thousend times til now, or?)

@ Ekmek
as long as the skeletons are similiar to each other, i think nifswapping is a nice and the prefered option. But if you have an new and unrigged model or a model with a completely different structure (eg hand bones), this method can save you some time. It´s only an option which can help saving a small amout of time creating the a complete new rigging.

Did you never had problems with the changed position of the bones when the leaderhead is animated (or do you only move the vertices)? If you try to play with units such changes are almost always overriden by the animation
 
it´s simply means that you copy the model from one nif to another. As long as there are fitting names for the bones, the rigging is copied (i think you will have done it thousend times til now, or?)

Thanks, only now I've learnt that I did thousand of nifswaps :goodjob:
Btw, I'm very glad to read you again :)
 
Hello,
I'm trying to re-rig the panther to a lioncow. Lioncow is a lionress from the lions bonus resource, re-rigged to a partial cow skeleton by someone :crazyeye: it only has 4 bones (head, chest, tail1, tail2). I figured this tutorial would explain what I'm supposed to do and it kind of did but I'm still lost. It doesn't help that I don't really know Blender and its interface makes me want to kill all panthers, lions and cows on top of the UI designers.

I managed to strip the panther from skin instances, get it into blender, get rid of all non-mesh stuff, then import the lioncow and position them (fig. 1)

Now, "change the wolf match to match the warrior mesh" - does that mean scultping the mesh? But it's not what I want, I just want the panther move its head and tail like the cowlion. So I skip it.

Now I run the script - amazingly it works. Then parent the armature stuff - works.

Now export... ERRROR EEROROR : Cannot export mesh with unweighted vertices. The vertices are selected so you can see them or something.

And yeah I can see them - jaw and legs are unweighted (fig. 2). But I want them static and not moving, same as lioncow's (well jaw should really go with head). So, what do I do? Thanks!
 

Attachments

  • pantherlioncow.jpg
    pantherlioncow.jpg
    46.7 KB · Views: 283
  • pantherlioncow-erorooror.jpg
    pantherlioncow-erorooror.jpg
    48.1 KB · Views: 318
Top Bottom