|
I’d like to grab the viewport with Multi-Pass Effects. Therefor I already found the following example in the SDK-Help which grabs the viewport without Multi-Pass Effects:
void TestGetDIB(IObjParam *ip){
BITMAPINFO *bmi = NULL;
BITMAPINFOHEADER *bmih;
BitmapInfo biFile;
Bitmap *map;
int size;
TheManager->SelectFileOutput(&biFile,
ip->GetMAXHWnd(), _T("Testing"))
if(!biFile.Name()[0])
return;
ViewExp *vpt = ip->GetActiveViewport()
vpt->getGW()->getDIB(NULL, &size)
bmi = (BITMAPINFO *)malloc(size)
bmih = (BITMAPINFOHEADER *)bmi;
vpt->getGW()->getDIB(bmi, &size)
biFile.SetWidth((WORD)bmih->biWidth)
biFile.SetHeight((WORD)bmih->biHeight)
biFile.SetType(BMM_TRUE_32)
map = TheManager->Create(&biFile)
map->OpenOutput(&biFile)
map->FromDib(bmi)
map->Write(&biFile)
map->Close(&biFile)
if(bmi)
free(bmi)
ip->ReleaseViewport(vpt)
}
For cameras with Multi-Pass Effects enabled I can add the following function:
...
ViewExp *vpt = ip->GetActiveViewport()
ip->DisplayActiveCameraViewWithMultiPassEffect() // <--- Add Multi-Pass Effect
vpt->getGW()->getDIB(NULL, &size)
...
The problem is, the Multi-Pass Effect is displayed correct in the viewport but finally it is not saved to file. It looks like the function ‘getDIB’ does not grab the ‘final’ Viewport.
Any suggestion?
Many thanks!
|
|
|