WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 11-22-2006, 11:29 AM
v-clizzin v-clizzin is offline
Member
 
Join Date: Sep 2006
Posts: 15
Custom avatars and avatar.walkto

The code I use in Vizard to make an avatar walk to a certain point usually looks something like this:
walk = avatar.walkto(0,0,0)
avatar.act(walk)

When I run this with the avatar as a generic Vizard avatar, it actually walks to that point. When I run this with another avatar from the Complete Characters package, the avatar merely slides to the point. I've looked at the CFG files for each but couldn't figure out if there was anything that specifies a walk animation to associate with the walkto action. Is there any way to do this for other avatars?

Thanks!
Reply With Quote
  #2  
Old 11-27-2006, 10:41 AM
Gladsomebeast Gladsomebeast is offline
Member
 
Join Date: Mar 2005
Location: Isla Vizta, CA
Posts: 397
You can specify the animation to use with the walkto action with the "walkAnim" keyword

Code:
walkto = vizact.walkto(0, 0.000, -3, walkAnim=avatar.getAnimationID('walk_inplace.CAF') )

avatar.addAction(walkto)
__________________
Paul Elliott
WorldViz LLC
Reply With Quote
  #3  
Old 02-02-2007, 12:58 PM
vnellyaba vnellyaba is offline
Member
 
Join Date: Sep 2006
Posts: 3
I am using an avatar in an array, and this method (getAnimationID) doesnt seem to work for it. Neither does getPosition(). Is there another way?
Reply With Quote
  #4  
Old 02-02-2007, 01:04 PM
Gladsomebeast Gladsomebeast is offline
Member
 
Join Date: Mar 2005
Location: Isla Vizta, CA
Posts: 397
Is the varable you are trying to call getAnimationID and getPosition a valid object? Perhaps you have not intialized the list properly? Try printing the varable before you use it. It should say something like VizAvatar instance.

Print like so:

Code:
for avatar in peopleList:
    print avatar
__________________
Paul Elliott
WorldViz LLC
Reply With Quote
  #5  
Old 02-24-2007, 12:23 PM
vnellyaba vnellyaba is offline
Member
 
Join Date: Sep 2006
Posts: 3
thanks, for some reason
victims[nextvictim].get(viz.POSITION)
works fine.

Question:
Do you have any idea why an avatar, after completing a walkto(x,y,z) would start performing another animation?
the code is:

actor.act(actor.walkto(-1, 0, 1.5,1.8,0,6))
actor.act(actor.walkto(-1, 0, 3,1.8,0,6))
actor.act(actor.turn(-110))

after each of those walkto's and during the turn, the avatar begins to bend down(which is one of the animations it has) for some milliseconds and then continue with the next action. it does the turn simultaneously with the bending down action although i never called it .

I tried setting the state to idle, but that doesnt work...
Reply With Quote
  #6  
Old 02-26-2007, 11:25 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
By default, Vizard assumes the avatars idle animation is the first animation. Vizard will use the idle animation after performing walk actions and during the turn actions. The easiest solution would be to place your idle animation at the top of the animation list in your cfg file. Alternatively, you could set the idlepose of the avatar in your script:
Code:
avatar = viz.add('myavatar.cfg')
avatar.idlepose = 4 #Use animation 4 as the idle pose
Also, you can specify the animation to use for the turn action:
Code:
actor.act(vizact.turn(-110,anim=5)) #Use animation 5 while turning
Reply With Quote
  #7  
Old 02-26-2007, 04:46 PM
Gladsomebeast Gladsomebeast is offline
Member
 
Join Date: Mar 2005
Location: Isla Vizta, CA
Posts: 397
You can also avoid having the avatar's state set the the idle animation after each action by setting the idle animation to -1.

Code:
avatar.idlepose = -1
__________________
Paul Elliott
WorldViz LLC
Reply With Quote
Reply

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


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