0
class gui():

    def selCon(self):
        print selection

    def create(self):
        inst=gui()
        cmds.button(l="Connect to Selected",command='inst.selCon()')

I keep getting error saying name 'inst' is not defined # dont understand when method is in the same class and when I am making a call clicking the button i get this error message

3
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by vegaseat
0

following top link i gave you above i did this

cmds.button(l="Connect to Selected",command=self.selCon)

and then I got error saying selCon accepts no 1 argument (2 given) #

so in the selCOn function i made this change

        def selCon(*args):
            print args[0], args[1]

hitting the button gives following
Render.gui object at 0x13EC1910> False

so now it works , I printed args values to see what is passed , I did understood what the first one is but from where does the second one(False)comes from ..

0

Try
cmds.button(l="Connect to Selected",command='self.selCon')

I wouldn't use l it looks to much like a number 1

Edited by vegaseat

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.