|
| 1 | +Camera { |
| 2 | + projection_mode {{"\[expression \[value the_cam]projection_mode(\[value the_frame])]"}} |
| 3 | + focal {{"\[expression \[value the_cam]focal(\[value the_frame])]"}} |
| 4 | + haperture {{"\[expression \[value the_cam]haperture(\[value the_frame])]"}} |
| 5 | + vaperture {{"\[expression \[value the_cam]vaperture(\[value the_frame])]"}} |
| 6 | + near {{"\[expression \[value the_cam]near(\[value the_frame])]"}} |
| 7 | + far {{"\[expression \[value the_cam]far(\[value the_frame])]"}} |
| 8 | + win_translate {{"\[expression \[value the_cam]win_translate.u(\[value the_frame])]"} {"\[expression \[value the_cam]win_translate.v(\[value the_frame])]"}} |
| 9 | + win_scale {{"\[expression \[value the_cam]win_scale.u(\[value the_frame])]"} {"\[expression \[value the_cam]win_scale.v(\[value the_frame])]"}} |
| 10 | + winroll {{"\[expression \[value the_cam]winroll(\[value the_frame])]"}} |
| 11 | + focal_point {{"\[expression \[value the_cam]focal_point(\[value the_frame])]"}} |
| 12 | + fstop {{"\[expression \[value the_cam]fstop(\[value the_frame])]"}} |
| 13 | + name DummyCam |
| 14 | + help "DummyCam by Adrian Pueyo\n\nCamera that apart from the matrices also grabs all the \"Projection\" values from the upstream camera that it's connected to. Turns into a default Camera if no Camera connected. Can also be used inside of groups and gizmos, as many levels deep as you want :D All using live and super fast TCL.\n\nUpdated v1.1: Now grabs the correct frame too (thanks Erwan Leroy for the idea).\n\nUpdated v1.2: Now accepts Nuke13's Camera3\n\nadrianpueyo.com, 2019-2021" |
| 15 | + onCreate "n = nuke.thisNode()\nfor k in \[\"projection_mode\",\"focal\",\"haperture\",\"vaperture\",\"near\",\"far\",\"win_translate\",\"win_scale\",\"winroll\",\"focal_point\",\"fstop\"]:\n n\[k].setFlag(0x0000000010000000)" |
| 16 | + addUserKnob {20 DummyCam l Defaults} |
| 17 | + addUserKnob {43 the_cam +INVISIBLE} |
| 18 | + the_cam "\[\n#DummyCam v1.2 - Updated 5 May 2021.\nset starting_point \"this.input0\"\nset default \"this.d_\"\n\n# If cam has no inputs, return the default.\nif \{\[exists \$starting_point]\} \{\n set x \[node \$starting_point]\n\} \{ \n return \$default\n\}\n\nset finished 0\nwhile \{\$finished != 1\} \{\n\n # First look for a Cam or Input or topnode.\n while \{\[class \$x] != \"Camera3\" && \[class \$x] != \"Camera2\" && \[class \$x] != \"Camera\" && \[class \$x] != \"Input\" && \$x != \[topnode \$x]\} \{\n set x \[node \$x.input0]\n \}\n\n # Then, check if node is a cam (and return), and otherwise, if it's an input, see if the parent exists and move to it.\n if \{\[class \$x]==\"Camera3\"||\[class \$x]==\"Camera2\"||\[class \$x]==\"Camera\"\} \{\n set x \[append x \".\"]\n return \$x\n \} \{ \n if \{ \[class \$x]==\"Input\" \} \{ \n set inp \"\$x.parent.input\"\n set inputNum \[value \$x.number]\n set inp \[append inp \$inputNum]\n if \{ \[exists \$inp] \} \{\n set x \[node \$inp]\n \} \{ \n set finished 1\n \}\n \} \{ \n set finished 1\n \}\n \}\n\}\nreturn \$default\n]" |
| 19 | + addUserKnob {43 the_frame +INVISIBLE} |
| 20 | + the_frame "\[\nset the_camera \[string trimright \[value the_cam] .]\nif \{\[exists \$the_camera]\} \{\n return \[value \$the_camera.frame]\n\} \{ \n return \[frame]\n\}\n]" |
| 21 | + addUserKnob {4 d_projection_mode l projection M {perspective orthographic uv spherical ""}} |
| 22 | + addUserKnob {7 d_focal l "focal length" R 0 100} |
| 23 | + d_focal 50 |
| 24 | + addUserKnob {7 d_haperture l "horiz aperture" R 0 50} |
| 25 | + d_haperture 24.576 |
| 26 | + addUserKnob {7 d_vaperture l "vert aperture" R 0 50} |
| 27 | + d_vaperture 18.672 |
| 28 | + addUserKnob {7 d_near l near R 0 10} |
| 29 | + d_near 0.1 |
| 30 | + addUserKnob {7 d_far l far R 0 10000} |
| 31 | + d_far 10000 |
| 32 | + addUserKnob {30 d_win_translate l "window translate"} |
| 33 | + addUserKnob {30 d_win_scale l "window scale"} |
| 34 | + d_win_scale {1 1} |
| 35 | + addUserKnob {7 d_winroll l "window roll" R 0 45} |
| 36 | + addUserKnob {7 d_focal_point l "focal distance" R 0 10} |
| 37 | + d_focal_point 2 |
| 38 | + addUserKnob {7 d_fstop l fstop R 0 30} |
| 39 | + d_fstop 16 |
| 40 | + addUserKnob {26 version l " " t "Updated 5 May 2021" T "<span style=\"color:#666\"><br/><b>DummyCam v1.2</b> - <a href=\"http://www.adrianpueyo.com\" style=\"color:#666;text-decoration: none;\">adrianpueyo.com</a>, 2019-2021</span>"} |
| 41 | +} |
0 commit comments