Try writing your UI and the commands from scratch, don't use designer :) It may seem a little intimidating at first, but trust me its worth it.
> From the big pop it makes as soon as I put in the smallest non-zero value, > I'd see it's simply buggy... > > - Ofer > www.mrbroken.com > > > On Wed, Mar 16, 2011 at 5:26 PM, Narann <[email protected]> wrote: > >> 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 >> > > -- > http://groups.google.com/group/python_inside_maya > -- Shaun Friedberg 04-902-0443 http://www.pyrokinesis.co.nz "Fire Is Fun, When You Think About It" -- http://groups.google.com/group/python_inside_maya
