WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-27-2004, 12:52 AM
shai shai is offline
Member
 
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?

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

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)
Code:
import viz
viz.go()

#Declare a timer constant
NEXT_ACTION = 0

#Add the avatar
male = viz.add('male.cfg')
male.translate(0,0,6)
male.rotate(180,0,0)

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


def onkeydown(key):
	if key == ' ':
		#Start timer to execute actions
		viz.starttimer(NEXT_ACTION,0.01)

viz.callback(viz.KEYDOWN_EVENT,onkeydown)


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)
			male.execute(animation,0.1,0.1)
			#Start a timer that will expire before next animation is finished
			viz.starttimer(NEXT_ACTION,duration - 0.1)
		else:
			print 'No more actions'

viz.callback(viz.TIMER_EVENT,ontimer)
Reply With Quote
  #3  
Old 10-27-2004, 11:55 AM
shai shai is offline
Member
 
Join Date: Oct 2004
Posts: 29
animation sequence

This is exactly what I was looking for--

thanks so much!
Reply With Quote
Reply


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 08:28 AM.


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