View Single Post
  #7  
Old 05-07-2008, 03:07 PM
Karla Karla is offline
Member
 
Join Date: May 2007
Posts: 12
Thank you!

I was working in a long file, which made troubleshooting more difficult than necessary. I made the following concise example and got it to work. With a more positive resolve, I was able to find my mistakes in the longer file. It's all working now.

Thanks,
Karla

Code:
#******************************************************************************************
#******************************************************************************************
#Trying to use boneSpinTo with avatar in Art Gallery
#Created: May 6th, 2008
#******************************************************************************************
#******************************************************************************************

import viz
import viztask 	#For wait time

viz.go()

viz.MainView.setPosition(0,1.72,7.5)
viz.MainView.setEuler(183,0,0)

#Add an avatar
male = viz.add('male.cfg'); male.translate(0.25,0,5.5); male.rotate(0,1,0,-3); male.state(1)				#Start in neutral state animation
face1 = male.face('biohead_talk.vzf')	#add a face to the avatar

#speed settings for boneSpinTo()
headSpeed = 100
	
def SpinHeadLeft():
	yield viztask.waitTime(2)		#Wait 2 seconds
	lookleft = vizact.boneSpinTo('skel_Head',mode=viz.AVATAR_LOCAL,euler=(-90,0,0),speed=headSpeed)
	male.runAction(lookleft)

viztask.schedule( SpinHeadLeft() )

#***********************************************************
#Adding a world
#***********************************************************
room = viz.add('gallery.ive') # Load
room.scale(1,1,1)  # scale actual
room.translate(0,0,0) ## position in the world
Reply With Quote