WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   animating complete characters in Vizard (https://forum.worldviz.com/showthread.php?t=2211)

Vkathrynr 08-15-2009 03:00 PM

animating complete characters in Vizard
 
Is it possible to animate complete characters in Vizard?

I have composed this script, but the avatar does nothing and there are no errors in the Vizard console. I'm am a beginner programmer - so I apologize in advance if the correction is rather obvious.

I'm trying to move the avatar's arm in a toss type motion.

Thanks,
Kathryn

if key == 'b':
print 'pressed b, ball will be tossed to virtual human'
#Get a handle to the Neck bone############################################## ########Animate toss in Vizard?
forearm = confederate1.getBone('Bip01 R Forearm')
forearm.lock() #Disable automatic animation so that we can manually animate it
#Lock the head bone so that manual movement of the neck bone also moves the child head bone
confederate1.getBone('Bip01 R UpperArm').lock()
confederate1.getBone('Bip01 R Hand').lock()
forearm.setEuler(50,0,0)
ball.goto(.9,1.25,4.8,5)

Jeff 08-17-2009 12:35 PM

Please use the code tags when posting code to preserve the indentaton. The following will move the avatar's arm.

Code:

import viz
viz.go()

female = viz.add('vcc_female.cfg', pos = [0,0,5], euler = [180,0,0])
female.state(1)

def tossBall():
       
        forearm = female.getBone('Bip01 R Forearm')
        forearm.lock()
        forearm.setEuler(90,0,-90)

vizact.onkeydown('b', tossBall)



All times are GMT -7. The time now is 04:14 PM.

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