Hi all and thanks in advance! ;)
I have a class:
class UiSample() :
def __init__( self ) :
uiPath = "/rd/dfevrier/hg/code-snippets/qtDesignerUiSample/
qtDesignerUiSample.ui"
mainWindow = cmds.loadUI( uiFile=uiPath, verbose=True )
cmds.showWindow( mainWindow )
def dump( self, args ) :
print "something"
I have a simple .ui file with a button and a dynamic attribut on it:
"+command" and a value: "self.dump".
The prob is that when I load the ui I have this:
# Executing: import maya.cmds as cmds;cmds.button('Form1|
horizontalLayout|verticalLayout_2|
dumpButton',e=True,command=self.dump) #
# Error: name 'self' is not defined
# Traceback (most recent call last):
# File "<maya console>", line 1, in <module>
# NameError: name 'self' is not defined #
I suppose que class is not pass to the loadUI function during the
creation and it is not able to get "self".
Is there a way to handle loadUI in a OO method? Like PyQT or something
like that.
What is the good way to script UIs with maya's loadUI in Python?
Thanks for help! :)
--
http://groups.google.com/group/python_inside_maya