Нет описания
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

DummyCam.gizmo 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. Camera {
  2. projection_mode {{"\[value the_cam]projection_mode"}}
  3. focal {{"\[value \[value the_cam]focal]"}}
  4. haperture {{"\[value \[value the_cam]haperture]"}}
  5. vaperture {{"\[value \[value the_cam]vaperture]"}}
  6. near {{"\[value \[value the_cam]near]"}}
  7. far {{"\[value \[value the_cam]far]"}}
  8. win_translate {{"\[lindex \[value \[value the_cam]win_translate] 0]"} {"\[lindex \[value \[value the_cam]win_translate] 1]"}}
  9. win_scale {{"\[lindex \[value \[value the_cam]win_scale] 0]"} {"\[lindex \[value \[value the_cam]win_scale] 1]"}}
  10. winroll {{"\[value \[value the_cam]winroll]"}}
  11. focal_point {{"\[value \[value the_cam]focal_point]"}}
  12. fstop {{"\[value \[value the_cam]fstop]"}}
  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 not Camera connected.\n\nCan also be used inside of groups and gizmos, as many levels deep as you want :D\n\nAll using live and super fast TCL.\n\nadrianpueyo.com, 2019"
  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 "\[\nset the_knob \"focal\"\nset knob_index 0\nset starting_point \"this.input0\"\nset default \"this\"\nset default \[append default \".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] != \"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]==\"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 {4 d_projection_mode l projection M {perspective orthographic uv spherical ""}}
  20. addUserKnob {7 d_focal l focal R 0 100}
  21. d_focal 60
  22. addUserKnob {7 d_haperture l "horiz aperture" R 0 50}
  23. d_haperture 24.576
  24. addUserKnob {7 d_vaperture l "vert aperture" R 0 50}
  25. d_vaperture 18.672
  26. addUserKnob {7 d_near l near R 0 10}
  27. d_near 0.1
  28. addUserKnob {7 d_far l far R 0 10000}
  29. d_far 10000
  30. addUserKnob {12 d_win_translate l "window translate"}
  31. addUserKnob {12 d_win_scale l "window scale"}
  32. d_win_scale {1 1}
  33. addUserKnob {7 d_winroll l "window roll" R 0 45}
  34. addUserKnob {7 d_focal_point l "focal distance" R 0 10}
  35. d_focal_point 2
  36. addUserKnob {7 d_fstop l fstop R 0 30}
  37. d_fstop 16
  38. addUserKnob {26 text l " " T "<span style=\"color:#666\"><br/><b>DummyCam v1.0</b> - <a href=\"http://www.adrianpueyo.com\" style=\"color:#666;text-decoration: none;\">adrianpueyo.com</a>, 2019</span>"}
  39. }