CGTalk > Software > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »
 
Thread Tools Search this Thread Display Modes
Old 02-04-2013, 04:48 AM   #1
3rd Dimentia
Expert
 
3rd Dimentia's Avatar
Chris Gray
TD/DeluxePaint3 Veteran
Melbourne, Australia
 
Join Date: Aug 2002
Posts: 657
Send a message via ICQ to 3rd Dimentia Send a message via MSN to 3rd Dimentia
Grab Viewport with Multipass Effect?

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


But if I then use
Code:
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.
Code:
viewport.getViewportDIB()


Can anyone shed any light on this for me?

Cheers,

Cg.
__________________
Not bad. For a hughman.
 
Old 02-04-2013, 07:43 AM   #2
spacefrog
Frog of the posts
 
spacefrog's Avatar
Josef Wienerroither
Freelance
Vienna, Austria
 
Join Date: Sep 2002
Posts: 2,421
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-04-2013, 09:47 AM   #3
DanGrover
Know-it-All
portfolio
Dan Grover
Technical Director
River Film
London, United Kingdom
 
Join Date: Sep 2004
Posts: 355
Send a message via MSN to DanGrover
Quote:
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-05-2013, 10:34 PM   #4
3rd Dimentia
Expert
 
3rd Dimentia's Avatar
Chris Gray
TD/DeluxePaint3 Veteran
Melbourne, Australia
 
Join Date: Aug 2002
Posts: 657
Send a message via ICQ to 3rd Dimentia Send a message via MSN to 3rd Dimentia
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-05-2013, 11:17 PM   #5
Vimkxi
New Member
 
Vimkxi's Avatar
portfolio
Vincent M
Paris, France
 
Join Date: Dec 2012
Posts: 18
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-06-2013, 01:35 AM   #6
Klunk
Lord of the posts
 
Klunk's Avatar
portfolio
Klunk
United Kingdom
 
Join Date: Sep 2005
Posts: 701
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-06-2013, 06:59 AM   #7
spacefrog
Frog of the posts
 
spacefrog's Avatar
Josef Wienerroither
Freelance
Vienna, Austria
 
Join Date: Sep 2002
Posts: 2,421
Quote:
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

Code:
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-06-2013 at 07:03 AM.
 
Old 02-06-2013, 11:44 AM   #8
Klunk
Lord of the posts
 
Klunk's Avatar
portfolio
Klunk
United Kingdom
 
Join Date: Sep 2005
Posts: 701
Quote:
requires a viewport refresh though ...


anyone have anything better than....

Code:
max tool maximize max tool maximize
 
Old 02-06-2013, 12:11 PM   #9
spacefrog
Frog of the posts
 
spacefrog's Avatar
Josef Wienerroither
Freelance
Vienna, Austria
 
Join Date: Sep 2002
Posts: 2,421
Quote:
Originally Posted by Klunk
anyone have anything better than....

Code:
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-06-2013, 12:18 PM   #10
Klunk
Lord of the posts
 
Klunk's Avatar
portfolio
Klunk
United Kingdom
 
Join Date: Sep 2005
Posts: 701
nope doesn't work here.
 
Old 02-06-2013, 02:15 PM   #11
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,420
Send a message via ICQ to denisT
Quote:
Originally Posted by Klunk
anyone have anything better than....

Code:
max tool maximize max tool maximize

i didn't remember want i use... have looked in my code...
Code:
max tool maximize max tool maximize

 
Old 02-06-2013, 02:19 PM   #12
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,420
Send a message via ICQ to denisT
that looks silly i know but it's OK because all screen-grab operations i do with disabled window redraw anyway.
 
Old 02-06-2013, 02:35 PM   #13
spacefrog
Frog of the posts
 
spacefrog's Avatar
Josef Wienerroither
Freelance
Vienna, Austria
 
Join Date: Sep 2002
Posts: 2,421
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 )

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-06-2013, 03:49 PM   #14
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,420
Send a message via ICQ to denisT
Quote:
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 )

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-06-2013, 04:17 PM   #15
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,420
Send a message via ICQ to denisT
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 04:23 PM.


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