0
$\begingroup$

I am currently in the process of upgrading my animation equipment, and I want to track machine performance. In order to do this I need to extract or export how long it takes to render an entire project.

The Data I want to track is:

How long it takes to render one frame The time the Render Started The time the Render Ended

I need an accurate way of doing this, doing it manually isn't an option especially when you have more than one machine to manage.

$\endgroup$
1
  • 1
    $\begingroup$ Check the Metadata tab in Render properties. All the information is written to the files when they are rendered. You can read the metadata from frames with python. $\endgroup$ Jun 14, 2019 at 21:36

1 Answer 1

1
$\begingroup$

You can read the information from metadata written into the image (check what metadata to save in Metadata tab inside Render panel):

import os

string = ""
with open("PATH_TO_IMAGE", "rb") as file:
    byte = file.read(1)
    while byte and string[-4:] != "IDAT":
        char = byte.decode('utf-8', 'ignore')
        if char.isprintable():
            string += char
        byte = file.read(1)
file.close()

render_time_pos = string.find("RenderTime")
if render_time_pos > 0:
    time_string = ""
    i = render_time_pos + 10
    while (string[i].isdigit() or string[i] in ":") and i < len(string):
        time_string += string[i]
        i += 1
    times = [int(i) for i in time_string.split(':')]
    times.reverse()
    print("frame took %02d sec" % sum([a*b for a,b in zip(times,[1,60,3600])]))
else:
    print("render time metadata not found")
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .