Skip to content

Commit 416c689

Browse files
authored
replace ptvsd by debugpy (#37)
1 parent 44445cd commit 416c689

File tree

5 files changed

+18
-7
lines changed

5 files changed

+18
-7
lines changed

.pylintrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ ignored-classes=optparse.Values,thread._local,_thread._local
355355
# (useful for modules/projects where namespaces are manipulated during runtime
356356
# and thus existing member attributes cannot be deduced by static analysis). It
357357
# supports qualified module names, as well as Unix pattern matching.
358-
ignored-modules=pymxs,ptvsd,PySide2,menuhook,mxthread,socketio
358+
ignored-modules=pymxs,debugpy,PySide2,menuhook,mxthread,socketio
359359

360360
# Show a hint with possible names when a member name was not found. The aspect
361361
# of finding the hint is based on edit distance.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ most of the other samples.
7979
- [realoadmod](/src/packages/reloadmod/README.md) is small tool that will reload all development modules in one
8080
operation
8181

82-
- [mxvscode](/src/packages/mxvscode/README.md) is a small tool that will automatically import ptvsd (the
82+
- [mxvscode](/src/packages/mxvscode/README.md) is a small tool that will automatically import debugpy (the
8383
VSCode debugging interface) during the startup of 3ds Max and make it accept remote connections.
8484
This may slow down the startup of 3ds Max quite a bit and is meant as a developer-only tool.
8585

src/packages/mxvscode/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# mxsvscode
22
VSCode debugging integration for 3ds Max.
33

4-
This package installs ptvsd and enables debugging with vscode at the startup
4+
This package installs debugpy and enables debugging with vscode at the startup
55
of 3ds Max.
+14-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
"""
22
Enable vscode debugging during the startup of 3ds Max.
33
"""
4-
import ptvsd
4+
import sys
5+
import os
6+
import debugpy
7+
58
def startup():
69
"""
710
Allow the remote vscode debugger to attach to the 3ds Max Python
@@ -10,5 +13,13 @@ def startup():
1013
print("""mxvscode startup enabling vscode debugging
1114
(if you don't use VSCode for debugging Python you can uninstall
1215
mxvscode)""")
13-
ptvsd.enable_attach()
14-
print("-- now ready to receive debugging connections from vscode")
16+
17+
sysexec = sys.executable
18+
(base, file) = os.path.split(sys.executable)
19+
if file.lower() == "3dsmax.exe":
20+
sys.executable = os.path.join(base, "python", "python.exe")
21+
host = "localhost"
22+
port = 5678
23+
debugpy.listen((host, port))
24+
print(f"-- now ready to receive debugging connections from vscode on (${host}, ${port})")
25+
sys.executable = sysexec

src/packages/mxvscode/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
long_description_content_type="text/markdown",
1212
packages=setuptools.find_packages(),
1313
install_requires=[
14-
'ptvsd'
14+
'debugpy'
1515
],
1616
entry_points={'3dsMax': 'startup=mxvscode:startup'},
1717
python_requires='>=3.7'

0 commit comments

Comments
 (0)