Grab Viewport with Multipass Effect?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  02 February 2013
Grab Viewport with Multipass Effect?

To activate the multipass effect in viewport I can use :
maxOps.displayActiveCameraViewWithMultiPassEffect(  )


But if I then use
gw.getViewportDIB()

The multipass effect doesn't show up.

When I run the following line directly after activating the multipass effect, I get the desired result. But if I use it as part of a script, it gives me back all 4 viewports without the multipass effect.
viewport.getViewportDIB()


Can anyone shed any light on this for me?

Cheers,

Cg.
__________________
Not bad. For a hughman.
 
  02 February 2013
Those Multipass effects aren't supported in nitrous
Only the MR Depth of field effect is working in a nitrous viewport
__________________

PowerPreview: High Quality Nitrous Previews for 3ds Max 2012|2013|2014

[ Free Download (ScriptSpot) ]

Home of The Frogs | Online Portfolio
 
  02 February 2013
Originally Posted by spacefrog: Those Multipass effects aren't supported in nitrous
Only the MR Depth of field effect is working in a nitrous viewport

I may be wrong, but he said he was able to get it via another scripted method, so I assume he isn't using nitrous.
__________________

 
  02 February 2013
The tool I'm working on works with both nitrous and d3d. If there's a way to do it in d3d I'll only make that option available when possible.

Cg.
__________________
Not bad. For a hughman.
 
  02 February 2013
A more over-the-top (brute force, actually) method would be to go fully above 3dsMax, directly capturing the screen with .Net. Navigating 3dsMax handles, you could get every viewport Window and their coordinates in screen space, and then capturing this specific region.

Here's two perfect references, WindowShopper by Rotem Shiffman, brilliant stuff :
http://www.monotoneminimal.com/free-tools
This will help you visualize the flow and navigate the software hierarchy, plus its code is non-encrypted, so you can get back every method he used.

You'll get something pretty much like this, that's for the coordinates part :
http://i46.tinypic.com/iyeazm.jpg

Then, for the screenshot itself, I'll let you check this Stack Overflow's thread :
http://stackoverflow.com/questions/...rtion-of-screen

I'm aware this looks like an overkill (and might be), but this just popped up in my head so here it is. Good luck
 
  02 February 2013
works for me with both gw & viewport (2010).... though if I set the camera effect to motion blur it crashes max :(

my method is...

enable multipass effect on the camera
for every frame call maxOps.displayActiveCameraViewWithMultiPassEffect( )
grab the viewport



on a side issue not unrelated does anyone know how to turn off the viewport menu text ?
 
  02 February 2013
Originally Posted by Klunk: on a side issue not unrelated does anyone know how to turn off the viewport menu text ?


thats an easy one

ViewportButtonMgr.EnableButtons : bool : Read|Write 


(not sure this already exists in Max 2010, which you seem to be using )

EDIT:
just tested in Max 2010 and yes it works, requires a viewport refresh though ...
__________________

PowerPreview: High Quality Nitrous Previews for 3ds Max 2012|2013|2014

[ Free Download (ScriptSpot) ]

Home of The Frogs | Online Portfolio

Last edited by spacefrog : 02 February 2013 at 07:03 AM.
 
  02 February 2013
Quote: requires a viewport refresh though ...


anyone have anything better than....

max tool maximize
max tool maximize
 
  02 February 2013
Originally Posted by Klunk: anyone have anything better than....

max tool maximize
max tool maximize


completeRedraw() seems to do the trick quite well for me ...
__________________

PowerPreview: High Quality Nitrous Previews for 3ds Max 2012|2013|2014

[ Free Download (ScriptSpot) ]

Home of The Frogs | Online Portfolio
 
  02 February 2013
nope doesn't work here.
 
  02 February 2013
Originally Posted by Klunk: anyone have anything better than....

max tool maximize
  max tool maximize

i didn't remember want i use... have looked in my code...

 			max tool maximize
 			max tool maximize
 

 
  02 February 2013
that looks silly i know but it's OK because all screen-grab operations i do with disabled window redraw anyway.
 
  02 February 2013
If you want to enforce a full refresh/redraw of the whole viewpanel you can send a windows resize message to the viewpanel handle. I use something like that in PowerPreview ( C# code )

public int RedrawWindow( int hWnd )
{
	Size sz=GetWindowSize( hWnd );
	return(SendMessage( hWnd , WM_SIZE, 0, (sz.Height<<16) | sz.Width  ));" 
}


This even forces the viewpanel handle and the empedded viewports to get "in sync" again after i positioned/resized the viewport inside independingly...
__________________

PowerPreview: High Quality Nitrous Previews for 3ds Max 2012|2013|2014

[ Free Download (ScriptSpot) ]

Home of The Frogs | Online Portfolio
 
  02 February 2013
Originally Posted by spacefrog: If you want to enforce a full refresh/redraw of the whole viewpanel you can send a windows resize message to the viewpanel handle. I use something like that in PowerPreview ( C# code )

public int RedrawWindow( int hWnd )
 {
 	Size sz=GetWindowSize( hWnd );
 	return(SendMessage( hWnd , WM_SIZE, 0, (sz.Height<<16) | sz.Width  ));" 
 }
 


This even forces the viewpanel handle and the empedded viewports to get "in sync" again after i positioned/resized the viewport inside independingly...


it shouldn't work. this message itself doesn't do anything with window size and can't cause repaint.
 
  02 February 2013
it's not just repaint issue.
as you can see after you set ViewportButtonMgr.EnableButtons to OFF, buttons not just stay shown but also they stay functional.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 06:07 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.