WorldViz User Forum How to make character animation sequence
 Register FAQ Search Today's Posts Mark Forums Read

#1
01-18-2010, 09:37 PM
 wchoi Member Join Date: Jan 2010 Posts: 2
How to make character animation sequence

--------------------
code:
import viz

viz.go()

female = viz.add('vcc_female.cfg', pos = [0,0,5], euler = [90,0,0])
female.state(7) # jump forward
female.state(6) #fight
female.state(7) #jump forward
------------------------

We would like to make a sequence of character animation such as
jump forward, fight and jump forward.

But female.state(7) is returned at first frame after last frame of jump forward.
It is problem to make character animation.
So,

#female.execute(7, freeze = True)
can pause last frame. But, we can not connect smoothly next motion(female.state(6)).

We want to connect next motion at the position of last frame of first motion.

Please know me how to resolve this problem.

Best regards,
choi
#2
01-19-2010, 10:02 AM
 Jeff WorldViz Team Member Join Date: Aug 2008 Posts: 2,466
The state method has an optional delay argument to specify how long it will take to fully blend in the new state and blend out the old one to give a smooth transition. In the following, press the spacebar and after 2 seconds animation 5 will be blended in.
Code:
```import viz
viz.go()

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

vizact.onkeydown(' ', male.state,5,2)```
#3
01-19-2010, 05:37 PM
 wchoi Member Join Date: Jan 2010 Posts: 2
Dear Jeff

We made the code to connect the next motion at the position of last frame of first motion.

Please check the code and give me the comment.
---------------------
code:
---------------------
import viz

viz.go()

viz.clearcolor(viz.SKYBLUE)

#Position avatar in view
avatar.setPosition( 0, 0, 20 )
avatar.setEuler( 90, 0, 0 )
#Create an action to fade out in 5 seconds

#Create an action to move to location (0,1,0) at 5 m/s

#Add the moveTo action to the node
#It won't start until the fade out action completes
moveTo = vizact.moveTo([1.8,0,20],speed=900000000000000000000000000000)
#moveTo1 = vizact.moveTo([3.6,0,20],speed=90000000000000000000000000000)
moveTo2 = vizact.moveTo([3.6,0,20],speed=90000000000000000000000000000)
#moveTo3 = vizact.moveTo([7.2,0,20],speed=90000000000000000000000000000)
-------------------------------------------------

Best regards,
choi
#4
01-22-2010, 08:35 AM
 Jeff WorldViz Team Member Join Date: Aug 2008 Posts: 2,466
If you want the avatar to move to a position immediately after an animation has completed you can leave out the speed argument in the vizact.moveTo command and it will work the same.

 Thread Tools Display Modes Rate This Thread Linear Mode Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements Vizard Precision Position Tracker (PPT) Plug-in development

 Similar Threads Thread Thread Starter Forum Replies Last Post Andy Vizard 1 10-01-2009 10:42 AM nlfrnassimi Vizard 3 03-11-2009 02:46 PM luakt Vizard 10 09-15-2008 11:39 PM pkhoosh Vizard 2 01-23-2006 08:03 AM shai Vizard 1 10-27-2004 10:09 AM

All times are GMT -7. The time now is 10:32 PM.