PDA

View Full Version : help with slider code


yak
07-16-2009, 01:28 PM
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)[/QUOTE]

This code is helpful but I am stuck on trying to get my avatar to make more actions. how do I get my avatar to jump, in other words more than one action..
Thank you

farshizzo
07-20-2009, 09:47 AM
That example code uses the ANIM variable to control which action of the avatar to play. If you change the value to another animation number, then the slider will control a different animation.

yak
07-20-2009, 12:12 PM
That example code uses the ANIM variable to control which action of the avatar to play. If you change the value to another animation number, then the slider will control a different animation.
I understand that part because I experimented with it..what I want to do is to either have multiple sliders to control different actions or from a push of a button have teh actions automatically change I was thinking of adding an "if" statement to do that but I am still having problems. any suggestions? you have been a great deal of help.