Native Maya UI Elements in PyQt interface

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  11 November 2011
Native Maya UI Elements in PyQt interface

Hey Guys,

I was wondering if there was a way to get interfaces you've created before (without PyQt) in Mel or Python into a PyQt layout, for example as if its a widget.

I'm currently trying to create a special window to hold a combination of my older scripts. I want the global box to run on PyQt and contain sub-interfaces/modules from older scripts (plain MEL/Python UI) but with minimal changes to my original UI scripts, preferably close to nothing.

Any tips on how to do this? Since the Maya UI commands are now actually creating PyQt elements, how can I get them to work together nicely?

Thanks in advance.

Regards,
Roy
 
  11 November 2011
Check out the API class MQtUtil:
http://download.autodesk.com/global..._q t_util_html

You can use that in combination with the PyQt 'sip' module.
 
  11 November 2011
So does this make it possible to run Maya native commands to become part of the layout or add them to the layout? For example:

cmds.columnLayout()
 cmds.button()
 cmds.button()
 cmds.setParent()


I'll try to do some more research into the link you gave me. So far I've already been having a hard time installing the 'sip' module within Maya's Python.

Thanks!

-Roy
 
  11 November 2011
Installing PyQt & sip in maya is a whole other topic. But once you have that going you can use MQtUtil.
I found this nice example:
http://nathanhorne.com/?p=183
 
  11 November 2011
To embed a native Maya Qt widget into a PyQt widget you need to create the Maya widget first, and then using PyQt alter it's parent to be the proper location/layout inside your PyQt hierarchy.

Here's an example embedding a cmdScrollFieldExecuter (Script editor input) into a QMainWindow:
http://nathanhorne.com/?p=381
__________________
www.nathanhorne.com - Technical Artist
 
  11 November 2011
Hey Nathan,

That's awesome. Once I get this thing up and running I'll start playing with it!

Thanks all.

Regards,
Roy
 
  11 November 2011
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 12:25 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.