Skip to content

Instantly share code, notes, and snippets.

@draconiansolo
Last active December 17, 2015 03:18
Show Gist options
  • Save draconiansolo/5541763 to your computer and use it in GitHub Desktop.
Save draconiansolo/5541763 to your computer and use it in GitHub Desktop.
dodgy disparity clamper for nuke copypasta
set cut_paste_input [stack 0]
version 6.3 v5
push $cut_paste_input
Group {
name DisparityClamp1
selected true
xpos 392
ypos 494
addUserKnob {20 User}
addUserKnob {26 DisparityClampofDoom l "Disparity Clamp of Doom" t "*not suitable for new views; will help greatly with painting stuff, specially edges." T "Allows you to clamp and blur your disparity with up to 4 reference points.\nClamps max and min values.\n**Based on David's manual disparity trick"}
addUserKnob {26 ""}
addUserKnob {4 Eye l "Disparity to Fix" M {DisparityL DisparityR ""}}
Eye DisparityR
addUserKnob {26 ""}
addUserKnob {7 toleranceA l "Tolerance A" t "How much of the original disparity values are going to be kept.\nAnother Tolerance (might be back or front)" R -10 10}
toleranceA 20
addUserKnob {7 toleranceB l "Tolerance B" t "Another Tolerance (might be back or front)" R -10 10}
toleranceB 0.9
addUserKnob {3 blurType l "Blur Type" t "0 is gaussian, dodgy but fast\n1 is vector blur, arguably accurate but slower"}
addUserKnob {26 ""}
addUserKnob {12 point1}
addUserKnob {6 enablepoint1 l enable +STARTLINE}
addUserKnob {12 point2}
addUserKnob {6 enablepoint2 l enable +STARTLINE}
addUserKnob {12 point3}
addUserKnob {6 enablepoint3 l enable +STARTLINE}
addUserKnob {12 point4}
addUserKnob {6 enablepoint4 l enable +STARTLINE}
}
Input {
inputs 0
name Input1
label Disparity
xpos -331
ypos 59
}
Dot {
name Dot3
xpos -297
ypos 133
}
set N1e4d4fa0 [stack 0]
add_layer {rgba rgba.beta rgba.noise redguard1.glow rgba.edgeblur}
Shuffle {
in disparityR
blue black
alpha black
name Shuffle1
xpos -376
ypos 206
}
push $N1e4d4fa0
Shuffle {
in disparityL
blue black
alpha black
name Shuffle2
xpos -280
ypos 206
}
Switch {
inputs 2
which {{parent.Eye i}}
name Switch6
xpos -336
ypos 254
}
Dot {
name Dot5
xpos -302
ypos 312
}
set N1d05eb90 [stack 0]
push $N1d05eb90
Dot {
name Dot1
xpos -504
ypos 312
}
Dot {
name Dot6
xpos -504
ypos 376
}
set N18aa3c10 [stack 0]
add_layer {rgb rgb.red rgb.green rgb.blue}
Expression {
expr0 r(point.x,point.y,10,10)
expr1 g(point.x,point.y,10,10)
expr3 1-hypot((point.x-x),(point.y-y))/width
name Expression7
xpos -536
ypos 475
addUserKnob {20 User}
addUserKnob {12 point t "this is the sample that is going to be used"}
point {{parent.point3.left.x i} {parent.point3.left.y i}}
}
push 0
Switch {
inputs 2
which {{parent.enablepoint3 i}}
name Switch4
xpos -536
ypos 554
}
push $N18aa3c10
Dot {
name Dot9
xpos -612
ypos 376
}
set N109b1aa0 [stack 0]
Dot {
name Dot7
xpos -722
ypos 376
}
Expression {
expr0 r(point.x,point.y,10,10)
expr1 g(point.x,point.y,10,10)
expr3 1-hypot((point.x-x),(point.y-y))/width
name Expression1
xpos -756
ypos 453
addUserKnob {20 User}
addUserKnob {12 point t "this is the sample that is going to be used"}
point {{parent.point1.left.x i} {parent.point1.left.y i}}
}
push 0
Switch {
inputs 2
which {{parent.enablepoint1 i}}
name Switch2
xpos -756
ypos 517
}
push $N109b1aa0
Expression {
expr0 r(point.x,point.y,10,10)
expr1 g(point.x,point.y,10,10)
expr3 1-hypot((point.x-x),(point.y-y))/width
name Expression6
xpos -634
ypos 448
addUserKnob {20 User}
addUserKnob {12 point t "this is the sample that is going to be used"}
point {{parent.point2.left.x i} {parent.point2.left.y i}}
}
push 0
Switch {
inputs 2
which {{parent.enablepoint2 i}}
name Switch3
xpos -646
ypos 532
}
MergeExpression {
inputs 2
expr0 Aa>=Ba?Ar:Br
expr1 Aa>=Ba?Ag:Bg
expr3 Aa>=Ba?Aa:Ba
name MergeExpression1
xpos -756
ypos 564
}
MergeExpression {
inputs 2
expr0 Aa>=Ba?Ar:Br
expr1 Aa>=Ba?Ag:Bg
expr3 Aa>=Ba?Aa:Ba
name MergeExpression2
xpos -641
ypos 594
}
push $N18aa3c10
Dot {
name Dot8
xpos -394
ypos 376
}
Expression {
expr0 r(point.x,point.y,10,10)
expr1 g(point.x,point.y,10,10)
expr3 1-hypot((point.x-x),(point.y-y))/width
name Expression2
xpos -428
ypos 467
addUserKnob {20 User}
addUserKnob {12 point t "this is the sample that is going to be used"}
point {{parent.point4.x i} {parent.point4.y i x1017 253 x1024 267 x1030 248 x1040 302 x1046 354 x1050 493 x1055 541 577 x1063 484 x1064 472 x1070 322 x1075 356 396 405 394 418 550 494 516 x1113 537}}
}
push 0
Switch {
inputs 2
which {{parent.enablepoint4 i}}
name Switch5
xpos -428
ypos 549
}
MergeExpression {
inputs 2
expr0 Aa>=Ba?Ar:Br
expr1 Aa>=Ba?Ag:Bg
expr3 Aa>=Ba?Aa:Ba
name MergeExpression3
xpos -529
ypos 619
}
Invert {
channels alpha
name Invert1
xpos -633
ypos 657
}
set N1896ae20 [stack 0]
Multiply {
channels alpha
value {{width i}}
name Multiply1
xpos -503
ypos 741
}
VectorBlur {
uv alpha
name VectorBlur1
xpos -503
ypos 814
}
push $N1896ae20
Grade {
channels alpha
whitepoint 0.05
black_clamp false
name Grade2
xpos -756
ypos 725
}
set Nae59870 [stack 0]
push $Nae59870
Blur {
inputs 1+1
size 56.5
name Blur1
xpos -756
ypos 818
}
Switch {
inputs 2
which {{parent.blurType i}}
name Switch1
xpos -628
ypos 926
}
set N13cdea70 [stack 0]
MergeExpression {
inputs 2
temp_name0 toleranceA
temp_expr0 parent.toleranceA
temp_name1 toleranceB
temp_expr1 parent.toleranceB
expr0 Ar-Br>toleranceA||Br-Ar>toleranceB?Br:Ar
expr1 Ag-Bg>toleranceA||Bg-Ag>toleranceB?Bg:Ag
name MergeExpression4
xpos -336
ypos 1046
}
set N1c9289b0 [stack 0]
Grade {
blackpoint -16
whitepoint 8
black_clamp false
name Grade3
xpos -676
ypos 1203
}
push $N13cdea70
push $N1d05eb90
Dot {
name Dot11
xpos -229
ypos 312
}
MergeExpression {
inputs 2
temp_name0 toleranceA
temp_expr0 parent.toleranceA
temp_name1 toleranceB
temp_expr1 parent.toleranceB
expr0 Ar-Br>toleranceB?1:0
expr1 0
expr2 Ar-Br<-toleranceA?1:0
expr3 0
name MergeExpression5
selected true
xpos -628
ypos 1046
}
push $N1c9289b0
Dot {
name Dot10
xpos -302
ypos 1123
}
set N1e542bd0 [stack 0]
push $N1e4d4fa0
Dot {
name Dot2
xpos -120
ypos 243
}
Dot {
name Dot4
xpos -120
ypos 1130
}
set N19297170 [stack 0]
ShuffleCopy {
inputs 2
in rgba
red red
green green
out disparityR
name ShuffleCopy1
xpos -336
ypos 1262
}
push $N1e542bd0
push $N19297170
ShuffleCopy {
inputs 2
in rgba
red red
green green
out disparityL
name ShuffleCopy2
xpos -154
ypos 1262
}
Switch {
inputs 2
which {{parent.Eye i}}
name Switch7
xpos -336
ypos 1358
}
ShuffleCopy {
inputs 2
red red
green green
blue blue
name ShuffleCopy3
xpos -336
ypos 1430
}
set N20f19a20 [stack 0]
Output {
name Output1
xpos -336
ypos 1526
}
push $N1c9289b0
Grade {
blackpoint {0.1563113332 1949.42749 0.07330346107 1.625976562}
whitepoint {21.34375 3.123046875 3.123046875 3.123046875}
gamma 0.25
black_clamp false
name Grade1
xpos -520
ypos 1280
}
push $N20f19a20
push 0
push 0
Viewer {
inputs 3
input_number 2
useGPUForViewer true
useGPUForInputs true
input_process false
name Viewer1
xpos -136
ypos 134
}
end_group
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment