Maya - Querying previous render information

∥☆過路亽.° 提交于 2019-12-08 07:51:39

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/21488519/maya-querying-previous-render-information

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!