我正在制作一个批量提交程序脚本,用于在我的3d场景中渲染一系列相机。这些摄影机有自己的单帧编号,需要进行渲染。我希望能够根据我提供的脚本名称保存文件,但省略末尾的帧数。(例如:fileName0004.tif改为fileName.tif(使用3dsmax 2018和vray 3.0。
它似乎是一个自动功能,但我似乎找不到任何地方谈论禁用它。到目前为止,我只看到它是v-ray 5.0中的一个选项。不幸的是,我不能很快升级。
这可能吗?有人知道怎么做吗?
感谢
function fn_netSubmit =
(
local arr_camTEST = #("cam1", "cam2", "cam3")
local arr_renderSeatSide =#("side1", "side2", "side3")
local arr_renderSeat = #("seat1", "seat2", "seat3")
local arr_renderFrames = #("1", "3", "7")
local appendDate = "200707"
local outputLocation = "some\location\"
--connect
nm.connect #manual "mtlwarml401.ca.aero.bombardier.net" platform:#64
if nm.QueryControl #wait do
(
nm.GetControl()
exit
)
if nm.getControl() == true then
(
for i = 1 to arr_camTEST.count do
(
job = nm.newJob()
job.outputWidth = 3600
job.outputHeight = 3600
job.name = ("filename" + " " + arr_renderSeat[i] + " " + arr_renderSeatSide[i] + " " + "S" + "-" + appendDate)
job.nonSeqFrames = true
job.frames = arr_renderFrames[i]
job.renderCamera = arr_camTEST[i]
job.frameOutputName = (outputLocation + "/" + ("filename" + " " + arr_renderSeat[i] + " " + arr_renderSeatSide[i] + " " + "S") + ".tif")
job.submit()
)
)
nm.Disconnect()
)
fn_netSubmit()
过去,我在渲染后使用了一个脚本,该脚本解析目录中的文件名并重命名它们。事实证明,这比尝试使用渲染后回调或尝试在渲染中期强制更改文件名输出要容易得多,也没有那么麻烦:
newSuffixes=#("one","two","three")
--get folder
dirToProcess = getSavePath caption:"Select folder to rename" initialDir:"\\SERVER\Path\Path\"
--sort functions for file list
fn numFromName str =
(
--returns the frame number from a max rendered filename, e.g. 0002 from file_0002.tga. Filename MUST use an underscore.
local parts = filterstring str "._"
return (parts[parts.count-1] as integer)
)
fn compareFN v1 v2 =
(
--sort function copy-pasted from MXS help for filename numeric ordering
local d = (numFromName v1) - (numFromName v2)
case of
(
(d < 0.): -1
(d > 0.): 1
default: 0
)
)
if dirToProcess != undefined do
(
local filesToProcess = getFiles (dirToProcess + "\*.png")
--sort files array ito ordered list of frames in case they're collected out-of-order
qsort filesToProcess compareFN
for f in 1 to filesToProcess.count do
(
--replace the underscore and frame number suffix of foo_####.png with the corresponding memebr of the suffixes array
local newSuffix = newSuffixes[f]
local fileToProcess = filesToProcess[f] as string
local idx = (fileToProcess.count) - 7
newFileName = replace fileToProcess idx 4 newSuffix --string function
--debug
--format "New file name: %n" newFileName
if not (copyfile fileToProcess newFileName) do format "Failed copying % to %" filetoProcess newFileName
)
)
(原始脚本使用从动画控制器提取的数据为数千幅图像编程生成newsuffixes
阵列(