If I’m doing things like this, I tend to store nuke.thisNode() at the beginning 
of whatever function I’m running so I can return to that context or 
re-reference the node easily.

In your case, you can call nuke.root().begin() to get to the root context, or 
maybe just use a 'with' statement. Alternately, if you only need to step up one 
level and are looking at the possibility of multiple nested groups, you can 
parse <group>.fullName into context levels.

That sort of answer your question?

-Nathan



From: robingraham 
Sent: Tuesday, August 09, 2011 3:38 PM
To: [email protected] 
Subject: [Nuke-python] a group that can look outside itself

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

Reply via email to