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
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”
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:
Thanks for your time and hope you enjoy! (btw arrow keys work in the command line, tab not working, use 4 spaces!)