@@ -51,6 +51,9 @@ class ProcessEffect(QDialog):
51
51
ui_path = os .path .join (info .PATH , 'windows' , 'ui' , 'process-effect.ui' )
52
52
53
53
def __init__ (self , clip_id , effect_name , effect_params ):
54
+
55
+ if not openshot .Clip ().COMPILED_WITH_CV :
56
+ raise ModuleNotFoundError ("Openshot not compiled with OpenCV" )
54
57
55
58
# Create dialog class
56
59
QDialog .__init__ (self )
@@ -59,6 +62,7 @@ def __init__(self, clip_id, effect_name, effect_params):
59
62
self .effect_name = effect_name
60
63
self .context = {}
61
64
65
+ # Access C++ timeline and find the Clip instance which this effect should be applied to
62
66
timeline_instance = get_app ().window .timeline_sync .timeline
63
67
for clip_instance in timeline_instance .Clips ():
64
68
if clip_instance .Id () == self .clip_id :
@@ -195,7 +199,7 @@ def __init__(self, clip_id, effect_name, effect_params):
195
199
# flag to close the clip processing thread
196
200
self .cancel_clip_processing = False
197
201
self .effect = None
198
-
202
+
199
203
def spinner_value_changed (self , widget , param , value ):
200
204
"""Spinner value change callback"""
201
205
self .context [param ["setting" ]] = value
@@ -293,19 +297,11 @@ def accept(self):
293
297
# Print effect settings
294
298
log .info (self .context )
295
299
296
- # DO WORK HERE, and periodically set progressBar value
297
- # Access C++ timeline and find the Clip instance which this effect should be applied to
298
-
299
300
# Create effect Id and protobuf data path
300
301
ID = get_app ().project .generate_id ()
301
302
302
- protobufFolderPath = os .path .join (info .PATH , '..' , 'protobuf_data' )
303
- # Check if protobuf data folder exists, otherwise it will create one
304
- if not os .path .exists (protobufFolderPath ):
305
- os .mkdir (protobufFolderPath )
306
-
307
303
# Create protobuf data path
308
- protobufPath = os .path .join (protobufFolderPath , ID + '.data' )
304
+ protobufPath = os .path .join (info . PROTOBUF_DATA_PATH , ID + '.data' )
309
305
310
306
# Load into JSON string info abou protobuf data path
311
307
jsonString = self .generateJson (protobufPath )
@@ -359,7 +355,7 @@ def generateJson(self, protobufPath):
359
355
if self .effect_name == "Tracker" :
360
356
361
357
# Set tracker info in JSON string
362
- # Get selected tracker [KCF, MIL, TLD, BOOSTING, MEDIANFLOW, GOTURN, MOOSE, CSRT]
358
+ # Get selected tracker [KCF, MIL, TLD, BOOSTING, MEDIANFLOW, MOOSE, CSRT]
363
359
trackerType = self .context ["tracker-type" ]
364
360
jsonString += ',"tracker_type": "%s"' % trackerType
365
361
0 commit comments