on a second thought with this you don“t overwrite the name of the controls all the time so you will be able to query them later on
[CODE] class Main( nukescripts.PythonPanel): def __init__( self ): self.myList = [] nukescripts.PythonPanel.__init__( self, 'select file...', 'my.panel') self.defaultPath = 'c:/' self.createAndAddMyKnob() def createAndAddMyKnob(self): self.myList.append(nuke.File_Knob("File")) self.addKnob(self.myList[-1]) def knobChanged(self,knob): if nuke.thisKnob().name() == "File": self.createAndAddMyKnob() print self.myList Main().showModalDialog() [/CODE] On Wed, Jan 30, 2013 at 10:31 AM, Luca Fiorentini <luca.fiorent...@gmail.com > wrote: > Sorry I completely misunderstood your question :) > I think you should use a python panel and inherit his class > (nukescript.PythonPanel). > I wrote a quick snippet that should help you start. There are some > problems (like the filename searches are appearing under the ok buttons or > if you change and existing one you always get a new one) but I hope it > helps you! > Let me know. > > [CODE] > class Main( nukescripts.PythonPanel): > def __init__( self ): > nukescripts.PythonPanel.__init__( self, 'select file...', > 'my.panel') > self.defaultPath = 'c:/' > self.filenameSearch = nuke.File_Knob("File") > self.addKnob(self.filenameSearch) > > def knobChanged(self,knob): > if nuke.thisKnob().name() == "File": > print 'This one' > self.filenameSearch = nuke.File_Knob("File") > self.addKnob(self.filenameSearch) > > Main().showModalDialog() > [/CODE] > > > > > On Wed, Jan 30, 2013 at 12:44 AM, ArnoB <nuke...@rgbaz.eu> wrote: > >> Hey Luca, >> >> thanks for your reply. >> unfortunately that's not what I'm looking for. >> >> I have this: >> >> import nuke >> class Main(): >> def __init__( self ): >> self.Panel = nuke.Panel( "select file..." ) >> self.Panel.addFilenameSearch( 'file01', '/' ) >> >> self.Panel.show() >> >> def knobChanged( self, knob ): >> self.Panel.addFilenameSearch( 'file02', '/' ) >> refresh.Panel() >> Main() >> >> >> I'd like to add a new FilenameSearch line to the Panel >> when a file is select and its path shows up in the path field. >> >> >> I found this piece of code: >> >> http://www.mail-archive.com/nuke-python@support.thefoundry.co.uk/msg01821.html >> which seems to be doing something similar, EXCEPT >> that I like it to respond to the "open" button that shows up in the >> filesystemwindow... >> >> >> arno >> >> >> >> >> On 29 jan 2013, at 09:09, Luca Fiorentini wrote: >> >> In the project settings there is a tab called "Python" with three fields: >> >> onScriptLoad, onScriptSave and onScriptClose. >> >> Is it what you are looking for? >> >> On Tue, Jan 29, 2013 at 12:30 AM, ArnoB <nuke...@rgbaz.eu> wrote: >> >>> hello, >>> >>> I'd like to change the contents of a Panel according to the >>> name of a file that's chosen by the user. >>> Is it possible have a callback on the "Open" button of a >>> nuke.addFilenameSearch command? >>> >>> Maybe I'm searching in the wrong direction and there's >>> another way to update the Panel by clicking the Open >>> button after selecting a file...? >>> >>> >>> thanks in advance >>> >>> Arno >>> >>> >>> _______________________________________________ >>> 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 >>> >> >> >> >> -- >> *Luca Fiorentini - 3D Lighting Artist* >> My Showreel <http://www.vimeo.com/lucafiorentini/reel> - My >> blog<http://lucafiorentini.wordpress.com/>- My >> Flickr <http://www.flickr.com/photos/lucafiorentini> >> _______________________________________________ >> 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 >> >> > > > -- > *Luca Fiorentini - 3D Lighting Artist* > My Showreel <http://www.vimeo.com/lucafiorentini/reel> - My > blog<http://lucafiorentini.wordpress.com>- My > Flickr <http://www.flickr.com/photos/lucafiorentini> > -- *Luca Fiorentini - 3D Lighting Artist* My Showreel <http://www.vimeo.com/lucafiorentini/reel> - My blog<http://lucafiorentini.wordpress.com>- My Flickr <http://www.flickr.com/photos/lucafiorentini>
_______________________________________________ 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