it would be nice if the animation system had some features for facial animation. i think blend shape support wouldn't be hard to add.

for example it could work like that:

blend shapes get stored like normal vertex animation frames but with a special prefix in the name like "_bs_smile", "_bs_frown", "_bs_closedeyes",...

the engine then loads them as vertex displacements relative to the neutral pose.

with a function like ent_blendshape(entity, shapename, percent) several blend shapes could get activated and mixed then. for example:

ent_blendshape(my, "_bs_closedeyes", 50);
ent_blendshape(my, "_bs_smile", 120);

would give 50% closed eyes and 120% smile (since the displacements are relative, there also can be extrapolation).

blend shapes get applied before bone animation so that bone animation can be used together with it.


...
i think such a system could get scripted with the vec_to_vertex() function but of course it would be nicer if it were integrated. probably faster too?