-
Notifications
You must be signed in to change notification settings - Fork 0
/
cm_cameraPlane.nk
161 lines (161 loc) · 7.09 KB
/
cm_cameraPlane.nk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
Group {
name cm_cameraPlane
tile_color 0xb20000ff
label "Ref Frame:\[value ref_frame]\nDistance:\[value plane_distance]\nType:\[value transform]"
selected true
xpos 299
ypos 82
addUserKnob {20 CameraPlane l cameraPlane t "Settings for CameraPlane"}
addUserKnob {4 cameraList l "connect camera" M {----------------------------------- "Load a Camera"}}
addUserKnob {22 reloadCams l "Reload Camera List" -STARTLINE T "def getCameras():\n with nuke.root():\n myCameras = \[]\n \n ##For loop to grab all nodes in the class\n for i in nuke.allNodes():\n if i.Class() == \"Camera\" or i.Class() == \"Camera2\":\n myCameras.append(i.knob('name').getValue())\n \n if myCameras == \[]:\n resetCameras()\n else: \n myCameras.sort()\n return myCameras\n\n\n\n\n\ndef resetCameras():\n n.setInput(1, None)\n if myCameras == \[]:\n nuke.message(\"Bring in a Camera\") \n return\n\n\n\n\nmyCameras = \[]\nn = nuke.thisNode()\nk = n\['cameraList']\ncurrent = k.value()\n\n\n\nif getCameras() == None:\n n\['cameraList'].setValues(\['-----------------------------------','Load a Camera'])\nelse:\n with nuke.root():\n k.setValues(getCameras())\n k.setValue(current)"}
addUserKnob {22 connect l Connect -STARTLINE T "n = nuke.thisNode()\nk = n\['cameraList']\nif k.value() != '-----------------------------------':\n cam = nuke.toNode(n\['cameraList'].value())\n n.setInput(1, cam)\nelse:\n nuke.message(\"Hit Reload\")"}
addUserKnob {41 format l "output format" T Reformat1.format}
addUserKnob {4 transform M {Match-Move Stabilize "" "" "" "" "" "" "" ""}}
addUserKnob {3 ref_frame l "reference frame"}
ref_frame 1001
addUserKnob {22 python_button l "current frame" -STARTLINE T "nuke.thisNode()\['ref_frame'].setValue(nuke.frame())"}
addUserKnob {7 plane_distance l "plane distance" R 0 1000}
plane_distance 100
addUserKnob {26 ""}
addUserKnob {41 overscan_px l "Overscan (px)" T Overscan_Crop.overscan_px}
addUserKnob {41 crop l "black outside" T Overscan_Crop.crop}
addUserKnob {26 ""}
addUserKnob {41 motionblur T Card3D.motionblur}
addUserKnob {41 shutter T Card3D.shutter}
addUserKnob {26 ""}
addUserKnob {26 author l "" +STARTLINE T "CameraPlane v1.0 - (c) 2022 - Chris McCrowe - <a href=\"www.chrismccrowe.com\" style=\"color:#69a1fa;\">www.chrismccrowe.com</a>"}
}
Input {
inputs 0
name Camera
xpos -554
ypos -130
number 1
}
Dot {
name Dot1
xpos -526
ypos 6
}
set N1aa95000 [stack 0]
Camera2 {
inputs 0
translate {{"\[topnode parent.input1].translate.x(parent.ref_frame)"} {"\[topnode parent.input1].translate.y(parent.ref_frame)"} {"\[topnode parent.input1].translate.z(parent.ref_frame)"}}
rotate {{"\[topnode parent.input1].rotate.x(parent.ref_frame)"} {"\[topnode parent.input1].rotate.y(parent.ref_frame)"} {"\[topnode parent.input1].rotate.z(parent.ref_frame)"}}
focal {{"\[topnode parent.input1].focal(parent.transform==1?parent.ref_frame:frame)"}}
haperture {{"\[topnode parent.input1].haperture(parent.transform==1?parent.ref_frame:frame)" x1439 23.76000259 x1483 6.5}}
vaperture {{"\[topnode parent.input1].vaperture(parent.transform==1?parent.ref_frame:frame)"}}
near 4.4
focal_point 0
fstop 5.599999905
name renderCamera
selected true
xpos -777
ypos 109
addUserKnob {20 User}
addUserKnob {4 cameraList l "connect camera" M {"\[]"}}
}
Switch {
inputs 2
which {{!parent.transform}}
name Switch4
tile_color 0xff00ff
label "Stabilize or Match-move\n"
note_font "DejaVu Sans Bold"
xpos -554
ypos 123
addUserKnob {20 CM}
addUserKnob {3 changeColor l INVISIBLE +INVISIBLE}
changeColor {{"\[if \{\[value disable]==true\} \{\nknob tile_color 0x4c0d00ff\nbrake\}]\n\n\[if \{\[value which]<1\} then \{\nknob tile_color 0xff0000ff\n\} elseif \{\[value which]==1\} then \{\nknob tile_color 0xff00ff\n\} else \{\nknob tile_color 0xffff\}]\n\n\[value this.which]"}}
addUserKnob {26 info l "" +STARTLINE T "disable = dark red\n\n0 = red\n1 = green\n2 = blue\n"}
}
Input {
inputs 0
name Image
xpos -261
ypos -317
}
Card3D {
inputs 2
useMatrix true
matrix {
{{MatrixAxis.world_matrix.0(parent.transform==0?parent.ref_frame:frame)} {MatrixAxis.world_matrix.1(parent.transform==0?parent.ref_frame:frame)} {MatrixAxis.world_matrix.2(parent.transform==0?parent.ref_frame:frame)} {MatrixAxis.world_matrix.3(parent.transform==0?parent.ref_frame:frame)}}
{{MatrixAxis.world_matrix.4(parent.transform==0?parent.ref_frame:frame)} {MatrixAxis.world_matrix.5(parent.transform==0?parent.ref_frame:frame)} {MatrixAxis.world_matrix.6(parent.transform==0?parent.ref_frame:frame)} {MatrixAxis.world_matrix.7(parent.transform==0?parent.ref_frame:frame)}}
{{MatrixAxis.world_matrix.8(parent.transform==0?parent.ref_frame:frame)} {MatrixAxis.world_matrix.9(parent.transform==0?parent.ref_frame:frame)} {MatrixAxis.world_matrix.10(parent.transform==0?parent.ref_frame:frame)} {MatrixAxis.world_matrix.11(parent.transform==0?parent.ref_frame:frame)}}
{{MatrixAxis.world_matrix.12(parent.transform==0?parent.ref_frame:frame)} {MatrixAxis.world_matrix.13(parent.transform==0?parent.ref_frame:frame)} {MatrixAxis.world_matrix.14(parent.transform==0?parent.ref_frame:frame)} {MatrixAxis.world_matrix.15(parent.transform==0?parent.ref_frame:frame)}}
}
lens_in_focal {{"\[topnode parent.input1].focal(parent.transform==0?parent.ref_frame:frame)" x1073 0}}
lens_in_haperture {{"\[topnode parent.input1].haperture(parent.transform==0?parent.ref_frame:frame)"}}
format {{{parent.Reformat1.format}}}
motionblur 1
shutteroffset centred
name Card3D
xpos -261
ypos 129
}
set N19a9bc00 [stack 0]
Group {
name Overscan_Crop
tile_color 0xbe81caff
xpos -261
ypos 334
addUserKnob {20 Controls}
addUserKnob {7 overscan_px l "Overscan (px)" R 0 100}
addUserKnob {26 ""}
addUserKnob {41 softness T Crop1.softness}
addUserKnob {41 reformat T Crop1.reformat}
addUserKnob {41 intersect -STARTLINE T Crop1.intersect}
addUserKnob {41 crop l "black outside" -STARTLINE T Crop1.crop}
addUserKnob {26 ""}
addUserKnob {26 _1 l "" +STARTLINE T "Overscan_Crop v1.0 - (c) 2023 - Chris McCrowe - <a href=\"www.chrismccrowe.com\">www.chrismccrowe.com</a>"}
}
Input {
inputs 0
name Input1
xpos -885
ypos -678
}
Crop {
box {{0-parent.overscan_px x1668366 128} {0-parent.overscan_px x1668366 -100} {"input.width + parent.overscan_px" x1668366 3940} {"input.height + parent.overscan_px" x1668366 2058}}
intersect true
name Crop1
selected true
xpos -885
ypos -610
}
Output {
name Output1
xpos -885
ypos -538
}
end_group
Output {
name Output1
xpos -261
ypos 744
}
Reformat {
inputs 0
name Reformat1
note_font "Bitstream Vera Sans"
xpos -106
ypos 128
}
push $N1aa95000
Axis2 {
translate {0 0 {-plane_distance}}
uniform_scale {{plane_distance}}
name MatrixAxis
note_font "Bitstream Vera Sans"
xpos -416
ypos -12
}
push $N19a9bc00
Viewer {
frame_range 1100-1100
colour_sample_bbox {-1.595185995 -0.6187089682 -1.594091892 -0.6181619167}
name Viewer1
xpos -763
ypos 819
}
end_group