Announcement

Collapse
No announcement yet.

Python Scripting to Viz Engine

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Python Scripting to Viz Engine

    Has anyone used python scripting to connect to a Viz Engine to feed data? I saw an example but cant figure out how it works.

  • #2
    Shotski2 Hello, yes it is possible, I did it as a test, and I was able to change text for specific containers, I was parsing an xml file, extracting info from the xml and setting text or images depending on what the xml info was.

    I hope this is of some help, good luck


    Code:
    def talkToViz():
        #This is a variable I used in another part of the code
        global currentSponsorImage
    
        ## Create a TCP/IP socket
        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        
        # Connect the socket to the port where the server is listening
        
        # this is the artist machine, where I was testing
        server_address = ('192.168.5.25', 6100)
        
        # this is the ticker engine, this is to confirm I could talk to other engines
        #server_address = ('192.168.5.12', 6100)
        
        #print >>sys.stderr, 'connecting to %s port %s' % server_address
        sock.connect(server_address)
        
        #Commands I was sending to the different engines
        #sock.send('0 RENDERER*FUNCTION*DataPool*Data SET tickerSponsorImage=' + str(currentHouseNumber) + '\0')
        #sock.send('0 MAIN_SCENE*TREE*$tickerSponsor*IMAGE SET IMAGE*KFMB_VER01/MASTER_CONTROL/TICKER_SPONSORS/' + 'name of the image' + '\0')
        
        # Next line is used to send a command to the engine, preffix and suffix were
        # declared at the top, this are just variable with viz commands, see the above line that starts, #soc.send...
        sock.send( vizCommandPreffix + currentSponsorImage + vizCommandSuffix)
        test to make sure the engine is reading what I'm sending
        print vizCommandPreffix, ' ', currentSponsorImage, ' ', vizCommandSuffix
        sock.close()
    
    main()

    Comment


    • #3
      Thanks Matzunaga, Do you have a scene i could use to see the workflow of this?

      Thanks,Shotski

      Comment

      Working...
      X