Simple test on UDP communication between Processing and Maya. The resulting system works quite well and really fast with up to 250 agents, above that limit it slows down a bit, but it still good (I’ve tested it with up to 2000 agents, and it still works, even if quite slow…).
The flocking script is based on Jose Sanchez’s example “flocking_01” for the Plethora library ( www.plethora-project.com)
The Python script is based on the examples of UDP communication from the Python wiki (http://wiki.python.org/moin/UdpCommunication)
– check that the ‘IP port’, ‘bufferSize’ fields are the same in the two scripts, and that the ‘numElements’ field in the Python script has the same value that the ‘numParticles’ field in Processing
– run the Phyton script. It should start to stream the Processing particles into Maya.
– if Maya is giving you a ‘10400 error’, you need to increase the value of ‘bufferSize’ in both the scripts, or you need to check that all the values set above are the same in the two scripts.
– when you want to stop the stream, go to the Processing window and press ‘u’ again.
– in the Maya script editor you should get a message ‘stream stopped’. If this does not happen, try to restart and restop the stream for processing. Do not try to do anything in Maya before getting the message, otherwise the software will crash.
– once stopped the stream, you’ll find in Maya one polyCube object for each Processing particle and a curve describing the particle trajectory.
– if you do not want to have the trajectories curves,comment out all the lines after ‘sock.close()’ in the Python script and run the scripts again.
Link to the files: