I want python console in 3dsmax! Okay!

posted in: Blog | 5

Fed up of hearing all those comments about 3dsmax not having python and now that we do have it we hear that it can’t actually run code on it because we don’t have a console in it?! Well, I haven’t heard it but I had this discussion with myself so what’s best than to solve an issue you’re having with your inner self!

Bear with me on this one as it’s not as straightforward as it should, but still, possible. First, we have to get PySide, which, there isn’t a Windows binary for the python version bundled with 3dsmax… fortunately Kelly Michels, Senior QA at Autodesk has compiled a version against python 2.7.3 and made it available to the general public in his personal blog, thanks for that! Here’s the direct link and here’s the link for the post. Download and install it.

If you have issues installing PySide, then check this other blog post from Kelly (PySide looks for some registry options on where to install) and you’ll find out a detailed explanation and a registry file. If needed follow the steps there and move on.

At this point we should have a running version of PySide with our MaxPlus installation, in your 3dsmax 2014 installation dir, you’ll find inside the scripts/python folder a scripted called demoPyVersionTool.py, if you run that, you should get this in your Listener window:


PySide module True
PySide version 1.2.0

If so, carry on, you’re doing great! Next on the list is PySideKick, download and install it into site-packages folder inside the python folder in your 3dsmax 2014 installation dir.

Phew, almost done 🙂 Now let’s get the YCDIVFX MaxPlus Packages, unzip it and get all the folders (packages) inside the packages folder  into site-packages as before.

Now it’s easy peasy, run the example maxplusconsole.py in the MyExamples folder with python.executeFile “maxplusconsole.py”

Et voilà!

And the code for it:

from PySideKick import Console
from maxhelpers import MaxPlusConsole

main = MaxPlusConsole.MaxWidget()
main.setCentralWidget(Console.QPythonConsole())
main.show()

This is just the first implementation, I hope to improve it a bit in the future and remove the dependency on PySideKick!

Just a quick recap if you are comfortable with all of this:

1. Install PySide build from Kelly
2. Install PySideKick
3. Get and install YCDIVFX MaxPlus Packages
4. Use example above and you’re done!

Thanks for your time and hope you enjoy! (btw arrow keys work in the command line, tab not working, use 4 spaces!)

P.S. – I’ve handled some of the PySide issues by checking Christopher Diggins blog in the Area, this post to be more precise. So big cheers to him for pointing things in the right direction!

5 Responses

  1. Sune
    | Reply

    This is just awesome! Like everyone else our DCC focus is on the “Unified Pipeline”. This makes Max an official member.

    Thanks 🙂

    • Artur Leao
      | Reply

      Thanks man… I agree and I will make sure people at ADSK will hear our voices! Good not to be alone in this 🙂

  2. Sune
    | Reply

    I got this to work, but noticed that the windows is not properly “parented” to 3dsMax (meaning it will get hidden behind max).

    Also tried Blur’s PyQt as suggested in Christopher Diggins post and got some of my Maya interfaces up and running in Max, using his code as a template. Everything seemed to work rock solid. But there is a quite a bit more overhead in setting it up/distributing it.

    I’m curious if you managed to get a PySide window to be parented to Max? And if you are aware of any other “issues”?

    Sune

  3. Artur Leao
    | Reply

    Nope, I didn’t figured out any other way rather than the one Chris mentioned in his blog… that’s why for now I’m not caring about that 🙂

  4. Christoph
    | Reply

    So we will finally be using Max 2015, and first thing I thought was “damn, I need a console” and here I am 🙂 Thanks Artur (and that cloudmatrix guy), much appreciated!

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.