WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rating: Thread Rating: 14 votes, 1.36 average. Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 07-28-2017, 01:44 AM
rajnishv rajnishv is offline
Member
 
Join Date: Jan 2016
Location: Kalina,Sanatcruz(East),Mumbai,Maharashtra,India
Posts: 94
Smile

Yes i did the same thing as u have replied,but was missing due to some offsets values for group tracker and now it works like a charm.

Now i want to apply a walking and idle animation on some key events,
i tried some logic,but the character male_2 does not walk on some animation instead it shakes with random left right.


My Code which does not play walk and idle animation for the avatar male_2 which i got from vizconnect nicely and properly as same as animation seen in inspector on key events:-





Code:
#getting the handle of avatar from vizconnect 

avatar = vizconnect.getAvatar('male_2').getRaw()
avatar.state(1)

#Playing walk animation on some key events

def onKeyDOWN(key): 
    if key == 'w' or key == 's' or key == 'a' or key == 'd' or key == 'q' or key == 'e': 
        print 'w  and s key pressed' 
        avatar.state(2)
    elif key == "r": 
        print 'R key pressed' 

viz.callback(viz.KEYDOWN_EVENT,onKeyDOWN) 


#Playing idle animation on some key events

def onKeyUp(key): 
    if key == 'w' or key == 's' or key == 'a' or key == 'd' or key == 'q' or key == 'e': 
        print 'w  and s key released' 
        avatar.state(1) #looping idle animation
    elif key == "r": 
        print 'R key released' 

viz.callback(viz.KEYUP_EVENT,onKeyUp)

How can i play animation nicely for the character male_2 which i got above from vizconnect.

Pls assist me further.

Thank You!!

Last edited by rajnishv; 07-28-2017 at 01:49 AM.
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 09:12 PM.


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