@@ -66,6 +66,18 @@ def init_data(self):
66
66
if not isinstance (data , dict ):
67
67
return
68
68
69
+ # Add no-timecode option
70
+ self ._data [len (self ._data )] = {
71
+ QtCore .Qt .DisplayRole : 'No timecode' ,
72
+ QtCore .Qt .DecorationRole : None ,
73
+ QtCore .Qt .SizeHintRole : self .row_size ,
74
+ QtCore .Qt .StatusTipRole : 'No timecode' ,
75
+ QtCore .Qt .AccessibleDescriptionRole : 'No timecode' ,
76
+ QtCore .Qt .WhatsThisRole : 'No timecode' ,
77
+ QtCore .Qt .ToolTipRole : 'No timecode' ,
78
+ QtCore .Qt .UserRole : None ,
79
+ }
80
+
69
81
template = common .settings .value ('ffmpeg/timecode_preset' )
70
82
for v in data [tokens .FFMpegTCConfig ].values ():
71
83
if template == v ['name' ]:
@@ -100,8 +112,7 @@ class TimecodeComboBox(QtWidgets.QComboBox):
100
112
def __init__ (self , parent = None ):
101
113
super ().__init__ (parent = parent )
102
114
self .setView (QtWidgets .QListView ())
103
- model = TimecodeModel ()
104
- self .setModel (model )
115
+ self .setModel (TimecodeModel ())
105
116
106
117
107
118
class PresetComboBox (QtWidgets .QComboBox ):
@@ -139,10 +150,17 @@ def init_data(self):
139
150
140
151
"""
141
152
db = database .get (* common .active ('root' , args = True ))
142
- width = db .value (db .source (), 'width' , database .BookmarkTable )
143
- height = db .value (db .source (), 'width' , database .BookmarkTable )
153
+ bookmark_width = db .value (db .source (), 'width' , database .BookmarkTable )
154
+ bookmark_height = db .value (db .source (), 'width' , database .BookmarkTable )
155
+ asset_width = db .value (common .active ('asset' , path = True ), 'asset_width' , database .AssetTable )
156
+ asset_height = db .value (common .active ('asset' , path = True ), 'asset_height' , database .AssetTable )
157
+
158
+ width = asset_width or bookmark_width or None
159
+ height = asset_height or bookmark_height or None
160
+
144
161
if all ((width , height )):
145
162
self .addItem (f'Project | { int (height )} p' , userData = (width , height ))
163
+ self .addItem (f'Project | { int (height * 0.5 )} p' , userData = (int (width * 0.5 ), int (height * 0.5 )))
146
164
147
165
self .blockSignals (True )
148
166
for v in ffmpeg .SIZE_PRESETS .values ():
@@ -179,14 +197,6 @@ class FFMpegWidget(base.BasePropertyEditor):
179
197
'placeholder' : None ,
180
198
'description' : 'Set the output video size.' ,
181
199
},
182
- 2 : {
183
- 'name' : 'Add timecode' ,
184
- 'key' : 'ffmpeg_add_timecode' ,
185
- 'validator' : None ,
186
- 'widget' : functools .partial (QtWidgets .QCheckBox , 'Add Timecode' ),
187
- 'placeholder' : None ,
188
- 'description' : 'Add an informative bar and a timecode.' ,
189
- },
190
200
3 : {
191
201
'name' : 'Timecode preset' ,
192
202
'key' : 'ffmpeg_timecode_preset' ,
@@ -272,7 +282,7 @@ def save_changes(self):
272
282
v ['preset' ] == preset
273
283
)
274
284
275
- if self .ffmpeg_add_timecode_editor . isChecked ():
285
+ if self .ffmpeg_timecode_preset_editor . currentData ():
276
286
destination = f'{ seq .group (1 ).strip ().strip ("_" ).strip ("." )} ' \
277
287
f'{ seq .group (3 ).strip ().strip ("_" ).strip ("." )} _tc.' \
278
288
f'{ ext } '
@@ -307,15 +317,12 @@ def save_changes(self):
307
317
return
308
318
309
319
timecode_preset = self .ffmpeg_timecode_preset_editor .currentData ()
310
- if not timecode_preset :
311
- common .close_message ()
312
- raise RuntimeError ('No timecode preset was selected.' )
313
320
314
321
mov = ffmpeg .convert (
315
322
source_image_paths [0 ],
316
323
self .ffmpeg_preset_editor .currentData (),
317
324
size = self .ffmpeg_size_editor .currentData (),
318
- timecode = self . ffmpeg_add_timecode_editor . isChecked ( ),
325
+ timecode = bool ( timecode_preset ),
319
326
timecode_preset = timecode_preset ,
320
327
output_path = destination ,
321
328
parent = self
0 commit comments