View Single Post
  #2  
Old 07-26-2011, 06:04 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
You could remove the current state and then add it back just before the actions are done with a timer. That way the avatar won't revert to any state between actions:
Code:
import viz
import vizact

viz.go()

avatar = viz.addAvatar('vcc_female.cfg',pos=[0,0,5],euler=[180,0,0])
avatar.state(1)

def animateAvatar():
	
	#remove current state
	avatar.state(-1)
	
	#add a series of actions
	avatar.addAction(vizact.animation(4))
	avatar.addAction(vizact.animation(5))
	avatar.addAction(vizact.animation(6))
	
	actionsDuration = avatar.getDuration(4) + avatar.getDuration(5) + avatar.getDuration(6) - 0.1
	
	#set state before animations finish
	vizact.ontimer2(actionsDuration,0,avatar.state,1)

vizact.onkeydown(' ',animateAvatar)

Please create a new thread for the linking question and post some example code that replicates the problem for you.
Reply With Quote