WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   help with slider code (https://forum.worldviz.com/showthread.php?t=2163)

yak 07-16-2009 01:28 PM

help with slider code
 
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)

[/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

Quote:

Originally Posted by farshizzo (Post 8389)
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.


All times are GMT -7. The time now is 09:38 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC