Call for Submission
NAB 2012 Best of the Best Show Reel
Submit your work today!
  • 1/3
You are here: Forum Home / Autodesk 3ds® Max® / SDK / How to grab viewport with Multi-Pass Effects
  RSS 2.0 ATOM  

How to grab viewport with Multi-Pass Effects
Rate this thread
 
35765
 
Permlink of this thread   Subscribe to this thread
avatar
  • SWalle
  • Posted: 20 October 2009 03:09 AM
  • Total Posts: 1
  • Joined: 20 October 2009 09:14 AM

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!



Replies: 0




   
  Settings Choose Theme color: