Hi guys,
I'm new to using Python and QT. I finished this tutorial in mel and it worked great, http://animateshmanimate.com/2010/07/19/maya-and-qt-tutorial/, and I'm trying to figure out how to use QT with python now. I've gotten stuck and have no idea how to fix it.
I have a UI with a simple button in the center that you press and it's supposed to call the test() function to print out "Hello World".
The UI comes up just fine but when I click the button it gives me the following error:
// Error: Cannot find procedure "test". //
I set up the button the same as the buttons in the tutorial were set up (Adding a dynamic property of type string nammed -command and typing "test" in the text box so that it, supposedly, calls the function test() ). Please help? What is different between mel and python thats making this not work the same way and how do I fix it? Thank you!
Heres my python code:
import maya.cmds as m
def featherGenerator():
#If Maya's version is greater than or equal to 2011 go ahead
#set the scripts directory so we can load our ui file
scriptsDirectory = m.internalVar(userScriptDir=True)
#load the ui file
#temp= scriptsDirectory+'/featherGenerator.ui'
#featherGeneratorWindow = m.loadUI(f=temp)
featherGeneratorWindow = m.loadUI(f=scriptsDirectory+'/featherGenerator.ui')
#show the window
m.showWindow (featherGeneratorWindow)
def test():
print "HelloWorld"
#run the program so I don't have to type it in the command line every time.
featherGenerator()