@@ -313,10 +313,10 @@ def getProfileName(self, profile_path):
313
313
if profile_path == path :
314
314
return profile
315
315
316
- def updateProgressBar (self , title_message , start_frame , end_frame , current_frame , progress_format ):
316
+ def updateProgressBar (self , title_message , start_frame , end_frame , current_frame , format_of_progress_string ):
317
317
"""Update progress bar during exporting"""
318
318
if end_frame - start_frame > 0 :
319
- percentage_string = progress_format % (( current_frame - start_frame ) / ( end_frame - start_frame ) * 100 )
319
+ percentage_string = format_of_progress_string % (( current_frame - start_frame ) / ( end_frame - start_frame ) * 100 )
320
320
else :
321
321
percentage_string = "100%"
322
322
self .progressExportVideo .setValue (current_frame )
@@ -913,31 +913,31 @@ def titlestring(sec, fps, mess):
913
913
start_frame_export = video_settings .get ("start_frame" )
914
914
end_frame_export = video_settings .get ("end_frame" )
915
915
last_exported_time = time .time ()
916
- old_part = 0.0
917
- new_part = 0.0
918
- afterpoint = 1
916
+ last_displayed_exported_portion = 0.0
917
+ current_exported_portion = 0.0
918
+ digits_after_decimalpoint = 1
919
919
# Precision of the progress bar
920
- progress_format = "%4.1f%% "
920
+ format_of_progress_string = "%4.1f%% "
921
921
# Write each frame in the selected range
922
922
for frame in range (video_settings .get ("start_frame" ), video_settings .get ("end_frame" ) + 1 ):
923
923
# Update progress bar (emit signal to main window)
924
924
end_time_export = time .time ()
925
925
if ((frame % progressstep ) == 0 ) or ((end_time_export - last_exported_time ) > 1 ):
926
- new_part = (frame - start_frame_export ) * 1.0 / (end_frame_export - start_frame_export )
927
- if ((new_part - old_part ) > 0.0 ):
926
+ current_exported_portion = (frame - start_frame_export ) * 1.0 / (end_frame_export - start_frame_export )
927
+ if ((current_exported_portion - last_displayed_exported_portion ) > 0.0 ):
928
928
# the log10 of the difference of the fraction of the completed frames is the negativ
929
929
# number of digits after the decimal point after which the first digit is not 0
930
- afterpoint = math .ceil ( - 2.0 - math .log10 ( new_part - old_part ))
930
+ digits_after_decimalpoint = math .ceil ( - 2.0 - math .log10 ( current_exported_portion - last_displayed_exported_portion ))
931
931
else :
932
- afterpoint = 1
933
- if afterpoint < 1 :
932
+ digits_after_decimalpoint = 1
933
+ if digits_after_decimalpoint < 1 :
934
934
# We want at least 1 digit after the decimal point
935
- afterpoint = 1
936
- if afterpoint > 5 :
935
+ digits_after_decimalpoint = 1
936
+ if digits_after_decimalpoint > 5 :
937
937
# We don't want not more than 5 difits after the decimal point
938
- afterpoint = 5
939
- old_part = new_part
940
- progress_format = "%4." + str (afterpoint ) + "f%% "
938
+ digits_after_decimalpoint = 5
939
+ last_displayed_exported_portion = current_exported_portion
940
+ format_of_progress_string = "%4." + str (digits_after_decimalpoint ) + "f%% "
941
941
last_exported_time = time .time ()
942
942
if ((( frame - start_frame_export ) != 0 ) & (( end_time_export - start_time_export ) != 0 )):
943
943
seconds_left = round (( start_time_export - end_time_export )* ( frame - end_frame_export )/ ( frame - start_frame_export ))
@@ -948,7 +948,7 @@ def titlestring(sec, fps, mess):
948
948
title_message = titlestring (seconds_left , fps_encode , "Remaining" )
949
949
950
950
# Emit frame exported
951
- get_app ().window .ExportFrame .emit (title_message , video_settings .get ("start_frame" ), video_settings .get ("end_frame" ), frame , progress_format )
951
+ get_app ().window .ExportFrame .emit (title_message , video_settings .get ("start_frame" ), video_settings .get ("end_frame" ), frame , format_of_progress_string )
952
952
953
953
# Process events (to show the progress bar moving)
954
954
QCoreApplication .processEvents ()
@@ -968,7 +968,7 @@ def titlestring(sec, fps, mess):
968
968
title_message = titlestring (seconds_run , fps_encode , "Elapsed" )
969
969
970
970
get_app ().window .ExportFrame .emit (title_message , video_settings .get ("start_frame" ),
971
- video_settings .get ("end_frame" ), frame , progress_format )
971
+ video_settings .get ("end_frame" ), frame , format_of_progress_string )
972
972
973
973
except Exception as e :
974
974
# TODO: Find a better way to catch the error. This is the only way I have found that
@@ -1036,7 +1036,7 @@ def titlestring(sec, fps, mess):
1036
1036
title_message = titlestring (seconds_run , fps_encode , "Elapsed" )
1037
1037
1038
1038
get_app ().window .ExportFrame .emit (title_message , video_settings .get ("start_frame" ),
1039
- video_settings .get ("end_frame" ), frame , progress_format )
1039
+ video_settings .get ("end_frame" ), frame , format_of_progress_string )
1040
1040
1041
1041
# Make progress bar green (to indicate we are done)
1042
1042
from PyQt5 .QtGui import QPalette
0 commit comments