To find out what orientation the animation has the head at unlock the bone, then call bone.getEuler(), then lock the bone again.
Also, I think it might be a bit more complicated than getting the bone orientation then calling vizact.headto(). This is because the head orientation will have changed by the time the headto action is done.
You could manually blend the head back. The vizmat.interpolate fuction will come in handy. It could go something like the following fake code:
Code:
while not isDone:
currentEuler = bone.getEuler()
bone.unlock()
targetEuler = bone.getEuler()
bone.lock()
eulerBlendy = vizmat.interpolate(currentEuler, targetEuler, percentDone)
bone.setEuler(eulerBlendy)