Community
3ds Max Programming
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max SDK, Maxscript and Python topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to grab viewport with Multi-Pass Effects

0 REPLIES 0
Reply
Message 1 of 1
Anonymous
166 Views, 0 Replies

How to grab viewport with Multi-Pass Effects

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())
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&#40;&#41; // <--- Add Multi-Pass Effect
vpt->getGW&#40;&#41;->getDIB&#40;NULL, &size&#41;
...


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!
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report