CGTalk > Software > Autodesk Maya > Maya Programming
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 04-15-2013, 06:53 PM   #1
animatedfox
what the ?!?!
 
animatedfox's Avatar
portfolio
Benjamin Fox
Seat 43
USA
 
Join Date: Feb 2010
Posts: 897
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
 
Old 04-15-2013, 07:41 PM   #2
animatedfox
what the ?!?!
 
animatedfox's Avatar
portfolio
Benjamin Fox
Seat 43
USA
 
Join Date: Feb 2010
Posts: 897
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!
 
Old 04-17-2013, 05:53 PM   #3
TimCallaway
Problem Solver
 
TimCallaway's Avatar
portfolio
Timothy Callaway
Technical artist
SP
USA
 
Join Date: Jul 2008
Posts: 265
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
 
Old 04-17-2013, 08:49 PM   #4
animatedfox
what the ?!?!
 
animatedfox's Avatar
portfolio
Benjamin Fox
Seat 43
USA
 
Join Date: Feb 2010
Posts: 897
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/
 
Old 04-17-2013, 10:05 PM   #5
TimCallaway
Problem Solver
 
TimCallaway's Avatar
portfolio
Timothy Callaway
Technical artist
SP
USA
 
Join Date: Jul 2008
Posts: 265
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
 
Old 04-18-2013, 02:05 PM   #6
animatedfox
what the ?!?!
 
animatedfox's Avatar
portfolio
Benjamin Fox
Seat 43
USA
 
Join Date: Feb 2010
Posts: 897
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!
 
Old 04-18-2013, 03:53 PM   #7
TimCallaway
Problem Solver
 
TimCallaway's Avatar
portfolio
Timothy Callaway
Technical artist
SP
USA
 
Join Date: Jul 2008
Posts: 265
I had the same trouble, it's better to call it with python.
Code:
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
 
Old 04-18-2013, 06:27 PM   #8
animatedfox
what the ?!?!
 
animatedfox's Avatar
portfolio
Benjamin Fox
Seat 43
USA
 
Join Date: Feb 2010
Posts: 897
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-18-2013 at 06:36 PM.
 
Old 04-18-2013, 06:38 PM   #9
TimCallaway
Problem Solver
 
TimCallaway's Avatar
portfolio
Timothy Callaway
Technical artist
SP
USA
 
Join Date: Jul 2008
Posts: 265
Sent you a PM.
__________________
Webiste/demoReel
 
Old 04-18-2013, 06:38 PM   #10
CGTalk Moderation
Expert
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,478
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 02:39 PM.


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