WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Avatar Duck Animations (https://forum.worldviz.com/showthread.php?t=436)

Amit 10-13-2005 09:10 AM

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

farshizzo 10-13-2005 10:03 AM

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)

Amit 10-13-2005 12:45 PM

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

farshizzo 10-13-2005 12:59 PM

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. :)


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

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