WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 09-23-2005, 12:19 AM
vsully vsully is offline
Member
 
Join Date: Sep 2004
Posts: 24
Send a message via AIM to vsully
action_end_event and the mysterious viz.ActionData

Hi,

I have an avatar, and when I issue it an action/animation to play I .unlock() the headbone to give the action access to the head. After, I've set up a action_end_event callback to .lock() the head again so other operations can apply their manual transformations.

However, the "action" parameter for the callback function is given a viz.ActionData object, and I can't find information on how to access this object's data. I'd like to know which action (id?) has just ended. Thoughts?

Oh yes. And one other problem is that <avatar>.execute() doesn't seem to trigger an action_end_event. Which is unfortunate, because .execute does a nice job of blending the animations, while .act() (which i'm currently using), does not. Other thoughts?

Thanks.

Last edited by vsully; 09-23-2005 at 12:22 AM.
Reply With Quote
  #2  
Old 09-23-2005, 09:23 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

You are mixing the term action and animation together, when they are two separate concepts. Vizard comes with the ability to create high-level actions that can be added to any node object. Take a look in the documentation under the Actions section for more info. In addition to this, avatars have the low-level ability to play/blend built-in animations.

When you call <avatar>.act() it actually creates an action which will execute the animation and adds it to the avatar. For backwards compatiblity with older scripts, whenever an action is finished it stops the avatars current built-in animations. To get around this you could do the following:
Code:
#Create an action that will execute animation 5
anim5 = vizact.animation(5)

#Add the action to the avatar on action pool 1
avatar.add(anim5,1)

def onactionend(obj,action,pool):
    if action == anim5:
        print 'Avatar has finished executing action 5'
avatar.callback(viz.ACTION_END_EVENT,onactionend)
The object anim5 is an instance of viz.ActionData which will be returned to all callback functions.

Hope this explains everything for you. I know that the documentation on this stuff is very sparse, so let me know if something is not clear.
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 02:10 AM.


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