Advertisement
Totheroo

Nuke - Image Plane

Feb 17th, 2022
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.82 KB | None | 0 0
  1. #! /Applications/Nuke6.0v4-32/Nuke6.0v4.app/Contents/MacOS/Nuke6.0v4 -nx
  2. version 6.0 v4
  3. Group {
  4. name ImagePlane
  5. inputs 2
  6. help "This node lets yuo project a texture onto a card to fit the frustum of the connected camera at the reference frame.\n\nThis is useful to either matchmove or stabilise a plate based on a camera rather than 2D tracking data.\n\n"
  7. knobChanged "\nn = nuke.thisNode()\nk = nuke.thisKnob()\n\nif k.name() == 'use_input':\n n\['knob'].setEnabled( not k.value() )\n"
  8. note_font_size 22
  9. addUserKnob {20 "" l User}
  10. addUserKnob {32 knob l "import chan file" t "when importing a chan file instead of hooking up a camera node, make sure to set the corrcet aperture in the CameraKnobs tab before importing the file!" -STARTLINE +DISABLED T "import_chan_button this.CAM_ANIM\nknob this.use_input 0"}
  11. addUserKnob {6 use_input l "use input" t "if checked the camera hooked up to the cam pipe is used\ninstead of the internal one.\nIf unchecked, make sure to set the correct aperture in the CameraKnobs tab before importing the chan file!" -STARTLINE}
  12. use_input true
  13. addUserKnob {4 output t "stabilize - use this to stabilize a plate using the respective match moved camera\nmatch - track an element into the shot based on the camera input" M {stabilize match}}
  14. output match
  15. addUserKnob {3 ref l refFrame t "if the output format is the same as the plate you want to match/stabilize,\nthis will be the frame that will not be modified."}
  16. ref 1
  17. addUserKnob {7 distance t "the distance of the card to the camera.\nIf you have a nodal camera this isn't important\notherwise you need to adjust this to get the required parallax." R 1 10000}
  18. distance 100
  19. addUserKnob {26 "" l output}
  20. addUserKnob {41 format T Card3D1.format}
  21. addUserKnob {41 crop_1 l "black outside" +INVISIBLE T Card3D1.crop}
  22. addUserKnob {6 crop -STARTLINE}
  23. crop true
  24. addUserKnob {41 full_format l "output format" +INVISIBLE T Card3D1.full_format}
  25. addUserKnob {41 proxy_format l "proxy format" +INVISIBLE T Card3D1.proxy_format}
  26. addUserKnob {41 filter T Card3D1.filter}
  27. addUserKnob {20 "" l MotionBlur}
  28. addUserKnob {41 motionblur T Card3D1.motionblur}
  29. addUserKnob {41 shutter T Card3D1.shutter}
  30. addUserKnob {41 shutteroffset l "shutter offset" T Card3D1.shutteroffset}
  31. addUserKnob {41 shuttercustomoffset l "" -STARTLINE T Card3D1.shuttercustomoffset}
  32. addUserKnob {20 "" l CameraKnobs}
  33. addUserKnob {41 rot_order l "rotation order" T CAM_ANIM.rot_order}
  34. addUserKnob {41 translate T CAM_ANIM.translate}
  35. addUserKnob {41 rotate T CAM_ANIM.rotate}
  36. addUserKnob {26 ""}
  37. addUserKnob {41 focal l "focal length" T CAM_ANIM.focal}
  38. addUserKnob {41 haperture l "horiz aperture" T CAM_ANIM.haperture}
  39. addUserKnob {41 vaperture l "vert aperture" T CAM_ANIM.vaperture}
  40. addUserKnob {41 win_scale l "window scale" T CAM_ANIM.win_scale}
  41. addUserKnob {26 ""}
  42. addUserKnob {41 label_1 l label T CAM_ANIM.label}
  43. }
  44. Input {
  45. inputs 0
  46. name CAM
  47. xpos -16
  48. ypos 113
  49. number 1
  50. }
  51. Camera {
  52. inputs 0
  53. display off
  54. selectable false
  55. haperture 9.58
  56. vaperture 5.39
  57. near 0.001
  58. far {{parent.distance*2}}
  59. name CAM_ANIM
  60. xpos -136
  61. ypos 41
  62. }
  63. Switch {
  64. inputs 2
  65. which {{parent.use_input}}
  66. name Switch4
  67. label "internal or connected camera"
  68. xpos -16
  69. ypos 54
  70. }
  71. set N1b845d10 [stack 0]
  72. Camera {
  73. inputs 0
  74. display off
  75. selectable false
  76. rot_order {{"\[topnode parent.input1].rot_order"}}
  77. translate {{"\[topnode parent.input1].translate.x(parent.ref)"} {"\[topnode parent.input1].translate.y(parent.ref)"} {"\[topnode parent.input1].translate.z(parent.ref)"}}
  78. rotate {{"\[topnode parent.input1].rotate.x(parent.ref)"} {"\[topnode parent.input1].rotate.y(parent.ref)"} {"\[topnode parent.input1].rotate.z(parent.ref)"}}
  79. focal {{"\[topnode input1].focal.0"}}
  80. haperture {{"\[topnode input1].haperture.0"}}
  81. vaperture {{"\[topnode input1].vaperture.0"}}
  82. near 0.0001
  83. far {{parent.distance*2}}
  84. win_scale {{"\[topnode input1].win_scale.0"} {"\[topnode input1].win_scale.1"}}
  85. name CAM_STATIC1
  86. tile_color 0x5682e700
  87. gl_color 0x4851e400
  88. label "connected cam\n"
  89. xpos 28
  90. ypos -178
  91. }
  92. Camera {
  93. inputs 0
  94. display off
  95. selectable false
  96. rot_order {{CAM_ANIM.rot_order}}
  97. translate {{CAM_ANIM.translate.x(parent.ref)} {CAM_ANIM.translate.y(parent.ref)} {CAM_ANIM.translate.z(parent.ref)}}
  98. rotate {{CAM_ANIM.rotate.x(parent.ref)} {CAM_ANIM.rotate.y(parent.ref)} {CAM_ANIM.rotate.z(parent.ref)}}
  99. focal {{CAM_ANIM.focal.0}}
  100. haperture {{CAM_ANIM.haperture.0}}
  101. vaperture {{CAM_ANIM.vaperture.0}}
  102. near 0.0001
  103. far {{parent.distance*2}}
  104. name CAM_STATIC
  105. tile_color 0x5682e700
  106. gl_color 0x4851e400
  107. label "internal cam"
  108. xpos -112
  109. ypos -85
  110. }
  111. Switch {
  112. inputs 2
  113. which {{parent.use_input}}
  114. name Switch5
  115. label "internal or connected cam\n\[input this \[knob parent.use_input]]"
  116. xpos 28
  117. ypos -72
  118. }
  119. set N1b8cc250 [stack 0]
  120. Switch {
  121. inputs 2
  122. which {{!parent.output}}
  123. name Switch1
  124. label "match or stabilize"
  125. xpos 177
  126. ypos -72
  127. }
  128. push $N1b8cc250
  129. push $N1b845d10
  130. Switch {
  131. inputs 2
  132. which {{!parent.output}}
  133. name Switch2
  134. label "match or stabilize"
  135. xpos 166
  136. ypos 54
  137. }
  138. Input {
  139. inputs 0
  140. name IMG
  141. xpos 409
  142. ypos -97
  143. }
  144. Card3D {
  145. inputs 3
  146. scaling {{"\[input Switch5 \[value parent.use_input]].win_scale.0"} {"\[input Switch5 \[value parent.use_input]].win_scale.1"} 1}
  147. uniform_scale {{parent.distance}}
  148. pivot {0 0 1}
  149. lens_in_focal {{"\[input Switch5 \[value parent.use_input]].focal"}}
  150. lens_in_haperture {{"\[input Switch5 \[value parent.use_input]].haperture"}}
  151. name Card3D1
  152. label internal
  153. selected true
  154. xpos 409
  155. ypos 54
  156. }
  157. Crop {
  158. box {0 0 {width} {height}}
  159. intersect true
  160. name Crop1
  161. xpos 409
  162. ypos 241
  163. disable {{!parent.crop}}
  164. }
  165. Output {
  166. name Output1
  167. xpos 409
  168. ypos 324
  169. }
  170. end_group
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement