如何保存刚刚渲染的对象的图像?

问题描述 投票:1回答:1

我是脚本的新手,我正在尝试导出场景中的对象并单独渲染所有选定对象的图像。

现在我的代码只能根据我的对象具有的任何名称导出FBX文件,并且可以渲染一个图像。

for current in geometry do
(
    select current
    newFileName = current.name
    newFilePath = pathConfig.GetDir #Export
    completeFilePath = (newFilePath + "/" + newFileName)

    exportFile completeFilePath #noPrompt selectedOnly:true using:FBXEXP
    render renderType:#selected 
    --render current frame:1 outputfile:"testRender.png"
)

我想导出,在场景中渲染每个选定的对象(单独),将其保存为.png,并在渲染图像上使用对象的名称。

maxscript
1个回答
0
投票

试试这个:

for current in geometry do
(
    select current
    newFileName = current.name
    newFilePath = pathConfig.GetDir #Export
    completeFilePath = (newFilePath + "/" + newFileName)

    exportFile completeFilePath #noPrompt selectedOnly:true using:FBXEXP
    render renderType:#selected

    outputFilePath = (newFilePath + "/" + newFileName + ".png")
    render current frame:1 outputfile:outputFilePath 
)
© www.soinside.com 2019 - 2024. All rights reserved.