Hey Daz.
No worry. I'm a newbie myself. Believe me, when I just started, I bombard
this group with tons of questions and everyone was very helpful :)
So first, the getMayaWindow() function is there to tell PyQt that the UI
we're creating is a child of Maya's UI. Without it, your UI will still
work. But it can, and will, go behind Maya's windows. Making it kinda
annoying to find. Don't worry about the content of it much, just use it the
way it is.
Next, what you do, is you sub class one of PyQt's UI class. For example
testUI = QtGui,QMainWindow()
testUI.show()
Similar idea, instead of typing out the base class yourself, you let uic do
it for you (plus loads the ui in the process)
baseUI = "path/to/ui/file"
from_class, base_class = uic.loadUiType(baseUI)
Then you subclass your own class from those 2.
class myUI( base_class , from_class ):
def __init__(self, parent=getMayaWindow()):
super(base_class, self).__init__(parent)
self.setupUI()
And that's where you tell your UI to become child of Maya's window. You can
replaced the getMayaWindow() with None to see what happens.
Now to display your UI :
test = myUI()
test.show()
Next. You have a QPushButton named "btallsettings". We want it to fire off
a command when clicked. So, add this to your __init__
self.btallsettings.clicked.connect(self.btallClicked)
and add a new def within the class
def btallClicked(self):
# do whatever you want
cmds.sphere()
You can read more about each class in nokia's website.
http://doc.qt.nokia.com/4.7/index.html I found it a ton easier to
understand than PyQt's riverbank site.
I hope that helps clarify some basics! :)
Best regard,
Panupat.
--
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings:
http://groups.google.com/group/python_inside_maya/subscribe