WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-13-2005, 09:10 AM
Amit Amit is offline
Member
 
Join Date: Aug 2005
Posts: 9
Avatar Duck Animations

I want to translate a duck (an inbuilt avatar) from one position (say A) to another position(say B). At position A, the duck should not have any movements, that is, it is stationary (code: duck.state(0)). when pressing left click, it should move towards position B, but with state(1).
{code:
duckMove=vizact.sequence(vizact.goto(x,y,z))
duck.add(duckMove)
duck.state(1)
}

once we reach position B, the duck should stop moving and should be in state(0).

{code:
def actionEnd(obj,action):
if action==duckMove:
duck.state(0)

viz.callback(viz.ACTION_END_EVENT,actionEnd)
}

but this doesn't seem to work, can you please suggest something, by which I can carry out the specified task.

-Amit
Reply With Quote
  #2  
Old 10-13-2005, 10:03 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

Avatar animation numbers start at 1, so an animation of 0 is invalid. Try clearing the animation instead by using the following command:
Code:
duck.clear(1) #Stop performing animation 1
Also, when you add the duck, set its idle pose to -1, since it doesn't have one:
Code:
duck.idlepose(-1)
Reply With Quote
  #3  
Old 10-13-2005, 12:45 PM
Amit Amit is offline
Member
 
Join Date: Aug 2005
Posts: 9
Great, it worked!!! Thanks!!!

some points to ponder upon:

When I used the code: duck.state(0), it worked as the duck won't move when the duck is first added.

If state(0) is invalid then why won't the program return an error remark?

also to keep in mind, when the duck is first added, it wouldn't be idle, but be in the 'ik.CAF' state.

so putting duck.state(0) the duck goes into the idle mode. if it works once then why won't it work again in the action end callback function?


sorry to ask so many questions, but I am just curious.

-Amit
Reply With Quote
  #4  
Old 10-13-2005, 12:59 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

When an avatar is first added, all its animations are cleared, so performing duck.state(0) does nothing. The idlepose mostly exists for backwards compatibility. It is started when an action is finished being performed on pool 0 of an avatar. We will try to add more descriptive error messages for future version of Vizard.

Also, feel free to ask as many questions as you want. That's what I'm here for.
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 04:18 AM.


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