WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 04-06-2010, 12:39 PM
Josh Josh is offline
Member
 
Join Date: Jan 2010
Posts: 63
Check if an avatar has a state "123"

Hi all

when setting an avatar's state, worldwiz doesn't actually seem to check whether the avatar's really has this state. So

avatar.state(123)

doesn't result in a failure when the avatar doesn't have a state with number 123 - the avatar just doesn't do any animation.

Is there a way to determine whether the avatar has the state 123? Something like

avatar.has_state(123) # True / False

? Thanks for help,
Josh
Reply With Quote
  #2  
Old 04-06-2010, 02:11 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
You could use <node3d:avatar>.getAnimationList and check the length of the list returned. If the ID is greater then that length the animation is not defined.
Code:
animations = avatar.getAnimationList()
if 123 <= len(animations):
	avatar.state(123)
else:
	print 'The avatar does not have this animation id'
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
avatar scale and link.setpos conflict? sircedric4 Vizard 0 09-29-2009 08:48 AM
Collision of an avatar with a quad Frank Verberne Vizard 8 06-04-2008 10:44 AM
Looking through the eyes of an avatar Frank Verberne Vizard 2 04-01-2008 06:52 AM
How to make avatar's eyes to blink when speaking michelcm3 Vizard 12 01-15-2008 09:48 AM
On Screen Keyboard betancourtb82 Vizard 14 10-03-2006 01:38 PM


All times are GMT -7. The time now is 06:57 AM.


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