Hey Diogo,
for some reason, when I read the text that's in my clipboard from a file,
or from the clipboard with your script I get different results. Any idea?
Oh, important to mention that when I read from file I get a raw text (so
new line appears as either \n or \r), but when I read from clipboard I get
the text as it is and I have to convert it by using:
text = text.encode('unicode_escape')but still it comes out different. Any idea? Ron Ganbar email: [email protected] tel: +44 (0)7968 007 309 [UK] +972 (0)54 255 9765 [Israel] url: http://ronganbar.wordpress.com/ On 22 April 2012 17:26, Diogo Girondi <[email protected]> wrote: > Yep, it works with the paste too. > > def dropSomething( mimeType, text ): > > if 'something' in text: > print 'do the jazz' > return True > else: > return False > > nukescripts.addDropDataCallback( dropSomething ) > > > 2012/4/22 Ron Ganbar <[email protected]> > >> Just yo make site Ean, does that work with the paste function? Not just >> drag and drop? >> >> Thanks >> R >> On Apr 22, 2012 5:13 PM, "Ron Ganbar" <[email protected]> wrote: >> >>> Hi Ean, >>> You guessed right. >>> I'll have a look at this shortly. >>> >>> Thanks >>> R >>> On Apr 22, 2012 3:07 PM, "Ean Carr" <[email protected]> wrote: >>> >>>> Hey Ron, >>>> >>>> Sounds like you want to add a drop data callback function. These are >>>> run just before Nuke handles dropped text into the DAG. Your function can >>>> parse the text, returning True if you handled it or None if not. >>>> >>>> I'm not in front of Nuke at the moment, so may be getting the below >>>> syntax a little wrong, but the short of it is: you should define a function >>>> somewhere (menu.py) and add its callable to the dict of drop data functions >>>> (you can define as many as you like): >>>> >>>> def doStuffDD(mimeType, text): >>>> if "foo" in text: >>>> nuke.message('foo found') >>>> return True >>>> return None >>>> >>>> nuke.addDropData(doStuffDD) >>>> >>>> Then, if you copy this sentence containing the word foo and paste into >>>> the DAG, the drop data callback you added will give you the message. >>>> >>>> -Ean >>>> >>>> On Sun, Apr 22, 2012 at 10:56 AM, Ron Ganbar <[email protected]> wrote: >>>> >>>>> Right, this file is mostly chinese to me. >>>>> If I want to add something to this paste function, so if it does not >>>>> find a tcl style node list and instead finds some other string (that can >>>>> be >>>>> identified with a find command to be something specific) it will run a >>>>> different script. Any ideas? >>>>> >>>>> >>>>> >>>>> Ron Ganbar >>>>> email: [email protected] >>>>> tel: +44 (0)7968 007 309 [UK] >>>>> +972 (0)54 255 9765 [Israel] >>>>> url: http://ronganbar.wordpress.com/ >>>>> >>>>> >>>>> >>>>> 2012/4/22 Ron Ganbar <[email protected]> >>>>> >>>>>> Thanks! >>>>>> >>>>>> >>>>>> >>>>>> Ron Ganbar >>>>>> email: [email protected] >>>>>> tel: +44 (0)7968 007 309 [UK] >>>>>> +972 (0)54 255 9765 [Israel] >>>>>> url: http://ronganbar.wordpress.com/ >>>>>> >>>>>> >>>>>> >>>>>> On 22 April 2012 12:45, Adrian Baltowski <[email protected]>wrote: >>>>>> >>>>>>> Hi >>>>>>> There is edit.py script located in plugins/nukescripts folder. >>>>>>> >>>>>>> Best >>>>>>> >>>>>>> W dniu 2012-04-22 10:05:19 użytkownik Ron Ganbar <[email protected]> >>>>>>> napisał: >>>>>>> >>>>>>> Hi guys, >>>>>>> any idea where I can find the paste from clipboard command, as it is >>>>>>> used to paste nodes into the node graph? >>>>>>> >>>>>>> Thanks, >>>>>>> Ron Ganbar >>>>>>> email: [email protected] >>>>>>> tel: +44 (0)7968 007 309 [UK] >>>>>>> +972 (0)54 255 9765 [Israel] >>>>>>> url: http://ronganbar.wordpress.com/ >>>>>>> >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Nuke-python mailing list >>>>>>> [email protected], >>>>>>> http://forums.thefoundry.co.uk/ >>>>>>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python >>>>>>> >>>>>>> >>>>>> >>>>> >>>>> _______________________________________________ >>>>> Nuke-python mailing list >>>>> [email protected], http://forums.thefoundry.co.uk/ >>>>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> Nuke-python mailing list >>>> [email protected], http://forums.thefoundry.co.uk/ >>>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python >>>> >>>> >> _______________________________________________ >> Nuke-python mailing list >> [email protected], http://forums.thefoundry.co.uk/ >> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python >> >> > > _______________________________________________ > Nuke-python mailing list > [email protected], http://forums.thefoundry.co.uk/ > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python > >
_______________________________________________ Nuke-python mailing list [email protected], http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
