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   #16
it shouldn't work. 


it doesn't, not as a mxs exposed function anyway.
 
Old 02 February 2013   #17
Originally Posted by denisT: it shouldn't work. this message itself doesn't do anything with window size and can't cause repaint.


Oh ... it does work see the prove in the attached image. Before i sent the message to the viewpanel handle, the layout was a perfect quad layout ( equal viewport sizes )

After i sent the message the viewpanel adopts the requested size and does'nt fit in Max's reserved space any longer as the image shows...
As i understand it, WM_SIZE gets sent to windows AFTER the window was resized by whatever means , the perfect place to simulate a "fake" resize event to make the windows function trigger it's client area redraw routines. That was my initial idea which seemed to do the trick after i implemented it ....

But i was wrong with the viewpanel handle for the refresh stuff, you gotta send the message to the max main window handle and it refreshes all of it's client area, including the viewport menu. That's what i do in Powerpreview too

BTW: The menu still being operational without it being displayed seems to be a design decision -> have it still work but not be visible in previews etc...
Attached Images
File Type: png After_WM_SIZE.png (39.0 KB, 11 views)
__________________

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:58 PM.
 
Old 02 February 2013   #18
Originally Posted by spacefrog: Oh ... it does work see the prove in the attached image. Before i sent the message to the viewpanel handle, the layout was a perfect quad layout ( equal viewport sizes )

yes, it does. but it's not the right way to resize the window. resize process sends many other messages to the window to make it complete. functions MoveWindow and SetWindowPos do it.

but both of them don't help to 'reset' view after the buttons turned OFF
 
Old 02 February 2013   #19
Originally Posted by spacefrog: BTW: The menu still being operational without it being displayed seems to be a design decision -> have it still work but not be visible in previews etc...

no. it's just a bug as many others. if it's a design feature why does it go away after view resized anyhow?
 
Old 02 February 2013   #20
the following code forces max to update but does not reset the viewport making the vp menu hidden after the mxs function call

ViewportButtonMgr.EnableButtons = false;
 forceRedraw();



  def_visible_primitive(forceRedraw, "forceRedraw");
  
  // usage: <int> forceRedraw()
  
  Value* forceRedraw_cf(Value **arg_list, int count)
  {
  	check_arg_count(forceRedraw, 0, count);
  	HWND hWnd = GetCOREInterface()->GetMAXHWnd();
  	RECT rect;
  	GetWindowRect(hWnd, &rect );
  	LRESULT res = SendMessage( hWnd , WM_SIZE, 0, ((rect.bottom - rect.top)<<16) | (rect.right - rect.left));
  	return Integer::intern(rect.bottom - rect.top);
  }

Last edited by Klunk : 02 February 2013 at 12:07 AM.
 
Old 02 February 2013   #21
Originally Posted by Klunk: the following code forces max to update but does not reset the viewport making the vp menu hidden after the mxs function call

ViewportButtonMgr.EnableButtons = false;
  forceRedraw();



   def_visible_primitive(forceRedraw, "forceRedraw");
   
   // usage: <int> forceRedraw()
   
   Value* forceRedraw_cf(Value **arg_list, int count)
   {
   	check_arg_count(forceRedraw, 0, count);
   	HWND hWnd = GetCOREInterface()->GetMAXHWnd();
   	RECT rect;
   	GetWindowRect(hWnd, &rect );
   	LRESULT res = SendMessage( hWnd , WM_SIZE, 0, ((rect.bottom - rect.top)<<16) | (rect.right - rect.left));
   	return Integer::intern(rect.bottom - rect.top);
   }

no,no,no... that's the same mistake. you can't just send WM_SIZE to the window. getting this message the window just knows that it's a different size now, and starts behave as resized.
for example, getting this message the window doesn't update its client area.
 
Old 02 February 2013   #22
I know that why I said it doesn't work.
 
Old 02 February 2013   #23
Originally Posted by Klunk: I know that why I said it doesn't work.

sorry. it seems like i missed your point. the message that has to do the trick is WM_NCCALCSIZE.
but i couldn't find the moment and the place to send it.
 
Old 02 February 2013   #24
Originally Posted by denisT: no. it's just a bug as many others. if it's a design feature why does it go away after view resized anyhow?


It does not go away when i manualy resize the view. Turning off the viewport menu and resizing the viewports/maxmimizing/minimizing resizing the max main window
-> result viewport menu keeps being operational

And regarding the other thing about the WM_SIZE message
I did't want to use it for an actual windows resize but to trigger Max's viewport re-layouting mechanism in my case, or the viewport menu redraw in the other case

The method works for both scenarios here, so i'm satisfied

Maybe it would better to sent the WM_NCCALCSIZE message but you have to send some NCCALCSIZE_PARAMS structure with it
__________________

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:30 AM.
 
Old 02 February 2013   #25
I've no issues grabbing Nitrous with multipass, see attached image
Attached Images
File Type: jpg Nitrous_mp.jpg (83.8 KB, 19 views)
__________________
The GPU revolution will not be rasterized! - http://www.jdbgraphics.nl
 
Old 02 February 2013   #26
Originally Posted by jonadb: I've no issues grabbing Nitrous with multipass, see attached image


Strange... i only can get 3ds Max to say the following....
multipass in 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   #27
it's pretty academic really as the "max tool maximize" method is quicker and doesn't mess with the window order either
 
Old 02 February 2013   #28
Originally Posted by spacefrog: It does not go away when i manualy resize the view...

heh! that's true. they stay functional. maybe it's a feature. you are right.
 
Old 02 February 2013   #29
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
 
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 07:05 PM.


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