【Nuke插件】相机置换camera displace v1.0

9 九月, 2014
661
4

image_zdepth 相机置换gizmo帮助你把Z通道图深度给予的2D图像,使2D图像增加立体视觉。深度图可以用三维渲染,一般我么可以用roto和渐变去模拟制作深度图。本gizmo需要两个输入:
1:置换的图片
2:深度图
camera_displace2 camera_displace

复制下面代码到Nuke中或者下载gizmo自行安装

set cut_paste_input [stack 0]
version 8.0 v1
push $cut_paste_input
Group {
name Group1
selected true
xpos -666
ypos 7832
addUserKnob {20 User}
addUserKnob {41 rows l "Grid Resolution" T Card1.rows}
addUserKnob {41 columns l "" -STARTLINE T Card1.columns}
addUserKnob {26 ""}
addUserKnob {41 focal l "focal length" T Camera1.focal}
addUserKnob {41 haperture l "horiz aperture" T Camera1.haperture}
addUserKnob {41 vaperture l "vert aperture" T Camera1.vaperture}
addUserKnob {26 ""}
addUserKnob {41 near_dist l "Near Distance" T Trilinear1.near_dist}
addUserKnob {41 far_dist l "Far Distance" T Trilinear1.far_dist}
}
Input {
inputs 0
name DepthMap
label "Depth Map"
xpos -60
ypos -187
}
Input {
inputs 0
name bitmap
label Bitmap
xpos -233
ypos -174
number 1
}
Card2 {
rows 60
columns 60
control_points {3 3 3 6
1 {-0.5 -0.5 0} 0 {0.1666666865 0 0} 0 {0 0 0} 0 {0 0.1666666865 0} 0 {0 0 0} 0 {0 0 0}
1 {0 -0.5 0} 0 {0.1666666716 0 0} 0 {-0.1666666716 0 0} 0 {0 0.1666666865 0} 0 {0 0 0} 0 {0.5 0 0}
1 {0.5 -0.5 0} 0 {0 0 0} 0 {-0.1666666865 0 0} 0 {0 0.1666666865 0} 0 {0 0 0} 0 {1 0 0}
1 {-0.5 0 0} 0 {0.1666666865 0 0} 0 {0 0 0} 0 {0 0.1666666716 0} 0 {0 -0.1666666716 0} 0 {0 0.5 0}
1 {0 0 0} 0 {0.1666666716 0 0} 0 {-0.1666666716 0 0} 0 {0 0.1666666716 0} 0 {0 -0.1666666716 0} 0 {0.5 0.5 0}
1 {0.5 0 0} 0 {0 0 0} 0 {-0.1666666865 0 0} 0 {0 0.1666666716 0} 0 {0 -0.1666666716 0} 0 {1 0.5 0}
1 {-0.5 0.5 0} 0 {0.1666666865 0 0} 0 {0 0 0} 0 {0 0 0} 0 {0 -0.1666666865 0} 0 {0 1 0}
1 {0 0.5 0} 0 {0.1666666716 0 0} 0 {-0.1666666716 0 0} 0 {0 0 0} 0 {0 -0.1666666865 0} 0 {0.5 1 0}
1 {0.5 0.5 0} 0 {0 0 0} 0 {-0.1666666865 0 0} 0 {0 0 0} 0 {0 -0.1666666865 0} 0 {1 1 0} }
name Card1
xpos -233
ypos -25
}
DisplaceGeo {
inputs 2
scale 1
name DisplaceGeo1
xpos -60
ypos -25
}
Trilinear {
p0 {{"far_dist * sin(hangle)"} {"far_dist * sin(vangle)"} {far_dist}}
p1 {{"far_dist * sin(hangle)"} {"far_dist * sin(-vangle)"} {far_dist}}
p2 {{"far_dist * sin(-hangle)"} {"far_dist * sin(-vangle)"} {far_dist}}
p3 {{"far_dist * sin(-hangle)"} {"far_dist * sin(vangle)"} {far_dist}}
p4 {{"near_dist * sin(hangle)"} {"near_dist * sin(vangle)"} {near_dist}}
p5 {{"near_dist * sin(hangle)"} {"near_dist * sin(-vangle)"} {near_dist}}
p6 {{"near_dist * sin(-hangle)"} {"near_dist * sin(-vangle)"} {near_dist}}
p7 {{"near_dist * sin(-hangle)"} {"near_dist * sin(vangle)"} {near_dist}}
name Trilinear1
xpos -60
ypos 57
addUserKnob {20 User}
addUserKnob {7 near_dist l "Near Distance" R -10 10}
near_dist -4.6
addUserKnob {7 far_dist l "Far Distance" R -10 10}
far_dist -8.2
addUserKnob {26 ""}
addUserKnob {41 p0_1 l p0 T Trilinear1.p0}
addUserKnob {41 p1_1 l p1 T Trilinear1.p1}
addUserKnob {41 p2_1 l p2 T Trilinear1.p2}
addUserKnob {41 p3_1 l p3 T Trilinear1.p3}
addUserKnob {41 p4_1 l p4 T Trilinear1.p4}
addUserKnob {41 p5_1 l p5 T Trilinear1.p5}
addUserKnob {41 p6_1 l p6 T Trilinear1.p6}
addUserKnob {41 p7_1 l p7 T Trilinear1.p7}
addUserKnob {26 ""}
addUserKnob {7 hangle l "Horizontal Angle"}
hangle {{tanh((Camera1.haperture/2)/Camera1.focal)}}
addUserKnob {7 vangle l "Veritcle Angle"}
vangle {{tanh((Camera1.vaperture/2)/Camera1.focal)}}
}
Output {
name Output1
xpos -60
ypos 157
}
Camera2 {
inputs 0
translate {{0 x1 0} {0 x1 0} {0 x1 0.1899999976}}
rotate {{0 x1 2.852932877} {0 x1 0} {0 x1 0}}
name Camera1
selected true
xpos 90
ypos 36
}
end_group

CAMERA DISPLACE V1.0

欢迎各位同行加入CG影视后期技术交流群一起进步,QQ群号:336495091
如果没有时间浏览我的网站,或者工作环境没有网络没有关系:点击使用QQ邮箱订阅本网站