Is it possible to retrieve bitmap data from MaxScript? I've tried something like the following bit of code, but the Bitmap pointer I get back is always NULL...
//if(!ExecuteMAXScriptScript("bm = bitmap 400 400 color:red", FALSE, &fpVal)) // OK
if(!ExecuteMAXScriptScript("getLastRenderedImage copy:false;", FALSE, &fpVal)) // OK
DebugPrint("MaxScript execution failed!\n");
assert(fpVal.type == TYPE_BITMAP_BV); // OK
bmpWrapper = *fpVal.bm;
BitmapInfo& info = bmpWrapper.bi; // OK
ss << "Retrieved bitmap info: ";
ss << "Height: " << info.Height() << ", width: " << info.Width() << ", aspect: " << info.Aspect() << endl;
Bitmap* pBmp = bmpWrapper.bm; // always NULL!
DebugPrint("pBmp is defined...\n");
DebugPrint("pBmp is NULL!\n");
So far I've tested this with Max 2010 64-bit.
The thing that really puzzles me is that the rest checks out OK. The value type is what I expect, and the BitmapInfo contains the correct values...
This isn't a crucial issue for me (I'm basically a modeler playing around with the SDK to see what I can learn). But I've spent enough time trying to figure it out that I just want to know what's going on, just for the peace of mind :)
Thanks for any help