View Single Post
  #1  
Old 10-14-2009, 04:45 PM
v-clizzin v-clizzin is offline
Member
 
Join Date: Sep 2006
Posts: 15
avatar automatically runs animation after fading into view

Hi, I am working with an avatar and would like it to start invisible, fade into view when I press 's' on the keyboard, and then stay idle until I press 'e' on the keyboard, whereupon it should begin walking.

I am currently attempting to accomplish the above with the following code (you can assume that IDLE_ANIM_NUM and WALK_ANIM_NUM refer to the correct animations):

Code:
avatar = viz.add('avatar.cfg')
avatar.state(IDLE_ANIM_NUM)
avatar.alpha(0)

def keyboard(key):
    if key == 's':
        avatar.runAction(vizact.fade(0.0, 1.0, 1.0))
    if key == 'e':
        avatar.state(WALK_ANIM_NUM)
However, I've found that the avatar begins walking immediately after fading into view. This does not happen when I call 'avatar.alpha(1)' to simply make the avatar appear instead of fading into view, but my goal is to make the avatar fade in instead of simply appearing. I have tried calling 'avatar.clearActionList()' and 'avatar.state(IDLE_ANIM_NUM)' after the runAction call, but the avatar still begins walking immediately after fading in.

Any advice? Is there something I'm missing about how animations interact with the action queue? For the record, I am using Vizard 3.15.0001.

Thank you!
Reply With Quote