top of page
jennifervdb3

Setting up communication between Maya and the Arduino

Updated: Mar 9, 2021

The next step is to set up communication between Autodesk Maya and the servo's that are connected to the Arduino Uno. In order to do that I need to find out how to send data through Maya's command port and receive it through the Arduino's Serial port.


The tool I found, which was also recommended by my mentor, is called "Servo Tools for Maya" by Dan Thompson. Dan Thompson established a connection between Maya and the Arduino using Python and a python module pySerial. The script and information about the tool are dated around 2009, so it is expected to be outdated. However, the tool cannot currently be downloaded since the website is down for an unknown duration. Most of the recourses used by Dan Thompson are not retrievable since those websites are down as well.


In order to retrieve the tool, I contacted a few people who have used it in the past including Dan Thompson himself.


What I know so far:


Maya 2018 64-bit can't communicate with pySerial since it is a 32-bit app

Maya doesn't have a serial port but uses a command port


The next steps


For my next step, I will work on setting up a communication line from within Maya to an external application. Once I am able to send data from Maya then I proceed by setting up the connection between Autodesk Maya and the Arduino. Once everything is connected I can start testing the servos.


First communication line


The first communication line is currently established. For this connection, an example[1] by the Technical artist Antti Verajankorva is used. In this example, a communication line is established between Autodesk Maya and Unity. Unity sents positional data through a TCP client which Maya receives through its 1234 port. In Unity, we get the main camera coordinates, which are converted to a string in the format of a Maya command. Knowing that Maya immediately tries to run all the strings received through the port, and since the string is already written as a Maya command, we don't have to do anything anymore. See fig1.


Figure 1. Maya receives data from Unity and updates accordingly (Own work)


The only problem encountered while working on this example was that the Maya cube with the name "camera1" only updated position when the coordinates in Unity were integers, whole numbers. As soon as the Unity camera had a float value Maya outputted a syntax error. Very quickly it was realized this error was due to the comma from the float value. Maya doesn't take a comma, but instead, it takes a period. This problem was solved by changing the comma into a dot before sending it to Maya.


Now we need to turn this around and send data from Maya to Unity.







88 views0 comments

Comments


bottom of page