1
0
mirror of https://github.com/DarklightGames/io_scene_psk_psa.git synced 2024-11-23 22:40:59 +01:00

Fixed a bug where 0 frames could be output for a sequence if the compression ratio was less than 1.0

This commit is contained in:
Colin Basnett 2024-10-01 20:35:12 -07:00
parent ff74f47178
commit 1f2ec4c76b

View File

@ -155,7 +155,7 @@ def build_psa(context: bpy.types.Context, options: PsaBuildOptions) -> Psa:
# Calculate the frame step based on the compression factor.
frame_extents = abs(frame_end - frame_start)
frame_count_raw = frame_extents + 1
frame_count = max(export_sequence.key_quota, int(frame_count_raw * export_sequence.compression_ratio))
frame_count = max(1, max(export_sequence.key_quota, int(frame_count_raw * export_sequence.compression_ratio)))
try:
frame_step = frame_extents / (frame_count - 1)