Home Coding, Scripting, Shaders

3ds Max python in VSCode with autocomplete?

polycounter lvl 8
Offline / Send Message
Olli. polycounter lvl 8
I've been trying to configure VSCode as an IDE for 3ds max python. So far, I've gotten execution and linting to work, The only piece thats missing is autocompletion/Intellisense.

So what ive done is changed the Python interpreter from the original one to C:\Program Files\Autodesk\3ds Max 2018\3dsmaxpy.exe. I then installed pip using this interpreter, and used that pip to install pylint. I know it works because if i do for example 
import MaxPlus<br>MaxPlus.blah

it throws an error, but if i do
import MaxPlus<br>MaxPlus.Asset

it recognizes it as a valid command. So clearly the linter is capable of accessing the Max modules properly.

autocompletion of code doesnt work though. For example Ctrl+Space on MaxPlus. just suggest previously used snippets in the .py file. Ive also been unable to get autocompletion to work for standard python modules.

The hinge seems to be the interpreter. If i use the standard 2.7 interpreter from /python27 I get autocompletion and intellisense for all standard libraries, but im not able to import any of the 3ds Max modules (MaxPlus for example) in to my script. If i change to the 3dsmaxpy.exe interpreter, then I can correctly import MaxPlus, but i dont get any autocompletion on any modules.

Replies

  • monster
    Offline / Send Message
    monster polycounter
    I've never used VSCode. If you don't mind using SublimeText3. It's pretty easy to get it setup. If your interested I can type it up.

    If not maybe the guys over at CGSociety Max forum can help you out.
  • dammilo
    Offline / Send Message
    dammilo polycounter lvl 11
    Hey man, I'm currently going through the same ordeal. Did you find a way?
  • speuzer
    Offline / Send Message
    speuzer polycounter lvl 9
    Today I installed latest VSCode, and this is all working for me after first time setup.

    - I turned on "Python Server" when prompted, I believe this is a new method of handling autocomplete/linting?
    - I also turned on pylint, unsure if that was necessary.
    - Changed the interpreter to ...3dsmaxpy.exe
    - I am on 3dsmax 2019
  • elpie89
    Offline / Send Message
    elpie89 polycounter lvl 2
    speuzer said:
    Today I installed latest VSCode, and this is all working for me after first time setup.

    - I turned on "Python Server" when prompted, I believe this is a new method of handling autocomplete/linting?
    - I also turned on pylint, unsure if that was necessary.
    - Changed the interpreter to ...3dsmaxpy.exe
    - I am on 3dsmax 2019

    How did you added the intpreter in vs code?
    I'tried this 
    {
        "folders": [
            {
                "path": "."
            }
        ],
        "settings": {
            "python.pythonPath": "c:\\Program Files\\Autodesk\\3ds Max 2019\\3dsmaxpy.exe",     
            "python.autoComplete.extraPaths": [
                "C:\\Program Files\\Autodesk\\3ds Max 2019"
            ],      
            "files.exclude": {
                "**/*.pyc": true
            }
        }
    }

    There is no way it work
  • Pasgui
    Hi,

    MaxPlus autocompletion works on my side with the following settings.json

    {    "editor.acceptSuggestionOnEnter": "on",    "python.autoComplete.extraPaths": [        "C:/Program Files/Autodesk/3ds Max 2018",        "C:/Program Files/Autodesk/3ds Max 2018/MaxPlus.py",        "C:/Program Files/Autodesk/3ds Max 2018/MaxPlusExtend.py",    ],    "python.pythonPath": "C:\\Program Files\\Autodesk\\3ds Max 2018\\3dsmaxpy.exe",    "python.linting.enabled": true,    "cSpell.enabled": false}

    I hope it helps
Sign In or Register to comment.