Hi Paul,
If you can rely on your Camera being always at the top of the tree
that goes into your node, you could get there using tcl's "topnode"
[topnode input0].focal
But you may hit the case where you have something connected above your
camera too (like an Axis), in which case topnode won't work either.
If you're into python, I have this snippet to crawl up the inputs of a
certain node and find the first node that matches a certain class. You
could use that within an expression in your node to get the first
camera node upstream.
##########################
def findUpstream(node, nodeClass = []):
""" Convenience function to find the first node upstream that
matches a list of node Classes"""
if node and node.Class() in nodeClass:
return node
else:
for n in node.dependencies( nuke.INPUTS | nuke.HIDDEN_INPUTS):
node = findUpstream(n, nodeClass)
if node: return node
##########################
Cheers,
Ivan
On Wed, Aug 10, 2011 at 8:24 PM, Paul Raeburn
<[email protected]> wrote:
>
> We have been using references tot he input node and then values to get
> values from a camera node. ie. NoOp1.input.focal
> This works fine but breaks if there is anything in between the NoOp and the
> camera, so you can tidy up the script with Dots or end up with multiple
> cameras just to be tidy.
> Is there a way to get camera stream directly, or even the name of the camera
> node from the stream?
> thanks
> Paul Raeburn
> _______________________________________________
> Nuke-users mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
>
_______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users