Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Batch Preview Animation Script?

Batch Preview Animation Script?

Anonymous
Not applicable
607 Views
1 Reply
Message 1 of 2

Batch Preview Animation Script?

Anonymous
Not applicable
Hey...

Is there a way to call upon max build-in preview animation, and have it automaticly create a preview without the dialogue input?

Would be nice then to be able to batch execute that on mulitiple files.
0 Likes
608 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
i figured out a way to do this by combining some script from different places. So the follow code is not a very finished, but working. The scripts that Ive been combining is; http://www.scriptspot.com/3ds-max/scripts/mov-preview-maker and from the max help file; "How to batch process multiple files"

thePath = getSavePath caption:"Maxfiles Folder" --get a path dialog to specify the path

DirPath = getsavepath caption:"Preview Folder"

count = 1

fn resizeViewport sizeX sizeY = (
viewSize = getViewSize()
xRatio = sizeX / viewSize.x
yRatio = sizeY / viewSize.y
if xRatio > yRatio then theRatio = xRatio
else theRatio = yRatio
convX = viewSize.x * theRatio
convY = viewSize.y * theRatio
gw.setPos 0 0 convX convY --setup viewport to desired size
max views redraw --redraw the view
)

sizex = 1920 * 25/100
sizey = 1080 * 25/100

if thePath != undefined do --if the user did not cancel

(

theFiles = getFiles (thePath+"\\*.max") --collect all max files in the dir.

undo off
(

for f in 1 to theFiles.count do --go through all of them

(

loadMaxFile theFiles --load the next file

ViewCubeOps.Visibility = false

viewport.setCamera $Camera01

displaySafeFrames = true

hide $*CTRL*

-- prepare viewport
if viewport.numviews != 1 then (
max tool maximize
)
resizeViewport sizex sizey

view_size = getViewSize()

cnt = 0

preview_name = dirPath+"\"+(count as string)+".mov"

anim_bmp = bitmap (view_size.x) (view_size.y) filename:preview_name

for t = animationrange.start to animationrange.end do

(

sliderTime = t

dib = gw.getViewportDib()

copy dib anim_bmp

save anim_bmp frame:cnt

cnt +=1

)

close anim_bmp

gc()

count += 1

)--end f loop

)--end undo off

resetMaxFile #noPrompt --at the end, you can reset

)--end if
0 Likes