Maya shared memory

A real time bridge between a custom app and Maya.



This is a viewer and a plugin for Maya that me and two other students created during a level editor course. It is a proof of concept showing how the OpenMaya API can be used in a C++ plugin to communicate with an external application using shared memory.

My contributions

Both the viewer and the plugin was written together with two other students.


Maya Shared Memory, on the right is our renderer, it shares a chunk of memory with Maya that the applications use to communicate.

Since the bridge between the applications are in the shape of shared RAM, the communication between the applications is very fast, despite not having optimized the code at all. For instance, when moving several vertices one update is sent for each vertex, but as you can see in the video, this all happens in full real time even when many vertices are moved at the same time.

We also take for instance the textures from Maya and share them with the viewer using the shared RAM.

The Maya plugin relies on callbacks that allow us to call a method in our viewer's code whenever specific things happen in Maya. Such as when a model is moved, an object is imported etc.

There are three distinct parts in this project, the 3D viewer (the reader), the Maya plugin (the writer) and the shared memory handler that is implemented in them both to allow them to share a chunk of memory.

The reader will wait for the writer to write something to the memory, at which point it will read the data and perform the actions described in the memory.