8

Does Blender keep a log when it's rendering? Specifically, does it track when the render started, how long each frame took, etc.? I'm super curious about this information.

Aandnota
  • 83
  • 5
  • I don't think it does, but it should be relatively simple to implement as an addon – someonewithpc Dec 15 '15 at 21:54
  • Blender has System Console with text. Show with Menu ... Window Toggle System Console. Frame rendering info of some sort is there. Frame by frame rendering produces timestamps with can be subtracted for time duration. These comments are meant as an interim measure. Blender has frame events which are script accessible. – atomicbezierslinger Dec 15 '15 at 21:54
  • The console doesn't seem to have anything relevant, I don't think – someonewithpc Dec 15 '15 at 21:59
  • 1
    With a frame change handler script you might consider subtracting the time of first frame render from the time of last frame render and print text to console. Have you written a script before? A relevant search term here might be .... frame_change.append ............ If time permits I will post one here. If you subtract the relevant file creation times from your operating system you might get a useful duration. – atomicbezierslinger Dec 15 '15 at 22:28
  • Time: 00:00.12 (Saving: 00:00.02) ..... is an example from the Blender Console. So perhaps not the most appetizing approach to sum the time values. – atomicbezierslinger Dec 15 '15 at 22:43
  • 3
    The rendertime is saved in each rendered image's meta data. You can also write quite a bit of information directly onto the image via the stamp option – gandalf3 Dec 16 '15 at 03:01

1 Answers1

2

Here's a quick script you can use to output some simple frame times:

import bpy
from bpy.app import handlers
from datetime import datetime


def render_init_handler(dummy):

    global LASTFRAME
    global STARTTIME

    STARTTIME = datetime.now()
    LASTFRAME = datetime.now()


def render_post_handler(dummy):

    global LASTFRAME
    global STARTTIME

    ELAPSEDTIME = datetime.now() - STARTTIME
    FRAMELENGTH = datetime.now() - LASTFRAME
    frameNum = bpy.context.scene.frame_current
    blendName = bpy.path.basename(bpy.context.blend_data.filepath)[:-6]

    f = open(bpy.path.abspath("//") + blendName + '-renderlog.txt','a')
    f.write("Frame %d - Length: %s - Elapsed: %s\n" % (frameNum,FRAMELENGTH, ELAPSEDTIME)) 
    f.close()

    LASTFRAME = datetime.now()

handlers.render_init.append(render_init_handler)    
handlers.render_post.append(render_post_handler)

You should generate a text file that looks like this inside:

Frame 1 - Length: 0:00:00.139432 - Elapsed: 0:00:00.139441
Frame 2 - Length: 0:00:00.232712 - Elapsed: 0:00:00.372586
Frame 3 - Length: 0:00:00.257580 - Elapsed: 0:00:00.630437
Frame 4 - Length: 0:00:00.265303 - Elapsed: 0:00:00.895999
Frame 5 - Length: 0:00:00.259570 - Elapsed: 0:00:01.155840
Frame 6 - Length: 0:00:00.266500 - Elapsed: 0:00:01.422597
Frame 7 - Length: 0:00:00.260504 - Elapsed: 0:00:01.683389
Frame 8 - Length: 0:00:00.259319 - Elapsed: 0:00:01.942971
Frame 9 - Length: 0:00:00.258627 - Elapsed: 0:00:02.201868
Frame 10 - Length: 0:00:00.260319 - Elapsed: 0:00:02.462535
Frame 11 - Length: 0:00:00.257915 - Elapsed: 0:00:02.720720
Frame 12 - Length: 0:00:00.261301 - Elapsed: 0:00:02.982309
Frame 13 - Length: 0:00:00.262327 - Elapsed: 0:00:03.244906
Todd McIntosh
  • 9,421
  • 25
  • 50