Thanks Nathan that worked like a charm. I wonder why Nuke would think that I wanted to look through the gizmo by default, instead of the root(). Oh well, thanks a lot for the help.
Brogan On Tue, Sep 20, 2011 at 6:42 PM, Nathan Rusch <nathan_ru...@hotmail.com>wrote: > You can pass nuke.allNodes a node to use as an execution context. If you > know you always want to look at the top-level of your comp, just use: > > nuke.allNodes(group=nuke.root()) > > If you want to look at the container context of the new gizmo regardless of > whether it’s the root node or not, use: > > nuke.allNodes(group=nuke.thisParent()) > > Obviously if the given 'parent' gizmo you’re looking for could be anywhere, > you’ll need to walk from nuke.root() into every Group node. > > -Nathan > > > *From:* Brogan Ross <broganr...@gmail.com> > *Sent:* Tuesday, September 20, 2011 6:34 PM > *To:* Nuke Python discussion <nuke-python@support.thefoundry.co.uk> > *Subject:* [Nuke-python] Gizmo onCreate callback going inside gizmo > > So I found this interesting little tidbit that I didn't want to happen. > > Basically, I have an onUserCreate callback to expression the values of a > given "parent" gizmo to the newly created gizmo. But when I'm doing a > search for the "parent" gizmo with nuke.allNodes() the callback is looking > at the innards of the newly created gizmo. > > > def gizmoCallback(): > newgizmo = nuke.thisNode() > for node in nuke.allNodes(): > if node.Class() in ["list", "of", "possible", "matches"]: > if node.name().split()[0].lower() == "searchTag": > newgizmo.setExpressions() > > nuke.onUserCreate(gizmoCallback, nodeClass='NewGizmo') > > That's basically what I'm running, but if I have it print out the nodes in > nuke.allNodes() it prints the names of the nodes inside the gizmo. > > Anyone else run it this before? Any work arounds? > > > > Thanks, > Brogan > > ------------------------------ > _______________________________________________ > 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