weight painting < > texture painting?

Hey everyone,

This is a question/suggestion. I’m learning about face rigging at the moment, seems that the hard, time consuming bit is in the weight painting to get the face rig to deform the face mesh smoothly. Particularly, I’m interested in the idea of being able to paint the weights for one head and then be able to transfer the face rig (with its weight painting) to another head as quickly and easily as possible.

Q : Is there a way to ‘bake’ weight painting for each bone to it’s own (UVW map based) texture, and more importantly, transfer baked weights from a texture back to weight painting?

My thinking is this:

  • weight paint a mesh to work with all the bones
  • bake each bones weight to a texture
  • make a copy of the face rig (bones) and place it inside a new head
  • add the baked weight textures to the new head
  • transfer baked weights back to weight painting on new head

Is this already available? If not, can it be done with python?

no, but it could be done quite easerly, Blender has UV not UVW mapping.

Why would having the weights on an image be usefull?
to transfur weights between models that share similar mapping?

At the moment if you want to use the same face rig on two seperate heads - let’s assume they have different topology too - you have to weight paint each one from scratch.

But if the weight painting could be transferred to textures (one for each bone I suppose), then it wouldn’t need to be repainted, they could just be applied to the new head as textures and ‘fitted’ using the UV editor to ‘slide’/reposition the baked weights into the right position around the new head/topology before transferring the baked weights from the texture back to the new meshes actual weight painting.

It’s just an idea though, there may be problems with it that make it unworkable that I haven’t realized. I was just thinking about how easy it is to refit a head texture to a new topology using the UV editor, and how nice it would be if a face rigs weight painting could be transferred in the same way.

I had this problem and managed to get around it by making a script t copy weights from 1 mesh to another- in the objecty menu see “BoneWeight Copy”
This script could be modified to use UVcoords rather then vertex proximity to work out which verts to copy from.

Hey Cambo,

That sounds cool, is there anything online that talks about the script and how it works?

Simon O

oops sorry, just found the page…

Hmmm… Interesthing :rolleyes:

Hey Cambo,

I found your script and tried it - that’s a great script. I had a look at the code too, but it’s way over my head. There’s a very good chance it will actually do everything I need it to already.

Having said that, I can’t help wondering if the UV mapping idea above would give it that extra bit of precision adjustability - particularly in problem areas like around the eyes, the mouth etc etc.

Just thinking out loud too, maybe the answer is not UV mapping at all, maybe the answer is weighting the first mesh, then mesh modelling it to (roughly) match the shape of the second mesh - then your script would be fine…

Simon O

But if it was easy enough for you to make a variation of the script that used UV coords that would probably be easier…

I’d volunteer, but my heads still spinning from trying to figure out the code in your first script :o)

Hey Blenderer, your right- Using UVs could be a great way yo copy weights, and possibly faster and better quality.

In my case I had many models from different sources, that were all made to be a similar size, so location worked fine. but in some cases where the models have different proportions it could be good.

The main limitation is that they MUST have the same or very similar UV layout and multiple images could be tricky to deal with in a real life situation because you need to have a 1:1 match for the images on both meshes and then work out in which face set to do the weight lookup.

In general blender needs a way to copy data from one mesh to another (topology independant), We could probably get somthing better then thins happening in the long run.

Yeah, I think the whole UV thing is a good idea. Re the need for similar UV layouts, the more similar they are the quicker and easier it will be, but one of the advantages of being able to use the UV editor (and in particular LSCM with live update et al) is being able to stretch a markedly different topology over the texture baked weights (with relative ease).

Re the multiple images challenge, one fortunate thing is that even though there may be a number of them, they can all use the same uv coordinates - probably should even require it.

I’m pretty sure I’m a million miles away from being able to update the script, but if you get the script going, I’ll make a nice face rig to go with it :o) And who knows? Maybe we can add high speed face rigging to blenders already long nyah nyah list.

The main limitation is that they MUST have the same or very similar UV layout and multiple images could be tricky to deal with in a real life situation because you need to have a 1:1 match for the images on both meshes and then work out in which face set to do the weight lookup.

Yes, but couldn’t be useful your decal script for this too?..

The other thing is youll need an image for each weight group :confused: or 1 image for 4 groups RGBA==4groups - 1 per channel.
If you wanted to be tricky write one XCF or PSD image with a layer per group.

A simple test could be to make a script that converts weights to vertex colors and then baje those to an image because theres alredy a script to do that (see the image menu)

Then well need a script to copy it back.

Hi there,

I just wanted to inquire if you are still working on this script since I really have a need for this at the moment. So if you have anything released already I’d be more than happy to test it.


Hi Gato,

I recommend you try one of the ideas mentioned above - rig one head, then manually reshape it to fit your second head and use cambos bone weight copy script to copy the weights from the first to the second.

Simon O

Hi Simon, thanks a lot for your reply! Yeah, I was still using the older weight transfer script by tolobán (doesn’t seem to be up anymore), and that worked without a problem, it just took quite a while since the meshes are pretty dense.

The option to store the weights as a texture map would be cool though for very differently shaped meshes. RVKs would also work well for this, but if you don’t model mainly in Blender you get problems with vertex order on import/export, and you can’t just cut some more geometry into the mesh when needed and bring it back into Blender.

Thanks again! :smiley:

IMHO storing weights in images is cool but impractical.
for a human fugure you might need between 10-20 images - 1 per bone.

Better support UV space weight transfur.

BTW, weight to image would be fairly easy still. if you want- whip up a script that copys the active group to the vertex color, then use the existing image bake script to write it to an image.