acgraham
07-11-2006, 01:55 AM
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 768x432 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 768x432 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 ""
)
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 768x432 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 ""
)
