View Single Post
  #1  
Old 07-21-2009, 12:22 PM
yak yak is offline
Member
 
Join Date: May 2009
Posts: 22
adding more than 1 action for avatar animation slider control

Code:
import viz
viz.go()

#Initialize avatar
male = viz.add('vcc_male.cfg')
male.setPosition(0,0,5)
male.setEuler(180,0,0)

ANIM = 6
DUR = male.getDuration(ANIM)

#Start animation
male.execute(ANIM)
male.setAnimationSpeed(ANIM,0) #Speed must be set after animation is executed

#Use slider to modify animation time
slider = viz.addSlider(pos=(0.5,0.1,0))
def myslider(pos):
	male.setAnimationTime(ANIM,pos*DUR-0.01)
vizact.onslider(slider,myslider)
this is a code that controls the speed of the avater's action by using a slider. what I want to do is have teh avatar perform more than one action . maybe press the 'p' key on the keyboard and that will get eh avatar to pick something up and i can control its speed or press the 'w' to walk and i can control the speed of walking by the same slider control. I tried adding multiple sliders that control different anumation actions but most of tha actions all blend together and cause a glitch....any suggestions....

thanks
Reply With Quote