WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 07-16-2009, 01:28 PM
yak yak is offline
Member
 
Join Date: May 2009
Posts: 22
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
Reply With Quote
  #2  
Old 07-20-2009, 09:47 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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.
Reply With Quote
  #3  
Old 07-20-2009, 12:12 PM
yak yak is offline
Member
 
Join Date: May 2009
Posts: 22
Quote:
Originally Posted by farshizzo View Post
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.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
meaning of code yak Vizard 3 07-15-2009 01:18 PM
Any ideas on linking chess 3ds file with source code? djones1010 Vizard 1 04-24-2009 09:56 PM
Trying to integrate Source Code with Vizard djones1010 Vizard 1 03-10-2009 02:58 PM
Vizmenu slider bug? Gladsomebeast Vizard 2 10-22-2008 08:05 PM
Vizard Tip of the Month: Use Tasks to Simplify your Code Gladsomebeast Vizard 5 05-02-2008 04:30 PM


All times are GMT -7. The time now is 02:55 PM.


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