def calculate_array_job_size()

in content/rendering-with-batch/batch/batch.files/job_submission.py [0:0]


def calculate_array_job_size():
    """Calculates the size of the job array
    based on the number of frames of the blender file
    and the number of frames that each job has to render
    """

    # Get the scene's number of frames by reading the header of the blend file
    n_frames = get_number_of_frames('./{}'.format(FILE_NAME))

    # Adjust the number of frames per job, if that value is greater than the number of frames in the scene
    global F_PER_JOB
    F_PER_JOB = min(F_PER_JOB, n_frames)

    # Calculate how many jobs need to be submitted
    return n_frames, math.ceil(n_frames / F_PER_JOB)