Notifications
Clear all

[Closed] Grab Viewport with Multipass Effect?

it shouldn't work. 

it doesn’t, not as a mxs exposed function anyway.

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);
  }
1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

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.

I know that why I said it doesn’t work.

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

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.

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

it’s pretty academic really as the “max tool maximize” method is quicker and doesn’t mess with the window order either

Page 2 / 2