QT UI not playing nice with MEL

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
  04 April 2013
QT UI not playing nice with MEL

I have a MEL GUI with whole bunch of dynamically set values: Objects in scene, frame range, working directory, current selection. I've been trying to add more stuff to it, but it got to the point that it is a bit cumbersome to get all the UI parts to look good and still be intuitive.
I fired up QT-Designer and realized this was the future, love it!
So I laid stuff out and named the wigets and loaded the UI in Maya.
Unfortunately, I can't for the life of me edit the textField or textScrollList values. All the stuff I find online suggests that you can just run the same MEL commands to set them, assuming the names are correct.
For example: (These are commands that filled out my Mel GUI)
textField -e -fi $startFrame startFrame;
string $objList[] = `ls "*GE?`;
string $each;
($each in $objList){textScrollList -e -a $each meshList;}

What step am I missing? I am totally new to QT-Designer...so is there some secret option I didn't set?
Do I just need to use PYQt?
Would love to not have to totally start over with all the set value commands...it seemed like things were going to work.
Any suggestions would be greatly appreciated.
~Ben
 
  04 April 2013
Got things rolling, it seemed my lack of QT Designer experience caused some issues. I think my issue was that I made a Dialogue instead of a Window...but no real idea. Restarted my layout and all is working.
So great!
 
  04 April 2013
Hot stuff. Using QT is the best thing ever!

You kinda have to do odd loops to make sure it works with mel haha. I'm doing a tutorial on some QT stuff for DT coming up.
__________________
Webiste/demoReel
 
  04 April 2013
Oooh that sounds very exciting, will definitely keep an eye out.
These links helped me out a bunch...yeah, I ended up switching to Python.
http://www.mattmurrayanimation.com/archives/180
http://www.chris-g.net/2011/06/24/m...ces-in-a-class/
 
  04 April 2013
If you could actually watch that Masterclass, It's a huge deal. The one where he makes a gui for his rig, it's sooooo good.

I'm using a combo of mel, pymel, pyqt4, python with qt designer. Sounds like you're doing it the way I do.

Just being able to dock the guis/windows in maya is so nice.
__________________
Webiste/demoReel
 
  04 April 2013
Ha, right now I am just doing Mel, Python and QT Designer...and yes, the docking is sweet.
One thing that I keep banging into with UI files is getting the name of a window from the UI file and killing any existing windows of that name before opening the new one. The examples I have seen all go

# File Path
uiFile = '/path/UIfile.ui'
# Load File
qtWin = mc.loadUI(f=uiFile)
# Delete Existing
if mc.window(qtWin, exists=True):
mc.deleteUI(qtWin, window=True)
# Show Window
mc.showWindow(qtWin)

When I run it like this, it always errors and says:
# Error: No window found. #
I have been able to get it to work in wonky hacky ways:
loadUI>Delete>loadUI again (OR) Explicitly state window name >Delete>loadUI
Any suggestions of a clean way to do this would be great.
And then, what if you dock it, then everything seems to change again in terms of checking if it exists and reloading.
Oh man...what have I gotten my self into!
 
  04 April 2013
I had the same trouble, it's better to call it with python.

import sys
Dir = 'c:/timQT'
if Dir not in sys.path:
    sys.path.append(Dir)
try: reload(Riggin_ui)
except: import Riggin_ui
Riggin_ui.main()
__________________
Webiste/demoReel
 
  04 April 2013
Wow, just when I think I am getting a handle on Python I get a reminder of how little I know. Not quite sure how this goes into my proc.
Right now, my only understanding of a way to get the window name from the file to find out the window name I need to delete before opening a new window is like this. Which is based on the way I did it with MEL...which I am sure is the wrong way to approach it...but it is what I know right now.
Surely there must be a way to get the window name from the ui file.

PHP Code:
 def myUiBad():
    
uiFile '/path/myGUI.ui'
    
qtWin mc.loadUI(f=uiFile)
    if 
mc.window(qtWinexists=True):
       
mc.deleteUI(qtWinwindow=True)
    
mc.showWindow(qtWin



Not quite sure how to implement your suggestion...but would love to learn if you are game. Any breakdown you could give would be greatly appreciated.
Thanks.

Last edited by animatedfox : 04 April 2013 at 06:36 PM.
 
  04 April 2013
Sent you a PM.
__________________
Webiste/demoReel
 
  04 April 2013
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 11:20 AM.


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