Arno,

Thanks! I have been playing around with it for a while. Here’s a modified 
version that limits the shifting to + or - 100%. Maybe there was something I 
was missing, but if I went past a full image offset in width or height, I would 
get stretched pixels… I also added some code to get the input image size.


set cut_paste_input [stack 0]
version 7.0 v4
push $cut_paste_input
Group {
 name Arno_Beekman_Transform_Version
 selected true
 xpos -150
 ypos 596
 addUserKnob {20 User}
 addUserKnob {26 percentage_offsets l "OFFSET CONTROLS"}
 addUserKnob {26 note_2 l (Percentage)}
 addUserKnob {41 offset_x T Offsets.offset_x}
 addUserKnob {41 offset_y T Offsets.offset_y}
 addUserKnob {26 ""}
 addUserKnob {26 computed_pixel_offsets l "COMPUTED PIXEL OFFSETS:"}
 addUserKnob {26 note_1 l "(Linked - Info Only)"}
 addUserKnob {41 translate T CONTROL.translate}
}
 Input {
  inputs 0
  name Input1
  xpos -149
  ypos 461
 }
 Reformat {
  type scale
  scale 2
  filter Impulse
  name Reformat1
  xpos -149
  ypos 537
 }
 Tile {
  rows 2
  columns 2
  filter Impulse
  name Tile1
  xpos -149
  ypos 586
 }
 Transform {
  translate {{"\[python -execlocal read_size\\ =\\ 
nuke.toNode(nuke.thisGroup().name()\\ +\\ 
'.Get_Read_Size').knob('Read_Size').value(0)\\noffset\\ =\\ 
nuke.toNode(nuke.thisGroup().name()\\ +\\ 
'.Offsets').knob('offset_x').value()\\npixel_offset_x\\ =\\ 
read_size*offset\\n\\nret\\ =\\ pixel_offset_x/2]"} {"\[python -execlocal 
read_size\\ =\\ nuke.toNode(nuke.thisGroup().name()\\ +\\ 
'.Get_Read_Size').knob('Read_Size').value(1)\\noffset\\ =\\ 
nuke.toNode(nuke.thisGroup().name()\\ +\\ 
'.Offsets').knob('offset_y').value()\\npixel_offset_y\\ =\\ 
read_size*offset\\n\\nret\\ =\\ (pixel_offset_y/2)]"}}
  center {{"\[python nuke.toNode(nuke.thisGroup().name()\\ +\\ 
'.Get_Read_Size').knob('Read_Size').value(0)/2]"} {"\[python 
nuke.toNode(nuke.thisGroup().name()\\ +\\ 
'.Get_Read_Size').knob('Read_Size').value(1)/2]"}}
  filter Impulse
  black_outside false
  name CONTROL
  xpos -149
  ypos 646
 }
 Reformat {
  type scale
  scale 0.5
  resize none
  center false
  filter Impulse
  pbb true
  name Reformat2
  xpos -149
  ypos 714
 }
 Transform {
  translate {{"\[python -execlocal read_size\\ =\\ 
nuke.toNode(nuke.thisGroup().name()\\ +\\ 
'.Get_Read_Size').knob('Read_Size').value(0)\\ntx\\ =\\ 
nuke.toNode(nuke.thisGroup().name()\\ +\\ 
'.CONTROL').knob('translate').value(0)\\n\\nif\\ tx\\ ==\\ 0:\\n\\ \\ \\ \\ 
ret\\ =\\ 0\\nelif\\ tx\\ <\\ 0:\\n\\ \\ \\ \\ ret\\ =\\ tx\\nelse:\\n\\ \\ \\ 
\\ ret\\ =\\ -(read_size\\ -\\ tx)]"} {"\[python -execlocal read_size\\ =\\ 
nuke.toNode(nuke.thisGroup().name()\\ +\\ 
'.Get_Read_Size').knob('Read_Size').value(1)\\nty\\ =\\ 
nuke.toNode(nuke.thisGroup().name()\\ +\\ 
'.CONTROL').knob('translate').value(1)\\n\\nif\\ ty\\ ==\\ 0:\\n\\ \\ \\ \\ 
ret\\ =\\ 0\\nelif\\ ty\\ <\\ 0:\\n\\ \\ \\ \\ ret\\ =\\ ty\\nelse:\\n\\ \\ \\ 
\\ ret\\ =\\ -(read_size\\ -\\ ty)]"}}
  filter Impulse
  black_outside false
  name Transform2
  xpos -149
  ypos 793
 }
 Crop {
  box {0 0 {"\[python nuke.toNode(nuke.thisGroup().name()\\ +\\ 
'.Get_Read_Size').knob('Read_Size').value(0)]"} {"\[python 
nuke.toNode(nuke.thisGroup().name()\\ +\\ 
'.Get_Read_Size').knob('Read_Size').value(1)]"}}
  reformat true
  crop false
  name Crop1
  xpos -149
  ypos 855
 }
 Output {
  name Output1
  xpos -149
  ypos 934
 }
 NoOp {
  inputs 0
  name Get_Read_Size
  tile_color 0x8e2929ff
  note_font_color 0xffffffff
  xpos -267
  ypos 647
  addUserKnob {20 User}
  addUserKnob {14 Read_Size R 0 100}
  Read_Size {{"\[python -execlocal ret\\ =\\ 
nuke.thisGroup().input(0).width()]"} {"\[python -execlocal ret\\ =\\ 
nuke.thisGroup().input(0).height()]"}}
 }
 NoOp {
  inputs 0
  name Offsets
  tile_color 0x8e2929ff
  xpos -25
  ypos 648
  addUserKnob {20 User}
  addUserKnob {7 offset_x R -1 1}
  offset_x 0.5
  addUserKnob {7 offset_y R -1 1}
 }
end_group



Rich


Rich Bobo
Senior VFX Compositor
Armstrong White
Email:  [email protected]
http://armstrong-white.com/

Email:  [email protected]
Mobile:  (248) 840-2665
Web:  http://richbobo.com/

"Waiting is a state of mind. Basically, it means that you want the future; you 
don't want the present. This greatly reduces the quality of your life."

- Eckhart Tolle

On Jun 22, 2014, at 1:36 PM, Arno Beekman <[email protected]> wrote:

> here's how I usually do this
> In Transform1 you can move/shift the edges...
> 
> 
> 
> Reformat {
>  type scale
>  scale 2
>  filter Impulse
>  name Reformat1
>  selected true
>  xpos -356
>  ypos -52
> }
> Tile {
>  rows 2
>  columns 2
>  filter Impulse
>  name Tile1
>  selected true
>  xpos -356
>  ypos -28
> }
> Transform {
>  center {{width/2 x1 0} {height/2 x1 0}}
>  filter Impulse
>  black_outside false
>  name Transform1
>  selected true
>  xpos -356
>  ypos -4
> }
> Reformat {
>  type scale
>  scale 0.5
>  resize none
>  filter Impulse
>  pbb true
>  name Reformat2
>  selected true
>  xpos -356
>  ypos 20
> }
> RotoPaint {
>  output rgb
>  cliptype none
>  curves {{{v x3f99999a}
>   {f 0}
>   {n
>    {layer Root
>     {f 0}
>     {t x44000000 x43c00000}
>     {a}}}}}
>  toolbox {selectAll {
>   { selectAll str 1 ssx 1 ssy 1 sf 1 }
>   { createBezier str 1 ssx 1 ssy 1 sf 1 sb 1 }
>   { createOpenSpline str 1 ssx 1 ssy 1 sf 1 sb 1 }
>   { createBezierCusped str 1 ssx 1 ssy 1 sf 1 sb 1 }
>   { createBSpline str 1 ssx 1 ssy 1 sf 1 sb 1 }
>   { createEllipse str 1 ssx 1 ssy 1 sf 1 sb 1 }
>   { createRectangle str 1 ssx 1 ssy 1 sf 1 sb 1 }
>   { createRectangleCusped str 1 ssx 1 ssy 1 sf 1 sb 1 }
>   { brush str 1 ssx 1 ssy 1 sf 1 sb 1 }
>   { eraser src 2 str 1 ssx 1 ssy 1 sf 1 sb 1 }
>   { clone src 1 str 1 ssx 1 ssy 1 sf 1 sb 1 }
>   { reveal src 3 str 1 ssx 1 ssy 1 sf 1 sb 1 }
>   { dodge src 1 str 1 ssx 1 ssy 1 sf 1 sb 1 }
>   { burn src 1 str 1 ssx 1 ssy 1 sf 1 sb 1 }
>   { blur src 1 str 1 ssx 1 ssy 1 sf 1 sb 1 }
>   { sharpen src 1 str 1 ssx 1 ssy 1 sf 1 sb 1 }
>   { smear src 1 str 1 ssx 1 ssy 1 sf 1 sb 1 }
> } }
>  toolbar_source_transform_center {512 384}
>  createNewTrack {{-1} "-1\t(none)\t-1" "1000\tNew Track Layer\t1000"}
>  name RotoPaint1
>  selected true
>  xpos -432
>  ypos 57
> }
> Transform {
>  translate {{"floor( width/2 - parent.Transform1.translate )"} {"floor( 
> height/2 - parent.Transform1.translate )"}}
>  center {1024 768}
>  filter Impulse
>  black_outside false
>  name Transform2
>  selected true
>  xpos -356
>  ypos 97
> }
> 
> 
> gr
> arno
> 
> 
> On 20-06-14 01:06, Richard Bobo wrote:
>> Hi all,
>> 
>> I have found several gizmos that will do a simple pixel shift on an image — 
>> x & y offsets that wraparound. However, I keep searching in vain for a way 
>> to do it with a built-in Nuke node. Isn’t there any way? I guess that’s why 
>> these gizmos exist..?    (8^\    A big thank you to anyone who can tell me 
>> about a Nuke node that can do it!
>> 
>> Thanks,
>> Rich
>> 
>> 
>> Rich Bobo
>> Senior VFX Compositor
>> Armstrong White
>> Email:  [email protected]
>> http://armstrong-white.com/
>> 
>> Email:  [email protected]
>> Mobile:  (248) 840-2665
>> Web:  http://richbobo.com/
>> 
>> "The world stands aside to let anyone pass who knows where he is going."
>> - David Starr Jordan
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> Nuke-users mailing list
>> [email protected], http://forums.thefoundry.co.uk/
>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
> 
> _______________________________________________
> Nuke-users mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

_______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

Reply via email to