Last active
August 20, 2018 05:09
-
-
Save dbr/1141469 to your computer and use it in GitHub Desktop.
An absurd recursive lambda expression to recurse up the DAG, finding a Camera2 node
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set cut_paste_input [stack 0] | |
version 6.2 v3 | |
push $cut_paste_input | |
Axis2 { | |
name Axis1 | |
selected true | |
xpos -107 | |
ypos -135 | |
} | |
Camera2 { | |
name Camera1 | |
label "\[value focal]" | |
selected true | |
xpos -107 | |
ypos -55 | |
} | |
Dot { | |
name Dot1 | |
selected true | |
xpos -83 | |
ypos 44 | |
} | |
Dot { | |
name Dot4 | |
selected true | |
xpos -83 | |
ypos 71 | |
} | |
set N1dec72f0 [stack 0] | |
Scene { | |
name TopNode | |
label "\[value find_focal]\nOnly works when Axis is disconnected" | |
selected true | |
xpos -26 | |
ypos 115 | |
addUserKnob {20 User} | |
addUserKnob {7 find_focal} | |
find_focal {{"\[topnode].focal"}} | |
} | |
push $N1dec72f0 | |
Scene { | |
name AbsurdExpression | |
label "\[value find_focal]" | |
selected true | |
xpos -192 | |
ypos 115 | |
addUserKnob {20 User} | |
addUserKnob {7 find_focal} | |
find_focal {{"\[python \{( lambda n: (lambda f, n: f(f, n)) (lambda f, n: f(f, n.input(0)) if n.Class()!=\"Camera2\" else n, n) )(nuke.thisNode())\['focal'].value()\}]" i}} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment