WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 10-26-2004, 11:52 PM
shai shai is offline
Join Date: Oct 2004
Posts: 29
to rephrase my question...

I'm sorry, if the first question seemed a bit ambiguous--

I'm trying to connect a few animations.

my first animation is a person that is sitting down,
the second animation is a person that is waving while sitting down, etc.

i'm trying to do this with the act method but it doesn't flow smoothly between the two animations. also, i need to make these animations in seperate files (that way I can control how many times I want to loop an animation in the middle.)

does anyone have a suggestion?

Reply With Quote
Old 10-27-2004, 10:08 AM
farshizzo farshizzo is offline
WorldViz Team Member
Join Date: Mar 2003
Posts: 2,849

Sorry for the late reply. I was trying to get this working myself but I still get some flicker in between animations. I'll try to fix this in the next version so that animations can blend smoothly between one another. In the meantime you might have to do this manually.

The act method simply queues an action which calls the execute command of an avatar. The execute command simply executes the animation cycle once. I've included a sample script which shows how to do this manually. Let me know if you have trouble getting it to work. (Note, you must press the spacebar to start the animation sequence)
import viz

#Declare a timer constant

#Add the avatar
male = viz.add('male.cfg')

#Create list of actions to be executed
actions = [2,2,3]

def onkeydown(key):
	if key == ' ':
		#Start timer to execute actions


def ontimer(num):
	if num == NEXT_ACTION:
		if len(actions) > 0:
			#Remove first animation from list
			animation = actions.pop(0)
			#Get the duration of the animation
			duration = male.getduration(animation)
			#Execute the animation (with 0.1 in/out delays)
			#Start a timer that will expire before next animation is finished
			viz.starttimer(NEXT_ACTION,duration - 0.1)
			print 'No more actions'

Reply With Quote
Old 10-27-2004, 10:55 AM
shai shai is offline
Join Date: Oct 2004
Posts: 29
animation sequence

This is exactly what I was looking for--

thanks so much!
Reply With Quote

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

All times are GMT -7. The time now is 11:43 PM.

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