#1
|
|||
|
|||
Smooth transitions back to animations when unlocking bones
Hello,
I am locking the head bone to have an avatar look at an object, but I have run into an issue - when I unlock the bone, the head immediately jumps to an animation position, with no smooth transition. Is there some parameter or function I should be calling to get a smooth transition back into the animation when unlocking a locked bone? Thanks, Christian |
#2
|
|||
|
|||
If you find out the head orientation at the start of the animation cycle, for example, then when you want the avatar to stop looking at an object, use vizact.headto to smoothly move the head to the starting position. Once its reached that position wait until the start of the next cycle and unlock it.
|
#3
|
|||
|
|||
Thanks.
Is there a good way to find the head orientation at the start of an animation cycle? Christian |
#4
|
|||
|
|||
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)
__________________
Paul Elliott WorldViz LLC |
Thread Tools | |
Display Modes | Rate This Thread |
|
|