Facial Morphing?

Blitz3D Forums/Blitz3D Programming/Facial Morphing?

Avrigus(Posted 2004) [#1]
Greetings,

I'm using Lightwave and I have a character with multiple facial morph maps. I'm animating a short and simple lip sync sequence that I want to replicate within Blitz3D. Now I know this is possible to do (well at least I think it is!) I was just wondering what the best way to go about exporting the animation from Lightwave to Blitz3D would be?

I'm guessing since I already have the head as a separate object I will have to export each facial morph as a separate head object (there will be about 10 morphs in total). Then I will have to export the motions of each morph into a text file and parse it within Blitz.

Lightwave's .LWO file format stores each morph within the base model itself, the main advantage of this is that the information stored for each morph is minimised to the morphed vertices only. In other words if I have an "eyes blink" morph where i've only moved around 20 vertices, the .LWO file stores only the information for those 20 vertices.

If I export a separate head model for each morph then the morph information must by default encompass every vertice in the entire head. Since I have about 10 morphs this would be a very inefficient way to achieve facial animation. Maybe the .B3D file format can be update to include morph maps that work in a similar way to Lightwave's .LWO format? Just a thought :-)

Has anyone created facial morph animation within Blitz3D? If so how did you achieve this?

Cheers!


jhocking(Posted 2004) [#2]
Now that Blitz supports blended vertex weights, the best way to do facial animation is with bones; I'm working on a demo of that.

In the meantime however the best approach would be to use md2 file format. Md2 allows morphing animation. Export the head as an md2 object (I'm not sure how this is done with Lightwave but I'm sure it can be done; if necessary export the frames to separate objects to stitch together in some other tool like Q2 Modeler) with each morph target a separate frame. Now use the transition parameter of AnimateMD2 to smoothly morph between targets/frames.

Another approach is direct manipulation of vertices in code. In other words what you already pointed out: export the vertex positions into a text file and parse that yourself in Blitz.


Koriolis(Posted 2004) [#3]
Now that Blitz supports blended vertex weights, the best way to do facial animation is with bones; I'm working on a demo of that.
Excellent, I wanted to experiment this, but better wait and see what a proper animator can do :)


Avrigus(Posted 2004) [#4]
Thanks for your ideas Joe. I'd prefer to steer clear of boned facial animation at the moment as it's quite tricky to setup and animate but I wouldn't rule it out for future characters. What i'm trying to do has already been seen in this Half Life 2 example movie showing facial animation, it's well worth checking out and may give some Blitzer's inspiration: http://www.ausgamers.com/files/details/html/8064

I had considered using an MD2 head with my morph targets on every consecutive frame, my only gripe with that method is I wanted to use sswift's shadow system on my characters and I believe that you can't cast shadows from MD2's.

So I guess direct manipulation of the vertices would be the way to go, i'll have to ask some questions on the Lightwave forums to see if I can spit out a text file from a morphmap of an object. This may lead to some cool new tools for Lightwave/Blitz3D users :-)

Only problem I may have is that i've read in these forums it may not be possible to manipulate the verticies via morphs on a character that is already being deformed by bones. Can anyone confirm this?


jhocking(Posted 2004) [#5]
Md2 doesn't entirely rule out sswift's shadow system. You could cast the shadow from a static dummy head instead of the animating visible head; the dummy won't have facial animation obviously but movement that subtle shouldn't matter for shadows.

Md2 does have a number of other issues too (eg. poor DX lighting) but is the easiest way to get morph animation into Blitz.


Avrigus(Posted 2004) [#6]
Excellent idea Joe! I might give that a go when I come around to doing shadows. In the meantime I might try implementing a facial morph system similar to the one in the Half Life 2 example movie I posted above.

Anyone want to give me a hand getting this working? Here's a link to my WIP of the character I intend to use:
http://www.cgtalk.com/showthread.php?s=&threadid=119118