CompStart

ProLessonsCoursesElementsSoftware

CompStart

Master visual effects with cutting-edge techniques.

Learning

CoursesLessonsPro FeaturesAssetsSoftware

Tools

Tech CheckDisplay CheckMotion BlurCIE 1931PhysLightNuke Tools

Company

InstructorMissionImpressumPrivacyTerms

Projects

Moray RenderEXR ConverterOCIO.ccNuke ToolsDerekVFX

Follow

YouTubeInstagramTikTokThreadsContact

© 2026 CompStart. All rights reserved.

Sample2 Node

ToolSets / Utility
Utility

2026-09-07

ToolSets/utility/sample2Node.nk

utility
3D
sample
position
card
axis
light
pick
View on GitHub

Utility that holds a 3D pick position from a chosen channel and creates Card, Card3D, Axis, or Light nodes at that translate.

Sample2 Node is a small utility group for working with a sampled 3D position in Nuke. It exposes a channel control (default P_lig) and a pick vector you can drive or set by hand.

Use it when you need to park a position value and quickly place scene nodes there. The Card, Card3D, Axis, and Light buttons each create the matching node in the root and set its translate to the current pick.

In a comp it sits inline as a pass-through group: input through a Shuffle into a NoOp that stores the pick, then out. It does not alter the image; it is a position holder and one-click creator for common 3D nodes at that sample.

Script code

set cut_paste_input [stack 0]
version 12.1 v4
push $cut_paste_input
add_layer {P_lig P_lig.X P_lig.Y P_lig.Z}
Group {
 name sample2Node
 tile_color 0x421010ff
 selected true
 xpos -1148
 ypos 1140
 addUserKnob {20 User l sample2Node}
 addUserKnob {41 in l channel T Shuffle1.in}
 addUserKnob {41 pick l sample T NoOp1.pick}
 addUserKnob {22 Card T "import nuke\n\nvalue = nuke.thisNode().knob('pick').getValue()\n\nnuke.root().begin()\n\nnode = nuke.createNode('Card2')\n\nnode\['translate'].setValue(value)" +STARTLINE}
 addUserKnob {22 Card3D -STARTLINE T "import nuke\n\nvalue = nuke.thisNode().knob('pick').getValue()\n\nnuke.root().begin()\n\nnode = nuke.createNode('Card3D')\n\nnode\['translate'].setValue(value)"}
 addUserKnob {22 Axis -STARTLINE T "import nuke\n\nvalue = nuke.thisNode().knob('pick').getValue()\n\nnuke.root().begin()\n\nnode = nuke.createNode('Axis2')\n\nnode\['translate'].setValue(value)"}
 addUserKnob {22 Light -STARTLINE T "import nuke\n\nvalue = nuke.thisNode().knob('pick').getValue()\n\nnuke.root().begin()\n\nnode = nuke.createNode('Light2')\n\nnode\['translate'].setValue(value)"}
 addUserKnob {26 ""}
 addUserKnob {26 lbl l "" +STARTLINE T "Sample2Node v1.0"}
 addUserKnob {22 btn l DerekVFX.ca T "nuke.tcl('start', 'https://derekvfx.ca')" +STARTLINE}
}
 Input {
  inputs 0
  name Input
  xpos 447
  ypos 61
 }
set Ndce0400 [stack 0]
 Output {
  name Output1
  xpos 447
  ypos 1055
 }
push $Ndce0400
 Shuffle {
  in P_lig
  name Shuffle1
  label "\[value in]"
  xpos 272
  ypos 219
 }
 NoOp {
  name NoOp1
  xpos 272
  ypos 282
  hide_input true
  addUserKnob {20 User}
  addUserKnob {18 pick}
  pick {43.7382431 12.38535595 -108.212326}
  addUserKnob {6 pick_panelDropped l "panel dropped state" -STARTLINE +HIDDEN}
 }
end_group