I think your problem is that you're using nuke.toNode('this'), and
'this' will evaluate to the current context every time.
To get back to your node, use nuke.thisNode() instead.
Also, if you're just stepping out of your node context to get the
paths for each Read node in root, you could use the "group" argument
in nuke.allNodes() to do that for you, so you don't have to go jumping
from context to context.
I.E.
allReadNodes = nuke.allNodes('Read', group = nuke.root())
On Tue, Aug 9, 2011 at 3:38 PM, robingraham
<[email protected]> wrote:
> So I have a group and some python script buttons. One of the other python
> script buttons actually creates more buttons within the group, it also tries
> to get a list of all read paths within the nuke script.
>
> The problem is that to get the list of read paths in the script I have to
> do:
> g = nuke.toNode('this')
> g.end()
> ....find all read paths.
>
> But then when I want to create knobs within the group I can no longer refer
> to nuke.toNode('this'). What is the best way to do both things in the same
> script? Is it that I have to assign nuke.toNode('this') to something at the
> begining of the script and then just use that variable to create new buttons
> and whatnot?
> _______________________________________________
> 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