MaxPlus and PyCharm – Update!

posted in: Blog | 15

This is an update on my YCDIVFX MaxPlus Packages which removes a dependency on ExternalMaxscriptIDE. Now thanks to the brilliant work of Christoph Bülter and his SublimeMax package, we can execute our python scripts in 3ds Max directly from Python without too much hassle, way easier to setup. Don’t be scared with all the bullet points, I’ve tried explain it almost click by click.

I basically deleted code from SublimeMax to make it fit to the simple requirements of and PyCharm.

This should make the setup for PyCharm and 3dsmax much easier, here’s an update on the step-by-step:

  1. Install PyCharm-
  2. Download the YCDIVFX MaxPlus Packages and unzip it to a folder of your choice (ex. C:YCDIVFXMaxPlus)
  3. Open PyCharm and open the directory where you unzipped the previous file.
  4. Go to File -> Settings or press Alt+F7 and search for Project Interpreter
  5. Your default project interpreter should be Python 2.7.3 bundled with 3ds Max (C:/Program Files/Autodesk/3ds Max 2014/python/python.exe) if not, don’t worry go to the next step.
  6. Click Configure interpreters and if you don’t have an interpreter set, click the + button and add your Python interpreter (C:/Program Files/Autodesk/3ds Max 2014/python/python.exe)
  7. With the project interpreter selected on the top list view, click on the Paths tab.
  8. Click the + button and add your default 3dsmax 2014 root folder (C:/Program Files/Autodesk/3ds Max 2014) if it doesn’t show up there already.
  9. Go to Project Structure and on the right pane, select the “packages” folder and press “Sources” button.
  10. Press OK

Now let’s setup one configuration and then you can duplicate this one to run other scripts:

  1. Press Run -> Edit Configurations
  2. Fill in with the following values – Script: / Script parameters:  -f
  3. Press OK

Now open 3dsmax 2014.

In PyCharm just select “run main” and press the Run button (little green play button)

In the 3ds Max Listener you should see this:

hello world

Congratulations, you’ve made it!

You can also run it from the command-line, be sure to check the README file.

Recommended optional installs (distribute, pip, nose and coverage):

  1. PyCharm settings on the Python Interpreters page, you should see a warning to install “distribute”, click on it and then another for “pip”, install that too.
  2. Now click the Install button and search for “nose”, install “nose” package (Description: nose extends unittest to make testing easier/Author:Jason Pellerin)
  3. Now search and install “coverage” package.

If you are interested in remote debugging, check my other blog post here: Pycharm, 3dsmax, remote debugging love!

15 Responses

  1. Creator
    | Reply

    Why am I getting “Unresolved attribute reference ‘Cylinder'” when using code from help file?

    Demonstrates creating a cylinder and appling a bend modifier.

    import MaxPlus

    obj = MaxPlus.Factory.CreateGeomObject(MaxPlus.ClassIds.Cylinder)
    obj.ParameterBlock.Radius.Value = 10.0
    obj.ParameterBlock.Height.Value = 30.0
    node = MaxPlus.Factory.CreateNode(obj)
    mod = MaxPlus.Factory.CreateObjectModifier(MaxPlus.ClassIds.Bend)
    mod.ParameterBlock.BendAngle.Value = 45.0

    • Artur Leao
      | Reply

      Try removing the docstring (top 3 lines).

  2. Artur Leao
    | Reply

    That works here on my machine. Does the same happen when you run it from inside 3ds Max? Eg. Not using PyCharm.

  3. Creator
    | Reply

    Inside 3ds Max in works fine.

    python.execute “obj = MaxPlus.Factory.CreateGeomObject(MaxPlus.ClassIds.Cylinder)”
    python.execute “node = MaxPlus.Factory.CreateNode(obj)”

  4. Creator
    | Reply

    I’m not using them inside PyCharm. I just demonstrate that it is the example code from help file.
    I’m using:

    import MaxPlus
    obj = MaxPlus.Factory.CreateGeomObject(MaxPlus.ClassIds.Cylinder)
    obj.ParameterBlock.Radius.Value = 10.0
    obj.ParameterBlock.Height.Value = 30.0
    node = MaxPlus.Factory.CreateNode(obj)

    And word “Cylinder” is highlighted with light-brown color. when I hover – Im getting – “Unresolved attribute reference ‘Cylinder’”. When I run –

    Traceback (most recent call last):
    File “A:/YCDIVFX/MaxPlus/MyExamples/test”, line 2, in
    obj = MaxPlus.Factory.CreateGeomObject(MaxPlus.ClassIds.Cylinder)
    File “C:Program FilesAutodesk3ds Max”, line 26429, in CreateGeomObject
    return _MaxPlus.Factory_CreateGeomObject(*args)
    RuntimeError: Unknown MaxPlus Exception

    Process finished with exit code 1

  5. Artur Leao
    | Reply

    You can’t run MaxPlus outside of 3dsMax, it needs to run within a 3dsMax instance. So you have two options, save that as a file and inside 3dsMax use the python.ExecuteFile or using the above method described in the post.

  6. Creator
    | Reply

    What do you mean by “using the above method described in the post.”? Cause I’m using exactly what described in post =)

    • Artur Leao
      | Reply

      You’ve just said “I’m not using them inside PyCharm.” that is not what I’m describing in the post 🙂 Anyway, you probably don’t have the run configuration properly done.

      Check out these steps:

      Press Run -> Edit Configurations
      Fill in with the following values – Script: / Script parameters: -f
      Press OK

      Also check the image, make sure you have the same settings (with the appropriate paths of course) and then before running, make sure the text next to it says “run main” or in your case “run test” if not, click next to the run button and select the configuration you’ve just created then run that.

      Again, you need 3dsMax open when running.

  7. Creator
    | Reply

    Ohh. I just type the code inside . run and it’s works! But from custom script didnt work. Script: each time rewrites to script’s name. Is this the problem? Sorry, i’m new to python.=) But anyway, thanks for the big nad fast help, I can program now!=)

  8. Artur Leao
    | Reply

    You’re more than welcome, my pleasure 🙂 Regarding the problem itself, be sure to check the names and the configuration. From what you’ve pasted here:


    I can assume the filename is incorrect, should be something like “A:/YCDIVFX/MaxPlus/MyExamples/”

    Take care and happy coding 🙂

  9. Klaudikus
    | Reply

    Does this work with remote debugging options? Can I set breakpoints and walk through the code?

  10. Artur Leao
    | Reply


  11. Luke
    | Reply

    Thanks, really helpful post all seems to be working well, one slight issue however is an error that says “No module named MaxPlus” not sure if this is meant to happen, if anyone has any advice it would be great to hear.

    • Artur Leao
      | Reply

      Hi Luke, what 3ds Max version are you using?

  12. Jintaek Seo
    | Reply

    Great! it works on 3dsMax2015. Really thanks!

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.