Maya-查询先前的渲染信息 [英] Maya - Querying previous render information

查看:99
本文介绍了Maya-查询先前的渲染信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道是否可以通过python或mel查询maya中最后一个渲染的渲染时间?

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?

谢谢

推荐答案

我不知道直接查询它的方法,但是此解决方案有效:

I know of no way to query it directly, but this solution works:

Pre Render MEL中放置以下内容(来自渲染设置"):

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()


并将其放入您的Post Render MEL:

python "global last_render_time;import time;last_render_time=time.time()-last_render_time"

展开:

global last_render_time # again, not needed when in module
import time
last_render_time = time.time() - last_render_time

这将存储一个全局python变量last_render_time,这是渲染所花费的秒数.

This will store a global python variable last_render_time which is the number of seconds the render took.

这篇关于Maya-查询先前的渲染信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆