def get_number_of_frames()

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


def get_number_of_frames(path):
    """Reads the header of the blend file and calculates
    the number of frames it has.

    Keyword arguments:
    path -- path where the blend file is located
    """

    try:
        frame_start, frame_end, scene = read_blend_rend_chunk(path)[0]
    except FileNotFoundError as e:
        print(e.args[1])
        sys.exit(2)
    else:
        return int(frame_end - frame_start + 1)