![]() |
#1
|
|||
|
|||
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] 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 |
#2
|
|||
|
|||
In Vizard 3.0 there is a getFace fuction. For Vizard 2.5 keep a varable on the avatar that has a pointer to the face that you assigined the avatar.
You could also assign each face an integer ID and keep a varable with the avatar remembering what faceID the avatar has.
__________________
Paul Elliott WorldViz LLC |
![]() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|