XaiJu
Workbench
Workbench

patreon


rndrtime 1.0

Here's a quick Python script I wrote today to calculate render times for folders of images.

And side note: this is so much better than holding onto and trying to organize these files by month!

Short story: I rendered something last night. It was short but the frames were large so I left it running. This morning, I closed my queue before seeing how long it took and I was curious—especially since I had to re-render it. I've had this idea for a while, and since I had to re-render this comp, I just built it while waiting for that.

The idea is that it goes through a folder of images and calculates the oldest and newest modified dates. Then figures out roughly when the render started and exactly when it finished. It's rough because we don't know when the first file was started, so we take the average render time and subtract it from the start time. Anyway, this gives us roughly the time it took to render, around when it started and exactly when it finished. So you run this Python script with the directory the images are in and you get a rough idea of how long it took.

And, as you can see in the image above, it doesn't matter when you rendered the frames since we're just checking modified dates on files.

All you need is Python 3 installed on your machine. Then you can run this in the command line using python3 path/to/script/rndrtime.py and drag your directory to the command line. However, a better way is to set it up in your environment. If you're on modern macOS like me, that will be ~/.zshenv. You'll have to match it to your shell. BASH would be ~/.bashenv for example, which is what macOS used previously.

In my case, I edit that using sudo nano .zshenv then I add it to my file like this:

function rndrtime() {

 python3 /Volumes/Dropbox/Dropbox/Apps/Python/rndrtime.py "$@"

}

There shouldn't be additional spaces in between lines there, but Patreon doesn't have a code setting apparently. Hit ctrl+X and then Y at the prompt to save. Open a new Terminal window and you're good to go.

This allows you to just type rndrtime /path/to/img/directory and that's it. There's a lot of help online for Python if you get lost and want to use this. Note: this may function differently on Windows. I don't know. I'm pretty sure Windows uses modified dates the same way, but it might not. So if it doesn't work, that's the first place to start looking! Alright, more to come!

rndrtime 1.0

More Creators