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
Old 02 February 2013   #1
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.
 
Old 02 February 2013   #2
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
 
Old 02 February 2013   #3
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.
__________________

 
Old 02 February 2013   #4
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.
 
Old 02 February 2013   #5
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
 
Old 02 February 2013   #6
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 ?
 
Old 02 February 2013   #7
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.
 
Old 02 February 2013   #8
requires a viewport refresh though ...


anyone have anything better than....

max tool maximize
max tool maximize
 
Old 02 February 2013   #9
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
 
Old 02 February 2013   #10
nope doesn't work here.
 
Old 02 February 2013   #11
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
 

 
Old 02 February 2013   #12
that looks silly i know but it's OK because all screen-grab operations i do with disabled window redraw anyway.
 
Old 02 February 2013   #13
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
 
Old 02 February 2013   #14
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.
 
Old 02 February 2013   #15
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 08:58 PM.


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