Notifications
Clear all

[Closed] MXS pickObject method. SDK implementation?

I understand that PickModeCallback is being used … possibly in conjunction with PickNodeCallback.

but how does MXS perform the “wait a pick or cancel”?
pickObject method stops script execution and waits for a pick. Anyone has an idea how this is done in the SDK?

3 Replies

It just enters in a while loop until user selects something or cancel it with a key press.
Don’t know if it is possible to debug maxscript.dll with AD debug symbols from VS, but you could use .pdb in IDA PRO + HexRays to see the sources of pick_object_cf.
%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5

Yes! This is it… let me try

Thanks!
The funny thing I already did it in one of my tools

	MSG wmsg;
	while (GetMessage(&wmsg, NULL, 0,0))
	{		
		if (wmsg.message == WM_KEYUP && (TCHAR)wmsg.wParam == VK_ESCAPE)
			end_track_mouse = TRUE;
		else if (wmsg.message == WM_KEYUP || wmsg.message == WM_KEYDOWN)
			continue;
		else if (wmsg.message != WM_RBUTTONUP)  // ignore rmousebuttonup's - they mess focus
			max_ip()->TranslateAndDispatchMAXMessage(wmsg);

		if (end_track_mouse)
			break;
	}

this code snippet is from “mousetrack.cpp”