this is a wild shot, but maybe it's possible replace the standard delete action with your own function? (or at least have the delete keyboard shortcut to call your function)?

that way you could do something like:

if selectedNode is part of a doNotDeleteList
    put up alert (or do nothing)
else
    call built-in delete function

might be a completely stupid idea, but might help to think of other things
++ chris


On 2/13/12 at 11:15 AM, ch...@thefoundry.co.uk (Chris Bevan) wrote:

The only thing that came to mind for me was adding an onDestroy callback to check whether the node is one we're not supposed to delete:

def showError():
nuke.message("You deleted the wrong node!")
nuke.addOnDestroy(showError, nodeClass='Dot')

I tried triggering an undo during the callback, but unfortunately it undoes the previous action, because the node deletion hasn't been registered yet at that point. From a quick glance I also wasn't sure how to see what node was being deleted, other than the class.

May be food for thought, anyway...

- Chris

On 08/02/12 19:55, J Bills wrote:
is there any way to essentially lock a node so it can't
accidentally be
deleted?

I'm making a template and for organizational sake, some of
the
expressions rely on certain dots and noop nodes being in
place.  without
them, my script looks like a rats nest, but with them it's
gold.  but I
don't want someone who's not all that down with dots or
whatever to
start deleting things.

other than putting a "do not delete" in the label, is there
anything
scripty I could do here?


This body part will be downloaded on demand.


_______________________________________________
Nuke-users mailing list
Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

Reply via email to