WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-05-2006, 02:11 PM
betancourtb82 betancourtb82 is offline
Member
 
Join Date: Jan 2006
Posts: 103
switching heads

I am trying to switch avatar heads after they get "shot". I have 3 different faces defined in an array as follows:
Code:
faces = ['biohead_talk.vzf','omar.vzf','morph_head.vzf']
bioheadFace = faces[0]
omarFace = faces[1]
morphFace = faces[2]
I then define 2 different functions, one to remove the avatar from the screen when "shot" and the other to restore the avatar (with a different face). What I would like to do is identify the face in the RemoveAvatar function and based on that face, choose the next face in the sequence. The problem is that I'm not sure how to "grab" what face was on the avatar that was shot. Any ideas? Thanks.

Code:
def RemoveAvatar(avatar):
 global avatarCount, faceSelect, threatLevel, bioheadFace, omarFace, morphFace,bioCount,omarCount,morphCount
 avatar.visible(0) #Hide avatar
 if bioheadFace:
  print "bio Shot"
  newFace = omarFace
  bioCount +=1
  print 'newFace is', newFace
  print 'bioCount is', bioCount
 elif omarFace:
  print "omar Shot"
  newFace = morphFace
  omarCount += 1
  print 'newFace is', newFace
  print 'omarCount is', omarCount
 elif morphFace:
  print "morph Shot"
  newFace = bioheadFace
  morphCount += 1
  print 'newFace is', newFace
  print 'morphCount is', morphCount
 avatar._face_.remove()
 avatar.speed(1) #Restore speed
 avatar.face(newFace)
 characters.remove(avatar) #Remove from list
 dead_list.append(avatar) #Add to dead list
 avatarCount += 1
 print 'avatar count is: ', avatarCount
def RestoreAvatar():
 global keyindex, bioheadFace, omarFace, morphFace, bioheadFace, omarFace, morphFace,bioCount,omarCount,morphCount
 if len(dead_list):
  avatar = dead_list.pop() #Ressurrect dead avatar
  avatar.clear(viz.ACTION)
  avatar.clear(viz.CURRENT_ACTION)  
  avatar.visible(1) #Make it visible
#  avatar.face(newFace)
# faceSelect += 1
 characters.append(avatar) #Add it to avatar list
Reply With Quote
 


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 03:01 AM.


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