Okay, made feature request for two callbacks (logged as #27725):

beforePaste: called before data is dropped to DAG
afterPaste: called after data is dropped to DAG

Diogo, I have a special node whose input needs to be set to a specific
dependency automatically on copy/paste. Sticking the code in an onCreate
works when copy/pasting, but has the side effect of also running on script
load, which is too slow on loading larger scripts as it loops through
everything, checking for my special nodes and their inputs. Also, if the
user specifically disconnects the input, I don't want it reconnected on
script load.

Currently I'm doing it through a drop data callback, which works, but is
less than ideal for the reasons I gave before. Any other way to do this
that you can think of?

-Ean


On Wed, May 23, 2012 at 2:50 AM, Diogo Girondi <diogogiro...@gmail.com>wrote:

> I agree, a onPaste() would probably be welcome.
>
> What are you trying to do exactly? Maybe there is another way to handle it.
>
>
> cheers,
> diogo
>
>
> On Tue, May 22, 2012 at 3:36 AM, Ean Carr <eanc...@gmail.com> wrote:
>
>> Hey Diogo,
>>
>> Problem with onCreate is it's too broad in its reach: also triggered when
>> a script loads or when a node's created from the toolbar, etc.
>>
>> Doing what I need via a drop data callback is my current hack, but means
>> I have to deal with the rest of the stack if all I'm after is one node.
>> This could work, though, if I could extract my part of the text, return
>> True on that, but return None on the rest so Nuke deals with it. Is that
>> possible?
>>
>> Thanks,
>> Ean
>>
>> On Mon, May 21, 2012 at 2:17 PM, Diogo Girondi <diogogiro...@gmail.com>wrote:
>>
>>> In theory onCreate() should catch any clipboard paste.
>>>
>>> The addDropDataCallback() also catches stuff pasted from the clipboard
>>> depending on what you need to do.
>>>
>>> Hop this helps.
>>>
>>>
>>> cheers,
>>> diogo
>>>
>>> On Mon, May 21, 2012 at 9:48 AM, Ron Ganbar <ron...@gmail.com> wrote:
>>>
>>>> There should be something.
>>>> Otherwise how does the paste into the DAG work?
>>>>
>>>> R
>>>> On May 21, 2012 1:12 PM, "Ean Carr" <eanc...@gmail.com> wrote:
>>>>
>>>>>  Hi,
>>>>>
>>>>> Would really like something like an onPaste callback. Anyone know if
>>>>> it exists but I'm just overlooking it? If not, will file a feature 
>>>>> request.
>>>>>
>>>>> Cheers,
>>>>> Ean
>>>>>
>>>>> _______________________________________________
>>>>> 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
>>>
>>>
>>
>> _______________________________________________
>> 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

Reply via email to