Does anyone know whether its possible to query the render time of the last render in maya via python or mel?
Render time is stored in the render viewer window in the form of a string at the bottom of the image, I would like to access this time and retrieve for later use - is this possible?
Thanks
I know of no way to query it directly, but this solution works:
Put the following in your Pre Render MEL
(from the Render Settings):
python "global last_render_time;import time;last_render_time=time.time()"
Expanded for readability:
global last_render_time # not needed when in module
import time
last_render_time = time.time()
And put this in your Post Render MEL
:
python "global last_render_time;import time;last_render_time=time.time()-last_render_time"
Expanded:
global last_render_time # again, not needed when in module
import time
last_render_time = time.time() - last_render_time
This will store a global python variable last_render_time
which is the number of seconds the render took.