[Closed] Trouble with render script
I need a simple script render animation in 8 directions (for a game). I have a Dummy with linked Lights. Just rotate dummy at 45’ and render. Output filenames must be like this “animation1_X_YYYY” when X is direction, YYYY is frame number.
It’s work, but have a problems. Please, help me !
1 – Increasing memory consumption. When I start, MAX use ~ 200 MB RAM. After 3 starts on script MAX use already 500MB !!! I’m not sure if rendered pictutes stay all in memory ???
2 – Somethimes (I’m not observe at what kind of scenes) it work veeery slowly (about 3-4 times slower if render manualy in MAX. And crashes (?!!) with “Unknow Exception”
– fl = filename mask
– frFrom = begin frame
– frEnd = End frame
– frNth = every Nth frame
– have 2 sliders for Height & Width of immage (h & w)
– this is the render part on script
on btnRender pressed do
(
for i in 0 to 7 do
(
bcol.text =(“Column: ” + i as string)
for fr in frFrom.value to frTo.value by frNth.value do
(
if fr < 100 then
bm = bitmap w.value h.value filename:(fl + “” + i as string + “” + “00” + fr as string + “.tga”)
else
bm = bitmap w.value h.value filename:(fl + “” + i as string + “” + “0” + fr as string + “.tga”)
bfr.text = (“Frame: ” + fr as string)
render camera:cam frame:fr to:bm vfb:off
save bm
close bm
)
rotate dum 45 z_axis
)
messagebox “Done!” beep:on
)– end btnRender
Do you see the reason of my troubles ???
PS. I attach a whole script
A better solution might be to build a rig with eight cameras, then just render an animation pass from each camera via the max render dialog.
As far as the script. you might try a, gc(), in your loop to force a garbage collection that might clean up memory a bit…
Good luck
Keith Morrison
Thanx for reply
Rig with 8 cams is not appropriate, I think… It must seem character walk (or some action) in 8 direction, It need to light moves…all “world” moves with camera rotation. I think with Dummy to rotate “world” is better
Thank you to advise for gc() – this solve my problem with memory .
But problem with “Unknow Exception” still… ;-( I don’t see cause for this…
And new problem I notice – AA filter !!!
When I render from MAX, I use Catmull-Rom AA filter. I put in script AA filter:
bm = bitmap w.value h.value filename:(fl + “” + i as string + “” + “0” + fr as string + “.tga”)
scanlinerender.antiAliasfilter = Catmull_Rom()
render camera:cam frame:fr to:bm vfb:off
but the render result is not the same !!! What is the cause ??
your changing the production render filter… you want
renderers.current.antialiasfilter=catmull_rom()
This changes the render settings that are used when you use the render() command…
I prefer to use the render dialog, gives a status bar and seems much more stable. I don’t use the render() command much, they’re definitly different somehow…
Good luck
Keith Morrison