Hey Carlo, You need to create an instance of the myPanels class in your createNodeName() function and then get the value of name from the instance:
p = myPanels() node_name = p.name.value() ... If you want to do it a little cleaner, you could implement an interface method in your myPanels class to access the class attribute instead of getting its value directly. That seems to be better practice in Python: def get_name(): # Possibly do other stuff first, like check if the node has a value before returning it return node_name Cheers -Ean On Mon, Nov 12, 2012 at 8:38 PM, CarloM <nuke-python-re...@thefoundry.co.uk>wrote: > ** > Hey guys > > I have this panel which is pretty simple just a string_knob and > PyScript_Knob. I'm trying to store whatever I type In the String_knob and > use it for the name of the NoOp. I just can't figure out how to store my > self.name.value() to use later on in my createNodeName() function > > *Code:* > class myPanels ( nukescripts.PythonPanel ): > > > def __init__( self ): > nukescripts.PythonPanel.__init__( self, "testPanel", "myCustomPanel" ) > > self.name = nuke.String_Knob ( "bookMarkName", "Name:" ) > self.addKnob ( self.name ) > self.makeName = nuke.PyScript_Knob ( "createName", "Create" ) > self.addKnob (self.makeName) > self.makeName.setValue ( "createNodeName()" ) > print self.name.value() > > > def createNodeName(): > > nuke.root().begin() > > markerName = self.name.value() > > > marker = nuke.createNode("NoOp") > marker['name'].setValue(markerName) > > [/code] > > > ------------------------------ > > life is a pixel > > _______________________________________________ > 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