Example shown: Allow a text input variable to be passed to Maya
Prior to starting, you will need to opena port on Maya to allow commands to be sent. This can be done done in one of two ways. Copy (Right click and choose save) this script to your Maya scripts Start up directory.
Windows: or you can create your own script using the following command to open the port and save the script as userSetup.mel You may be saying, big deal, you can send a message in maya. Well, think about some of the broader implications. In this example we sent text, but you could also pass things like scenes, render commands, Custom Mel scripts accross an entire network etc.commandPort -n ":5055";import socket
maya = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
maya.connect(("127.0.0.1", 5055))<br />
Maya_text = raw_input("What do you want Maya to say: ")
maya.send(r'print "'+Maya_text+'"')