WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 04-09-2009, 11:27 PM
Gladsomebeast Gladsomebeast is offline
Member
 
Join Date: Mar 2005
Location: Isla Vizta, CA
Posts: 397
As Jeff pointed out, the message receiver needs to do different things depending on the message type.

For flexibility, try adding a 'messageType' variable to all your <mailbox>.send() calls. That way you can check the 'messageType' in your 'onNetwork' function then access the variables you know come with specific message types.

Code:
CREATE_PERSON_NETWORK_EVENT = 1
UPDATE_PERSON_NETWORK_EVENT = 2

def personJoined():
    mailbox.send(messageType=CREATE_PERSON_NETWORK_EVENT, avatarFileName='blabla.cfg')

def sendPersonData(person):
    mailbox.send(messageType=UPDATE_PERSON_NETWORK_EVENT, euler=...


def onNetwork(e):
    if e.messageType == CREATE_PERSON_NETWORK_EVENT:
        viz.add(e.avatarFileName)
        ....
    elif e.messageType == UPDATE_PERSON_NETWORK_EVENT:
        otherPerson.setEuler(e.euler)
Also, the viznet.py module will help you create more robust networked applications.

Jeff or Farshizo can you post that *sweet* viznet demo with the boxes and springs?
__________________
Paul Elliott
WorldViz LLC
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with getting head bone rotation right Enlil Vizard 2 02-13-2009 10:24 AM
Awkward neck/shoulder connection when adding custom head to vcc model. vEsotu Vizard 5 10-09-2008 05:07 PM
problems adding a custom morph head to a custom body Greenwu Vizard 1 07-27-2006 10:32 AM
avatar head texture issues rconrey Vizard 3 11-17-2004 04:05 PM
How to simply texture an avatar's head with a jpeg graphic? vr_boyko Vizard 3 10-26-2004 10:44 AM


All times are GMT -7. The time now is 11:52 PM.


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