Amazing thanks Aram and Frood. I seem to have a working script now. Tested dropping the sleep down all the way to 0.01 for a speedier preview, but I anticipate this scaling with scene complexity. Will test. Thanks again for the help getting this workaround working. If a future corona update could avoid the need for a workaround though that would be good too :-)
Glad to hear that!
I don't think this will be addressed on Corona side in future, as with asynchronous loading you get much more significant improvement (much faster loading times and not only) in contrast to Viewport Grab/Animation Preview, which is not used that much or is not of that much importance as the other things coming with asynchronous loading.
I think the workaround is very good and viable - you get the frames and can even "preview" the animation by a photo viewer by quickly going over the frames (of course you can compile them to a video file further on if needed). Thanks Frood for the input!
So the final maxscript code for a viewport grab/Animation preivew will be:
sliderTime = 0
while sliderTime as string != "10f" do
(
--sleep(0.2)
windows.processPostedMessages()
bmpFilePath = (maxfilepath + "images\\" + getFileNameFile maxfilename + "_" +(sliderTime as string) + ".jpg")
vptGrabBMP = gw.getViewportDib()
vptGrabBMP.filename = bmpFilePath
save vptGrabBMP
sliderTime += 1
)
• "sliderTime = 0" is the starting frame for the animation. "sliderTime = 1f" will be for the 1st frame, "sliderTime = 10f" will be for 10th frame etc.
• "10f" in the while loop is the final frame for the animation, change it accordingly if needed (e.g. "5f" for until 5th, "200f" for until 200th frame is reached)
• "bmpFilePath =" is for defining the output path and format, the arguments are self explanatory
• "--sleep(0.2)" is commented out. Remove the leading "--" to make
sleep work, start with low values of 0.1, 0.2 and increase it until enough time delay is reached for updating the proxy preview, depending on the scene/viewport complexity.
Can be shared in Corona Goodies/User contributions as well.