Onion Skinning Script for Maya

February 2019

Coming back from a 2D animation project I really missed the onion skinning features in Maya. So I decided to dive into the Maya api a bit. The solution I was aiming for was a renderer based approach. So there I was, having no clue of anything, trying to make sense of the Maya API. With the help of the examples provided with Maya and heavy use of Google, I was able to cobble together a working version of the idea. Over time and with the feedback of many different people the project turned into a very useful tool. What surprised me most, is how much response I got for releasing this tool. I am very happy that it helps people in their workflow. You can try it for yourself by venturing to my Github page. If you do like it or you know ways of improving please just let me know. Email is on the about page. Here is a short tutorial on how it works.

The Core

Under the hood it works by rendering every frame one more time with only the objects that should be onionized. This rendering is then buffered and when needed put on top of the window. This allows for relative onion display, where only the onions close to the time slider are displayed. This approach has one obvious disadvantage. It updates only the frame you are currently on. So you need to rebuffer to see changes. This is especially annoying when you move the camera as you need to rebuffer everything. The advantage is, that it is independent of the complexity of the geometry. Really anything the Maya viewport can handle can be buffered.

Recent updates include more ways of displaying onion skins, like only drawing the outline or drawing the onion skins behind the original mesh. I will continue working on the tool for a bit, but I'd like to call it done soon. To be honest I'd like to create the same thing in Blender one day. But I'd have to learn coding for Blender from the ground up for that.

The UI

The UI is built in QT designer, which fortunately comes with Maya. I really cannot imagine anymore coding a UI by hand. I just convert the ".ui" file that I get to python using pyside2uic. All I do in code is setting up the connections to the core and adjusting the UI if items are added.
That way I am able to do rapid iterations on the UI. I find that half of the work is creating the functionality and the half is making it user friendly. Recent updates includ having sections that can be folded and making it dockable in Maya 2017 and onwards. I also felt like the ui was very crammed in the last versions, so I used a bit more space to make it more readable. However since sections can now be folded it's not that big of a deal.