Building a Qt UI for My Plugin

  • #qt #tools #maya
  • 288 words, Read time 1 minute, 26 seconds

So, I'm working on my Pseudo 3D project. The core functionality was finally done, which felt great, right up until I remembered how you actually use it.

Because it is a Maya plugin, running anything meant one of two things: typing my commands into that tiny command box wedged at the very bottom of the editor, or opening the script editor and typing them there instead. And my commands were abbreviated so aggressively that even I could not reliably remember what half of them did.

So I could either hand everyone a cheat sheet and ask them to memorize my cryptic shorthand (which, honestly, I would have loved), or I could build a control panel and frame the plugin as simple and friendly all along. What a saint I am.

Maya speaks Python, so I reached for PyQt and put together a small UI: buttons and fields wired to the controls nobody should have to memorize. Along the way I also spotted some other UI libraries I would love to try in future projects (Clay looks very cool).

My take on Qt: the version situation is a pain. There are so many of them, and a given Maya release only works with the Qt version it ships with. If there's a mismatch, you'll suffer through finding the issue for two hours. But other than that, it is genuinely fine and has almost everything I need. Hooking PyCharm up to Maya also made development a lot less painful.

That is about all I can say at this stage. The plugin is easy and simple to use now, I promise. And if you believe that, I have a tiny command box at the bottom of the screen to sell you.