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
EDIT: Spoke too soon. Looks like it replaces the exisiting screen.
EDIT2: Got it to work. Just put
after the load. Guessing the viewport is not yet initialized? Was always getting my previous scene.