ycdivfx / YCDIVFX_MaxPlus

GNU General Public License v2.0
48 stars 12 forks source link

'Could not find MAXScript Macro Recorder' in 3dsMax2017 #3

Open Finetuned opened 7 years ago

Finetuned commented 7 years ago

I've configured maxconnect in PyCharm by duplicating 3dsmaxpy.exe as python.exe. This resolves the issue as described on the Autodesk forums

The script mostly fails to find the mini listener except when using debug:

  File "_ctypes/callbacks.c", line 314, in 'calling callback function'
  File "C:\Dev\bin\YCDIVFX_MaxPlus-master\packages\maxconnect\tomax.py", line 197, in _getWindows
    attachThreads(gMainWindow)
  File "C:\Dev\bin\YCDIVFX_MaxPlus-master\packages\maxconnect\tomax.py", line 176, in attachThreads
    thread = GetWindowThreadProcessId(hwnd, 0) #max thread
WindowsError: exception: access violation writing 0x00007FFF00000000
Could not find MAXScript Macro Recorder

Process finished with exit code 0
Finetuned commented 7 years ago

I traced the issue to attachThreads(hwnd) in packages/maxconnect/tomax.py and added:

  lpdw_process_id = ctypes.c_ulong()

then updated the second arg from 0 to:

   thread = GetWindowThreadProcessId(hwnd, ctypes.byref(lpdw_process_id)) #max thread

ref