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?


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.


Yes! This is it… let me try


The funny thing I already did it in one of my tools :stuck_out_tongue_winking_eye:

	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)
		else if (wmsg.message != WM_RBUTTONUP)  // ignore rmousebuttonup's - they mess focus

		if (end_track_mouse)

this code snippet is from “mousetrack.cpp”