Qt for Maya

I know that the designer is a big leap compared to the traditional way of doing things in MEL, but is all the effort in learning and connecting the codes together really worth it?

At this point, all I do with Qt are simple windows that I can very well do in MEL as well(with a little more effort). So, is there something really amazing that Qt can do that MEL cannot, as in something mind-blowing in the sense that my animators will bow and worship me the moment they see new shiny Qt UI? :eek::eek::eek:

If you’re just doing very simple GUI’s then the benefits wont really be noticeable ( as I presume you have observed base on your post ). But Qt is far more powerful than Mel, you just have to get yourself out of the standard gui mind set and start thinking about interfaces more creatively.

An example would be the creation of a synoptic to aid in interacting with a control rig. Typically this tend to be pretty static, but we used Qt and it allowed us to set it up so selection widgets scale up or down depending on the distance to the mouse, we have complete control over the drawing of links between controls. We also have an editor for it, which allows our riggers to use drag and drop to place selection and menu widgets on a canvas easily, meaning they don’t end up spending hours in PhotoShop.

We also have a tool that allows the adjust of a radial blendshape curve definition. This is elegantly inserted into the UI because we draw and control the curve through Qt. You can override the paintEvent of most widgets, therefore its the flexibility of Qt that makes it so much more powerful.

Thanks, currently my GUIs are all made in MEL in the painful way…

So, if I have Qt, will this allow me to bypass the scriptJob way of selecting a character’s controls through a schematic? I really want to streamline this part of my GUI so that animators will have more fun since scriptJobs tend to be slow.

Also, will Qt give me a mini “2D viewport” so that I can have a completely irrelevant UI tucked in somewhere that the animators can navigate?

Thanks, been using Qt for some time but just for the simple stuff…I cannot find any sick Qt examples on the net to motivate me enough to at least master it.

IMO Qt has been definitely worth learning, even for basic stuff.

a) I can use the same UI code for something inside Maya as tools outside. In fact, I can create a set of widgets that I can reuse easily inside every application.
b) Building a simple UI in Qt is way faster and more intuitive than Maya’s UI code. It seems daunting at first, but once you’re over that hump, I’ve stopped making UIs using Maya’s UI code if I can help it.
c)Qt is very flexible. You can customize as much or as little of it as you want. Like today, with 10lines of python, I made my widgets highlight objects in the viewport when the user hovers over my widget.

Animators in the end won’t care what you use to make a tool, but like any user, they will respond well to responsive UIs.
Like Mike said, his buttons grow when the mouse gts closer. I doubt it changed any lives, but it definitely makes the tool a little more user friendly. ANd equally important, it makes it more appealing.
Animators, and anyone who is not a command line fogey, prefers prettier UIs and will be more likely to use a tool that’s pretty than one that’s not.

[QUOTE=ricoMambo;21432]Thanks, currently my GUIs are all made in MEL in the painful way…

So, if I have Qt, will this allow me to bypass the scriptJob way of selecting a character’s controls through a schematic? I really want to streamline this part of my GUI so that animators will have more fun since scriptJobs tend to be slow.

Also, will Qt give me a mini “2D viewport” so that I can have a completely irrelevant UI tucked in somewhere that the animators can navigate?

Thanks, been using Qt for some time but just for the simple stuff…I cannot find any sick Qt examples on the net to motivate me enough to at least master it.[/QUOTE]

You will either need a script job or some API hackiness to get when Maya selects an object directly, but I doubt any selection scriptJobs would be significantly slow?
And yes, you can parent any Maya widget inside a Qt widget, so you could put a modal panel in there

Thanks. My current work around for that is to kill ALL scriptJobs associated with that UI when it is closed, can I do that with Qt as well? I have been searching the net for Maya Qt tutorials and I cannot find one that is “good enough”. Some are just confusing, adding to the confusion is that I am using OSX at home and having trouble with Qt Creator running properly and at work it is Windows7 and Linux for me…

What is the best workflow? The easiest that I can think of is Qt + MEL, I do not mind Python, in fact I prefer it over MEL but it seems to be more troublesome working with Qt + Python.

Thanks again, please bear with me since I am in the middle of transitioning to Qt. I am an animator/generalist myself so I like to see cute GUIs as well, ha!

All Qt widgets can implement a close event. You can put any code you want in there.

As for QtDesigner, I’m almost inclined to differentiate it from Qt.
Qt Designer creates XML files that either Maya or Qt can convert into the equivalent Qt code at runtime. It’s usually just a starting board for quick UI design and isn’t really harnessing a lot of power of Qt.

What you really want to do is learn PyQt. The reason I say that is because it’s a lot more powerful, and you gain a lot more out of everything using it.(For example using it with Qt Designer also becomes more straightforward rather than the hacky way Maya natively implements things.)

Using Qt with MEL is a really roundabout way of using it, since every Qt interaction is MEL <–> Maya <–> Qt, whereas with Python you can use PyQt and interact directly with your Qt UIs

I learned Qt using this tutorial. I’ve been using Qt less than a year now, and this definitely helped.
http://zetcode.com/tutorials/pyqt4/

Amazing! I am bookmarking it now. I do have that Python for Maya book and they use PyQt. One of my problems is that Qt creator is not showing the proper forms or the Qt GUI template thing, I have no problems with this on windows but I am working on a Mac right now. Do I need to download the SDK separately for this?

OK, so PyQt it is…I really do not have any problems with Python anyway. I find it surprising how I survived 15yrs in the industry without even the need for fancy UI making, but I really want to upgrade my skills and Qt is one of the only ways that I know that could help me do that. It will make my work so much more professional and pleasant to work with. Thank you very much,sir. That was a real boost.

I think OSX is the only platform that Maya doesn’t include QtDesigner with.
You can download the SDK from the main Qt site and it’ll work the same, but try and stick to as close a Qt version as you can to the Maya version you have.

Thanks for the tip, I did that yesterday actually but no success. I guess that I have not much choice now.

Wanted to throw in my two cents:

I find that designing with the Designer is great for laying out complex windows. It can all be done in code, but when you’re doing constant iterations it’s often simpler to use the editor.

My workflow so far has been to design in the designer for non-trivial windows, use pyuic4 to convert it to Python, then subclass form that file and do all my signal and slot connections. I use a simple makefile to do the conversions:

all : window_UI_base.py

window_UI_base.py : window.ui
	pyuic4 $<>$@

So, I save in Designer, then use the makefile to generate all the various windows that are in the project. HTH.

As far as what you can do with PyQt that you can’t do with MEL: custom nodal connection interfaces has been the big one for me, as well as custom widgets for character pickers.

EDIT: Forgot to say, you can get the Maya window for PyQt windows (I forget how exactly, but I think Nathan Horne had it on his site), so when you create the scriptJob you can parent it to the Maya window and it’ll clean itself up automatically.

I hope I am commenting right if not I apologize ahead of time.

I have used Qt and figured I would get back to learning mel and python. My strength is C++ and I program using it in Qt. I would love to be able to do this with Maya. It bring so many things to mind that I can do. Especially that if I can program with C++ and use Qt to process the code to maya, that would mean little learning code. My question is; Can I program my normal way in C++ run it through Qt, then have it process over to work with maya.