test_panel is your panel class. Since 'check' is defined in __init__, it doesn’t exist until you create an instance of the class. I recommend reading up a bit on Python classes.
p = test_panel() p.show() def print_value(): if p.check.value(): print "It's true" else: print "It's not true" Hope this helps -Nathan From: Kristopher Young Sent: Sunday, November 11, 2012 9:52 AM To: Nuke Python discussion Subject: Re: [Nuke-python] Pyhon panels and functions Hi Howard, I tried your suggestion but it returns "type object 'test_panel' has no attribute 'check". Any idea? I tried with test_panel["check"].value() but that didn't work either. 2012/11/11 Howard Jones <mrhowardjo...@yahoo.com> I'm not the best at this by any stretch but isn't it def print_value(): if test_panel.check.value() == True: print "It's true." else: print "It's not true." ____________________________________ Howard On 11 Nov 2012, at 09:28, Kristopher Young <youngkristophe...@gmail.com> wrote: > def print_value(): > > if self.check.value() == True: > print "It's true." > else: > print "It's not true." > ____________________________________ _______________________________________________ Nuke-python mailing list Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python -------------------------------------------------------------------------------- _______________________________________________ Nuke-python mailing list Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
_______________________________________________ Nuke-python mailing list Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python