-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathTextOverlays.nk
121 lines (121 loc) · 3.71 KB
/
TextOverlays.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
set cut_paste_input [stack 0]
push $cut_paste_input
Group {
name DailiesTextOverlay
selected true
xpos 440
ypos 1107
addUserKnob {20 DailiesTextOverlay}
addUserKnob {2 font}
font ~/dev/generate_dailies/generate-dailies/fonts/Helvetica/Helvetica.ttf
addUserKnob {22 process l "Print Config" t "Print yaml config for text nodes inside. \n\nEach text node is a text element with a size location and color. \n\nClicking this button prints a yaml config that you can copy/paste into the config file. \n\n\n\n\n\n\n" T "node = nuke.thisNode()\nnuke.root().begin()\nnode.begin()\nwidth = node.width()\nheight = node.height()\n\ntext_elements = \"\"\nfor n in nuke.allNodes('Text'):\n text_element_name = n.name()\n font = n\['font'].evaluate()\n font_size = n\['size'].getValue() / width\n box = n\['box'].getValue()\n box = \[box\[0] / width, box\[1] / height, box\[2] / width, box\[3] / height]\n color = n\['color'].getValue()\n justify = n\['xjustify'].value()\n text_element = \"\"\"\n\{0\}:\n enable: true\n prefix:\n font: \{1\}\n font_size: \{2\}\n # Position a box: 2 x/y coordinates: \[LL, UR]. 0,0 is Lower Left (Nuke-style)\n box: \{3\}\n font_color: \{4\}\n justify: \{5\} \n\"\"\".format( text_element_name, font, font_size, box, color, justify )\n if text_element_name == \"datetime\":\n text_element = text_element + \"\"\" # https://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior\n # Specify the datetime format. For example \"%Y-%m-%dT%H:%M:%S\" is ISO 8601 standard date format\n # This would be Mon July 7 2017 23h13: \"%a %b %d %Y %Hh%M\"\n datetime_format: \"%Y-%m-%d %Hh%M\"\n\"\"\"\n text_elements += text_element\nnuke.message(text_elements)" +STARTLINE}
}
Input {
inputs 0
name Input
xpos -230
ypos -945
}
Dot {
name Dot1
label " "
note_font "Helvetica Bold Bold"
note_font_size 24
note_font_color 0xa5a5a501
xpos -196
ypos -906
}
set N5d883790 [stack 0]
Text {
message "Jed Smith"
font "\[value parent.font]"
size 28
xjustify center
yjustify bottom
Transform 1
box {831 1024 1113 1079.875}
center {960 540}
color {0.8 0.8 0.8 1}
name artist
xpos -230
ypos -726
}
Text {
message "This is a long comment you motherfucker. Just final it. I would also like to point out that this plate is shit and I really don't like it but I do find that the director is also shit. Oh well, I guess I'll just keep working."
font "\[value parent.font]"
size 24
yjustify bottom
Transform 1
box {35 20 946 153}
center {960 540}
color {0.8 0.8 0.8 1}
name comment
xpos -230
ypos -668
}
Text {
message 1001
font "\[value parent.font]"
size 28
yjustify bottom
Transform 1
box {1800 18 1898.9375 90}
center {960 540}
color {0.8 0.8 0.8 1}
name framecounter
xpos -230
ypos -609
}
Text {
message "2018-09-07 23h12"
font "\[value parent.font]"
size 28
yjustify bottom
Transform 1
box {1618 1024 1915.234375 1076.625}
center {960 540}
color {0.8 0.8 0.8 1}
name datetime
xpos -230
ypos -556
}
Text {
message comp
font "\[value parent.font]"
size 28
yjustify bottom
Transform 1
box {40 1024 282.6171875 1066}
center {960 540}
color {0.8 0.8 0.8 1}
name discipline
xpos -230
ypos -505
}
Output {
name Output1
xpos -230
ypos -313
}
push $N5d883790
Rectangle {
area {0 0 {width} 1080}
name Rectangle1
selected true
xpos -360
ypos -909
addUserKnob {20 User}
addUserKnob {7 input_ar l "" +STARTLINE R 0 4}
input_ar {{width/height}}
addUserKnob {7 aspect l "" +STARTLINE R 0 3}
aspect 1.85
addUserKnob {7 arpx l "" +STARTLINE}
arpx {{"aspect - input_ar * height"}}
}
Viewer {
frame_range 1-100
name Viewer1
xpos -219
ypos -37
}
end_group