Notifications
Clear all

[Closed] batch preview build script

Hey everyone. i’m building a batch preview build script. basicly it loops through all the max files in a directory, sets the viewport size to 768×432 and saves an avi with the same name but has an avi extension. this is because we have hundreds of scenes we need to edit and storyboard.

so far im having a few problems that im wondering if anyone can help me with.

  1. sometimes a few objects flicker in the scene. is there a way to prevent this from happening? im guessing i could delay it with a timer or something before the frame is saved.

  2. when i open up each of the scenes i get heaps of dialog boxes complaining about missing plugins, xrefs, and bitmaps. is there a way to ignore these boxes in maxscript?

  3. when it gets to larger sequences i get an image i/o error. im guessing that this is because the avi is uncompressed and it would get too big. is there a way to compress an avi when its being saved through max script? or an mov?

  4. minor issue, but frame 1 seems to be saved before the frame has been resized to 768×432 even though the function is run before this point.

Thanks alot for any help you guys can offer! as you can probably see my max script skills are pretty basic, but im starting to work out how to use it for massive repetitive tasks.

this is the script i have so far, mostly taken from the preview build tutorial-

files = getFiles “G:\work\doha storyboarding\Qatar games\max scenes for preview\scenes*.max”
for f in files do (
loadMAXFile f
print f
–gets filename from file variable
name = getFilenameFile f
path = getFilenamePath f
print path

–preview_name = (getDir #preview)+”/quickpreviewb.avi”
preview_name = path+name+”.avi”
print preview_name

view_size = getViewSize()
–anim_bmp = bitmap view_size.x view_size.y filename:preview_name
gw.setPos 0 0 768 432
anim_bmp = bitmap 768 432 filename:preview_name
for t = animationrange.start to animationrange.end do (

 sliderTime = t
 dib = gw.getViewportDib()
 copy dib anim_bmp
 save anim_bmp

)
close anim_bmp
gc()
–ramplayer preview_name “”
)

8 Replies

oh yeah another thing i realised i should ask is when max saves an avi does it use the avi 2.0 file format? so that theres no theoretical limit?

i can tell that building a preview in this method isn’t particularly efficient anyway, as it stores the frames in ram and writes them out to the disk when the preview is fully complete. that means you’d be limited to the amount of ram you have on your machine, and if your running a 32 bit app like max has to be (i think) then your limit is 2 gb anyway. if i can compress and save in mov, it will solve most of my problems.

i figured out a way to render it out in widescreen dv resolution which is handy too. if you set the frame size to 1024×575 (widescreen square pixels) and then just resize it to 720×576 the aspect ratios all work out. but now i need to be able to save with a dv codec somehow.

ok i know i’ve asked a lot, but any help here at all would be really appreciated.

now i’ve realised im even further back then before because my previews are always compressed with my script and they look horrible. there obviously some voodoo going on in my machine

thanks again.

does no one know anything about what im talking about? i really need some help here.

ill make it easy. please ignore everything i said and just tell me 1 thing if you can.

how do you set mov or avi compression settings when building a preview through a script.

thanks for any help guys!

1 Reply
(@blue)
Joined: 11 months ago

Posts: 0

I don’t believe you can, if I recall correctly it uses your last settings only.

Disclaimer: I haven’t had to output a video in a few years so this my be a bit out dated.

I was hoping it might do that, but it doesn’t appear to. because now when i set the avi to uncompressed when i build a preview i still get horrible looking compressed stuff when i run the script.

Hi,
If you want to save avi by maxscript, you will need to render a temp avi file ,
then it will save the format as the temp avi.

I have a tool can do batch camera preview

thats cool. I designed mine for different scenes instead of cameras though yours would be handy too. can you set the compression codec with it?

Yes,it all according to what codec you select when make temp avi .
Beside that ,I use quicktime mov instead of avi.