I have this script here (Please ignore the code quality):
from datetime import datetime
from bpy.app import handlers
TIMER = None
TOTAL_RENDER_TIMES = []
TOTAL_TIME = 0;
rendertime=None
rendertimeFLOAT=None
def start_timer(scene):
global TIMER
TIMER = datetime.now()
def elapsed(dummy):
rendertime=datetime.now() - TIMER
rendertimeFLOAT=rendertime.total_seconds()
TOTAL_RENDER_TIMES.append(rendertimeFLOAT)
print(TOTAL_RENDER_TIMES)
#print("Elapsed:", datetime.now() - TIMER)
def complete():
for x in TOTAL_RENDER_TIMES:
TOTAL_TIME+=x
print("TOTAL RENDER TIME: "+TOTAL_TIME)
print("AVERAGE TIME PER FRAME: "+(TOTAL_TIME/len(TOTAL_RENDER_TIMES)))
handlers.render_pre.append(start_timer)
handlers.render_stats.append(elapsed)
It's supposed to get the render time of each frame and return the total time, and average time. But when I run it, the console tells me this:
Traceback (most recent call last): File "\Text", line 14, in elapsed NameError: name 'renderTimeFLOAT' is not defined Traceback (most recent call last): File "\Text", line 15, in elapsed NameError: name 'renderTimeFLOAT' is not defined
My problem, though, is that I fixed the error on lines 14 and 15. After some experimentation, I found that the script completely didn't update! It was still running an old version of the script. I have tried saving the text, making a new file, running the script, to no avail. I can go as far as to delete everything in the editor and it will still function. What's going on!??! Currently running Blender 3.0 Portable