You can also set the `nuke.DO_NOT_WRITE` flag on knobs that you don't want to be written to the script; you'll need to do this every time an instance of that node is created via a callback or something, since the DO_NOT_WRITE flag prevents itself from being written as well. Preventing an entire node from being written is probably a bad idea, because it could potentially screw up the structure of the node graph.
-Nathan From: Richard Bobo Sent: Monday, October 13, 2014 2:32 PM To: Nuke Python discussion Subject: Re: [Nuke-python] How to prevent certain nodes from being saved withscript? Just an update on this subject… It turns out that, because I’m using a full Python path to my function call in the hidden knobChanged knob, Nuke actually finds the function when the script gets saved and reloaded — bonus!! So, in other words, I don’t need to do anything at all — and it just works! 8^) Rich On Oct 13, 2014, at 3:52 PM, Richard Bobo <richb...@mac.com> wrote: Johannes, On Oct 13, 2014, at 3:12 PM, Johannes Hezer <j.he...@studiorakete.de> wrote: Hi Rich, lame answer, but callbacks seem to be the way to go here :-) At least I cannot think of another way to achieve this besides using callbacks. But the nodes would be deleted then each time one hits ctrl+s ?! Hahaha! Yes, that would be a rather annoying side effect! ;^) And, since I am the "king of excessive versioning”, I would be affected the most! LOL I guess I was looking for a way to make the nodes “invisible” to the script save routine. To ignore them, if you will. That could cause other, unexpected problems, I suppose. I guess I’ll have to think about some other options… Hmm... Thanks. Rich sth like def deleteCustomNode() customNodes = nuke.allNodes('customClass') for node in customNodes: nuke.delete(node) addOnSCriptSave(deleteCustomNode) Couldnt you stuff the function back into the knob instead ? I dont know what the idea behind all this is, but maybe that could work too... Cheers Johannes Am 10/13/14 20:58 PM, schrieb Richard Bobo: Hi, I have some nodes I am creating that I don’t want the user to save with the script. On their hidden “knobChanged” knobs, they reference an in-memory-only function that only gets loaded when the nodes are created. So, if they are saved with the script, the function is not found when they are restored and the custom knobs do nothing. So, I would like to prevent the nodes from being saved with the script. That way, the user will have to create new nodes the next time; the function will be referenced and loaded into memory and all will be well… What’s the best way to prevent a node from being saved? Should I use the onScriptSave callback? Or, is there a better way? Thanks, Rich Rich Bobo Senior VFX Compositor Armstrong White Email: rich.b...@armstrong-white.com http://armstrong-white.com/ Email: richb...@mac.com Mobile: (248) 840-2665 Web: http://richbobo.com/ "The nobler sort of man emphasizes the good qualities in others, and does not accentuate the bad. The inferior does." - Confucius ____ ESET 10555 (20141013) ____ The message was checked by ESET Mail Security. _______________________________________________ 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 ____ ESET 10555 (20141013) ____ The message was checked by ESET Mail Security. -- STUDIO RAKETE GmbH Johannes Hezer, Compositing TD & Stereoscopic SV Schomburgstr. 120 D - 22767 Hamburg j.he...@studiorakete.de Tel:+49 (0)40 - 380 375 69 - 0 Fax:+49 (0)40 - 380 375 69 - 99 ------------------------------------------------------ Pflichtangaben laut Handelsgesetzbuch und GmbH-Gesetz: STUDIO RAKETE GmbH Schomburgstr. 120 D - 22767 Hamburg www.studiorakete.de / i...@studiorakete.de Geschaeftsfuehrer: Jana Bohl Die Gesellschaft ist eingetragen im Handelregister des Amtsgerichts Hamburg unter der Nummer HR B 95660 USt.-ID Nr.: DE 245787817 ____ ESET 10555 (20141013) ____ The message was checked by ESET Mail Security. _______________________________________________ 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