[Maxscript] Batch-Grab-Viewport returns only black images

polycounter lvl 11
Offline / Send Message
SimonT polycounter lvl 11
With this little function i try to open several files after another and create a viewport screenshot. Unfortunately it just returns black images. Google didn't help me too much yet although i might have used not the right keywords.

Do you have any idea how this can be solved?
(
files = #("C:\\Users\\Simon\\Desktop\\test\\Cluster_01.max","C:\\Users\\Simon\\Desktop\\test\\Cluster_02.max","C:\\Users\\Simon\\Desktop\\test\\Cluster_03.max")

for file in files do (

loadmaxfile file usefileunits:true quiet:true

newImagePath = "C:\\Users\\Simon\\Desktop\\test\\" + (getFileNameFile file) + ".jpg"

vpWidth = gw.getWinSizeX();
vpHeight = gw.getWinSizeY();

anim_bmp = bitmap vpWidth vpHeight filename:newImagePath
dib = gw.getViewportDib()
copy dib anim_bmp
save anim_bmp
close anim_bmp
dib = undefined
)
)

Replies

Sign In or Register to comment.