UV Animation for facial expressions (again)

Hi all,

I know this isn’t the first question on this topic. But I got stuck anyhow:

What I want to achieve: I’ve got a character on which I want to set some facial expressions via changing the texture. In order to do this I made 3 textures. One for the character itself and two others for mouth and eyes:


Using an UV-Scroll script I noticed that it only works if the character is not connected to an armature.

Is there another way to do this? I would like it best if I could use it with keyframes but currently I’m thankful for anything.

Thanks & regards,

Scheintod

Maybe?
http://www.blender.org/documentation/blender_python_api_2_68_2/bge.types.KX_MeshProxy.html?highlight=transformuv#bge.types.KX_MeshProxy.transformUV

p9ablo: Thanks for the idea. If it had worked it would be cleaner code than the one I had. But no luck :frowning: Exactly same effect: Works for normal objects but not if parented to an armature.

Hasn’t anyone another idea? Or some sort of workaround?

@p9ablo: Thanks again. But this is what I did before the more elegant solution you suggested above. It seems all the UV changing stuff on the mesh is not working when it’s parented to an armature.

Perhaps someone could suggest a completely different solution which accomplishes the same effect?

I already thought of exchanging the whole mesh. But this wouldn’t be a great solution either. (I have a MxN combination problem here.)

Another idea would be to use custom shaders “somehow”. But I have completely no clue how to do this. (at least not if I want to keep the default shader intact otherwise.)

Well…

  1. could you make your head separate object and simply parent it to the bone?
  2. Or use for your facial expression you could use things like shapekeys and ob color if you want to change eyes color.
  3. Or you could replace entire texture with videotexture method

I reckon these aren’t perfect solutions :stuck_out_tongue:

I agree with kheetor, most games don’t involve huge amounts of head movement so why not remove the head altogether from the parented mesh and just parent the head to the player movement cube. You could then if need be just animate the head with the same motion as the body.

I think if you want the head to rotate for example track to certain object or look up/down left/right according to the view it is actually easier to do if head is separate object :slight_smile: But whatever works for you.

Thanks all for the replys!

  1. Parenting to a bone doesn’t work in the same way as parenting to an armature I just checked.
    But what works is: parenting an empty to the bone and then parenting the object to the empty. So what I tried next is ripping the mouth and the eyes out and parenting them in this way. This works to a certain degree: The remaining problem is, that it kills the shading:


    (you can see the different shades below the “eye-piece”.

This seems to be true for all Methods which involve altering the mesh. So I can cancel the idea to somehow “move” different parts of an eye/mouth mesh to display them.

So this still leaves me with two options: Replace the whole texture or rip of the head and parent it with the empty method. I think I will the the later because I don’t like loading to many textures. It’s a pitty none of the methods allow me to animate using keyframes.

But I see light at the end of the tunnel!

Thank you all!

Yeah I could have told you not to rip off the eyes like that. :slight_smile:

You could adjust vertex normals to fix smoothing but when the vertices aren’t joined, some tearing will always occur in the seams of your meshes. And that’s why I didn’t suggest it.

Note that you will be doing pretty big work because you just simply don’t want to load additional textures :stuck_out_tongue:

But shame about the bug, I’m not sure if I’ve encountered it before. Or is it a bug or more about a UV scroll feature that’s not fully implemented?

Could anyone confirm this is a bug and is it submitted yet?

I can confirm that also transformUV() doesn’t seem to work when the mesh is parented to the armature. If this has always been the case, I wonder what’s the use of transforming the UV coordinates. Won’t it be applicable especially in combination with armatures? (for character animations).

Ok. It seems I will go with the rip off. After a little tweeking the textures it seems this will work. Thanks all for the help!


Now I’m still looking for some way to animate the UV in the Action-Editor. Is there a way to connect something animatable with Game-Properties? Currently I’m thinking about moving a bone to different places and reading the values in the script to move the UV. Are there other “things” which could fulfill this purpose?

Jeah. Its working: https://vimeo.com/79338349

Animated via Actions/Bones:


Thanks all!