如何使用 max 脚本增量保存单个渲染
当我建模时,我喜欢渲染一个框架来显示我的进展。我想对渲染器进行编程,将渲染保存为渲染输出,并在其末尾添加一个增量数字。因此,我最终会进行许多渲染,就像动画的渲染序列一样,但使用我决定制作的帧。这样做的目的是使创建过程自动化。
While I am modeling I like to render a frame to show the progress as I am going along. I would like to program the renderer to save the render as a render output and add an incremental number to the end of it. So I would have a number of renders at the end just like a render sequence for an animation but with the frames I decide to make. The purpose of this is to automate the process of creating a making of.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这是一个在每一帧增加文件名的循环。
使用最后一行的结果作为文件名。
如果您只是将数字“添加”到您的计算机中,您会遇到一个问题
文件名是其他应用程序(包括内存播放器)无法将它们识别为序列。
使用下面的解决方案,您可以正确添加它,例如 0001 - 0002 等。
如果您希望输出中包含更多 0,请更改行“.4i”。
运行的结果可以在脚本监听器中看到。
Here's a loop to increment your filename names at each frame.
use the last line's result as your filename.
One problem that you will encounter if you just "add numbers" to your
filename is that other applications (including ram player) dont recognize them as a sequence.
with the solution below you add it properly, with 0001 - 0002 etc.
change the line ".4i" if you want more 0's in your output.
the result from running this can be seen in the script listener.
如果将文件保存到新的空文件夹中,则每次保存文件时,您可以在文件名后附加一个与目录中文件数相对应的整数。
If you save the files to a new empty folder then each time you save the file you can append an integer to the file name that corresponds to the number of files in the directory.
file = render()
然后你可以用任何名称保存文件,并保存在你想要的地方。
file = render()
then you save the file with what ever name, and where ever you want.
似乎是一个老问题,但我认为您需要的是一个带有全局变量的 MacroScript,用于保留文件名计数器并为该宏创建键盘快捷键,以便您可以在建模时快速渲染。
这是我出于相同目的制作的一个简单的 MacroScript:
它将使用“Camera01”渲染单个帧,如果该相机不存在,则渲染当前活动视口。
要重置文件编号计数器,请使用 MaxScript Listener 窗口设置 rpFileNumber = 0
还可以使用 rpFileName = "c:\myfolder\myfilename" 设置路径和文件名。
此脚本需要大量改进,但目前可以接受。
您可以在这里尝试另一个更复杂的解决方案:
http://forums.cgsociety.org/archive/index.php/t -715599.html
Seems an old question but I think what you need is a MacroScript with a global variable to keep the filename counter and create a keyboard shorcut for that macro so you can render quickly while modeling.
Here is a simple MacroScript i made for the same purpose:
It will render a single frame using "Camera01", if this camera doesn't exist current active viewport is rendered.
To reset the file number counter set rpFileNumber = 0 using MaxScript Listener window
Set also path and file name with rpFileName = "c:\myfolder\myfilename"
This script needs a lot of improvement but is currently acceptable.
You can try another more complex solution here:
http://forums.cgsociety.org/archive/index.php/t-715599.html