[Closed] make .bat file render&maxzip by maxscript
i want automatic make render and Archive File ( maxzip) without question in prepossessing for many file
my maxscript error in ///
ATSCustomDepsOps.AddFile output_name – Add the newly created XML file into the ATS
for render: I create .bat file
run with 3dsmaxcmd.exe
this is my code in cmd:
for %a in (1 2 3 4 5) do “D:\setup\Autodesk\3ds Max Design 2014\3dsmaxcmd.exe” -rfw:0 -continueOnError “F:\a37 (%a).max” -bitmapPath:“F:\TEXTURE” -rps:“D:\desktop\setpresent.rps” -width:500 -height:500 -o=d:\desktop\finalRender\a37%a.jpg -preRenderScript:“D:\desktop\archivemax.ms”
my script in max script
(
renderSceneDialog.close()
Cams = for Cam in cameras where (superclassof Cam == camera) collect Cam
Width = renderWidth as string
Height = renderHeight as string
File = rendOutputFilename as string
rendTimeType = 2
FF = animationrange.start as string
LF = animationRange.end as string
VerBase = (maxVersion())[1]/1000
If VerBase > 12 then
Ver = Verbase + 1998
else
Ver = “Pre 2011”
if Cams.count > 0 then
(
output_name = ((maxfilepath)+”/ProjectInfo.xml”)
if output_name != undefined then
(
output_file = createfile output_name
if output_file != undefined then
(
format “%
” “<xml>” to:output_file
format “%
” “<Version>” to:output_file
format “<Version>%
” Ver to:output_file
format “%
” “</Version>” to:output_file
format “%
” “<Renderer>” to:output_file
format “<renderer>%
” renderers.current to:output_file
format “%
” “</Renderer>” to:output_file
format “%
” “<Cameras>” to:output_file
for Cam in Cams do format “<camera>%
” Cam.name to:output_file
format “%
” “</Cameras>” to:output_file
format “%
” “<FrameRange>” to:output_file
format “<start>%
” FF to:output_file
format “<end>%
” LF to:output_file
format “%
” “</FrameRange>” to:output_file
format “%
” “<Resolution>” to:output_file
format “<width>%
” width to:output_file
format “<height>%
” height to:output_file
format “%
” “</Resolution>” to:output_file
format “%
” “<OutputInfo>” to:output_file
format “<outfile>%
” File to:output_file
format “%
” “</OutputInfo>” to:output_file
format “%
” “</xml>” to:output_file
close output_file
)
)
)
rendOutputFilename = “”
ATSCustomDepsOps.AddFile output_name – Add the newly created XML file into the ATS
ATSOps.Refresh()
local Asset = #()
ATSOps.GetFiles &Asset –collect all scene files and paths
archive = (maxfilepath+ (getFilenameFile maxFileName) + “.zip”)– For simplicity sake your zip file will be located in the same folder as your max file, replace maxfilepath with a folder of your choosing with getSavePath()
maz archive Asset – archive the project
)