Try setting the file knob using the 'fromUserText()' method instead of 'setValue()'. This will trigger the Read node's internal callbacks responsible for setting the first and last frame, as well as the resolution and colorspace.
Also, keep in mind that onCreate will be called every time the Read node is constructed. So, if you have a script full of Read nodes and re-open the script, it will still be called for each one of them. By the looks of it, it sounds like you would probably be better off with a onUserCreate callback. Either that, or a knobChanged callback triggered by the 'file' knob, so your function also runs when someone changes the path/file on an existing Read node. Hope that helps. On Tue, May 3, 2011 at 5:05 PM, Brogan Ross <[email protected]> wrote: > So basically this is what I'm doing: > > Set a addOnCreate for read nodes > When read node is created grab the file knob, > Check the path for certain conditions, > If conditions are met, change path slightly > And set the read's file knob to new path > > But when it changes the file knob, the first and last knobs both get set to > one. Anyone else run into this? Or know a way around it? > > _______________________________________________ > Nuke-python mailing list > [email protected] > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python > >
_______________________________________________ Nuke-python mailing list [email protected] http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
