python and 3dsmax!

posted in: Blog | 26

Now that the news are out, I’m pretty excited to see what people will start doing with python and 3dsmax, meanwhile I would like to share with you my setup that I’ve been running for the last couple of months.

Thanks to the work of Sven Fraeys and his ExternalMaxscriptIDE, I was able to setup PyCharm running along 3dsmax as an external IDE for python scripting, which is pretty awesome after years of Maxscript IDE…. It actually makes me cry if I have to go back and do something in Maxscript again… either for the language or the IDE.

There’s not to much to say about it so I’ll be just posting the steps on how to get the setup going, so let me know if you run into issues, I’ll gladly help out.

Okay, first, all credit for ExternalMaxscriptIDE goes out for Sven Fraeys ( which is the foundation for all the stuff that I did. Having that said, here goes:

1. Download ExternalMaxscriptIDE :…ScriptIDE.html
2. Copy ” ExternalMaxScriptIDE ” directory to your local scripts directory “$userScripts”
3. Run the , this will copy the startup and run ExternalMaxScriptIDE
4. Install Pycharm –
5. Download the here and unzip it to a folder of your choice (ex. C:YCDIVFX_MaxPlus)
6. Open Pycharm and open the directory where you unzipped the previous file.
7. Go to File -> Settings or press Alt+F7 and search for Project Interpreter
8. Your default project interpreter should be Python 2.7.3 (C:Python27_64python.exe) if not, don’t worry go to the next step.
9. Click Configure interpreters and if you don’t have an interpreter set, click the + button and add your Python interpreter (C:Python26python.exe)
10. With the project interpreter selected on the top list view, click on the Paths tab.
11. Click the + button and add your default 3dsmax 2014 root folder (C:Program FilesAutodesk3ds Max 2014)
12. Back on the Packages tab, you should see a warning to install “distribute”, click on it and then another for “pip”, install that too. (Optional)
13. Now click the Install button and search for “nose”, install “nose” package (Description: nose extends unittest to make testing easier/Author:Jason Pellerin) (Optional)
14. Now search and install “coverage” package. (Optional)
15. Open 3dsmax 2014
16. I’ve added a few configurations to run the examples and a “main configuration” that basically runs the file, feel free to create your own files and a new configuration for it.
17. takes one argument “-f” with the file you want to run
18. Open and hit Run you should see “hello world” in the maxscript window 🙂

Hope this works out for you, let me know if you find any issues. I’ll make a separate post regarding the remote debugging.

The syntax for is: “python -f”

I’m new to python so please bare with me and my messy code 🙂


How the setup looks on my machine:

26 Responses

  1. vectorman
    | Reply

    Thank you for the post, I’ve been trying to install the ExternalMaxscriptIDE and am getting the following error any ideas? Thanks

    — Error occurred in OpenConnection(); filename: C:UsersXAppDataLocalAutodesk3dsMax2014 –; position: 3046; line: 110
    — Frame:
    — userScriptsPath: “C:UsersXAppDataLocalAutodesk3dsMax2014 – 64bitENUscripts”
    — maxHndl: undefined
    — maxHandlePointer: undefined
    — dllPath: “C:UsersXAppDataLocalAutodesk3dsMax2014 – 64bitENUscriptsExternalMaxScriptIDEMaxScriptReceiverForm.dll”
    — sysPointer: undefined
    — maxHwnd: undefined
    — assembly: dotNetClass:System.Reflection.Assembly
    — maxScriptReceiverForm: undefined
    — called in anonymous codeblock; filename: C:UsersXAppDataLocalAutodesk3dsMax2014 –; position: 230; line: 5
    — Frame:
    — Error occurred during fileIn in #C:UsersXAppDataLocalAutodesk3dsMax2014 –; line number: 110
    — Runtime error: dotNet runtime exception: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See for more information.

  2. Artur Leao
    | Reply

    Hi, that seems to be either an issue with administrative rights or some remote/network loading error with the DLL. I would try to run 3dsmax with administrative rights to see if solves the issue.

    You also might want to have a look here regarding the ExternalMaxscriptIDE:

    Hope this helps!

  3. vectorman
    | Reply

    Thanks, I’ll check out the ExternalMaxscriptIDE website…

  4. sai
    | Reply

    thanks for this install tips,but I have encountered some problem.
    run and the error message show up.

    any help please.

    C:Python27python.exe C:/Autodesk/MaxPlus/
    Traceback (most recent call last):
    File “C:/Autodesk/MaxPlus/”, line 6, in
    MaxPlus.Core.WriteLine(“hello world”)
    File “C:Autodesk3ds Max”, line 32330, in WriteLine
    return _MaxPlus.Core_WriteLine(*args)
    RuntimeError: Unknown MaxPlus Exception

    Process finished with exit code 1

  5. Artur Leao
    | Reply

    Hi, I think the correct command-line to run that would be:

    C:Python27python.exe C:/Autodesk/MaxPlus/ -f

    Keep in mind that you need 3dsmax to be open for this to work. You can also run this directly inside 3dsmax, this way you just need to use the python.execute command.

  6. jalnaga
    | Reply

    Hello, Artur Leao, thanks for install tips, but I have encountered some problem.
    When I tried your suggestion, I received this error message.

    C:Python27_64>python C:/MaxPlus/ -f
    Traceback (most recent call last):
    File “C:/MaxPlus/”, line 24, in
    File “”, line 17, in Run
    File “”, line 524, in call
    return Popen(*popenargs, **kwargs).wait()
    File “”, line 711, in __init__
    errread, errwrite)
    File “”, line 948, in _execute_child
    WindowsError: [Error 2]

    I’m using Python 2.7.5, not 2.7.3. Can it be a reason of this problem?
    Any help please.

    • Artur Leao
      | Reply

      Hi, yes you need 2.7.3 64 bit

      Actually, you can point the interpreter to the python build bundled in 3dsmax, it should be in the 3dsmax root folderpython.


  7. julo
    | Reply

    Thanks for the tutorial but I have the same problem as Jalnaga:

    “F:Autodesk3ds Max 2014pythonpython.exe” F:/MaxPlus/ -f
    Traceback (most recent call last):
    File “F:/MaxPlus/”, line 24, in
    File “”, line 17, in Run
    File “F:Autodesk3ds Max”, line 493, in call
    return Popen(*popenargs, **kwargs).wait()
    File “F:Autodesk3ds Max”, line 679, in __init__
    errread, errwrite)
    File “F:Autodesk3ds Max”, line 896, in _execute_child
    WindowsError: [Error 2] Le fichier spécifié est introuvable

    Process finished with exit code 1

    3dsmax is running.
    I tried to install a fresh version of python 2.7.3 64bits with the same result.
    “Le fichier spécifié est introuvable” means roughly Unable to find the specified file.
    Any help would be appreciated 🙂

    ps : sorry for my english

    • Artur Leao
      | Reply

      I think I figured it out, make sure in settings.ini that “external” is pointing to the correct path where MaxscriptIDE.exe is located. I’m working on fixing the zip file and will post an updated version.

  8. julo
    | Reply

    It worked, thx 😉

  9. stascrash
    | Reply

    thank you!
    I was looking in a way of using eclipseIDE with maxPlus, do you know if this is possible?

  10. Seth
    | Reply

    Thanks for sharing this excellent tutorial on python and 3DsMax. I’ll be trying it out soon.

  11. knoppix
    | Reply

    When i try to run ExternalMaxscriptIDE_install 3ds max 2014 gives me this error:

    –Runtime error: fileIn: can’t open file – “$”

    What’s the reason of it?

    • Artur Leao
      | Reply

      Did you copy the ExternalMaxscriptIDE files into the 3dsmax user scripts folder?!

  12. florian
    | Reply

    hi arthur, i stumble uppon the problem, that installation works fine but i cannot execute the, pycharm gives me the following error message:

    “C:Program FilesAutodesk3ds Max 2014pythonpython.exe” C:/MaxPlus/
    Traceback (most recent call last):
    File “C:/MaxPlus/”, line 4, in
    from mxsrunner import *
    ImportError: No module named mxsrunner

    Process finished with exit code 1

    I think it’s a stupid mistake of mine but i cannot get behind, it would be too kind of you if you could spend a second of your time.

    • Artur Leao
      | Reply

      Make sure you have the MaxPlus directory in your environment variables under PYTHONPATH.

  13. Sune
    | Reply

    I had to add the “packages” folder under PyCharms paths tab, since it wasn’t being found. This got rid of the the ImportError, related to mxsrunner

    Next I had an exception where mxsrunner calls subprocess with callparams.

    I had to change the following line in settings.ini to point to my own dir:
    External = C:UsersKameleonWorkCODEYCDIVFXMaxPlusExternalsMaxscriptIDE

    Now PyCharm completes running, but 3dsMax listener displays the following:

    — ERROR
    — Error occurred in anonymous codeblock; started from filename:

    Any clues?

  14. Sune
    | Reply

    I’ve just realized that these points are both in in the readme.txt 🙂 Sorry!

  15. Artur Leao
    | Reply

    Hi Sune, that’s fine and I’m glad you sorted it out. Is the problem solved now?!

    I did some changes in the whole structure after writing this post so something might be broken 🙂

    If is giving you an error, try running a file with just an import MaxPlus and print out something.


  16. Sune
    | Reply

    Yeah I got it working, just had to provide the full path to the script I want to run:

    Script Parameters: -f

    Thanks 🙂

  17. Espen
    | Reply

    I got to point 2.. then it didn’t work.. that is how installinginstructions normaly work..

    • Artur Leao
      | Reply

      Hi Espen, you need to put the files inside your C:UsersYOURUSERNAMEAppDataLocalAutodesk3dsMax2014 – 64bitENUscripts folder then run step 3.

      Let me know if this helps.

  18. DDuffy
    | Reply

    Nearly there I think. But getting this error:

    File “C:Program FilesAutodesk3ds Max”, line 33338, in WriteLine
    return _MaxPlus.Core_WriteLine(*args)
    RuntimeError: Unknown MaxPlus Exception

    Appreciate any help given

  19. Daniel Santana
    | Reply

    Can you tell us, when does this error occurs? Either way, Unknown exception is a very vague error :).

    • DDuffy
      | Reply

      Apologies for the ambiguity 🙂

      when I try to run the in PyCharm I get this error within the PyCharm output window.

      • Daniel Santana
        | Reply

        Hi, can you try to run this from within 3ds Max? Try running this python.execute "MaxPlus.Core.WriteLine(\"hello world\")" and see if this happen. If so, its most likely something wrong with python in 3dsmax. Do you have blur python installed? It can cause the MaxPlus python initialization to fail.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.