duberPython is coming to life!

loocas | 3ds Max,maxscript,Python,software,technical | Friday, December 11th, 2009

duberPython banner

I am very excited to present a very early development results for our own Python implementation in 3ds Max.

First a bit of an intro. At duber, I’ve setup everything around Python, the most versatile and powerful language I’ve ever seen. I felt in love with Python so much that it even influenced my decision to leave Fusion (my favourite compositing app) and dive into Nuke (my, now, most favourite compositing app). I even invested in a commercial data and asset management system, Tactic, that is entirely written in Python. I run tons of custom Python scripts to tie together programs such as Tactic, Nuke, FrameCycler, Photoshop etc… etc… But the last missing piece to the entire pipeline puzzle was 3ds Max.

There were initiatives to bring Python into Max, both from Autodesk and from 3rd party developers. The problem is, none of those are final, open-source, nor fully functional.

What I need with Max, at least for now, is to be able to communicate with the Python tools running at my studio. I need Max to be able to communicate with Tactic. I need it to communicate with FrameCycler. And I need it to communicate with Nuke. Since I have most of the tiny scripts up and running that provide this communication layer, the last bit missing was Max being able to execute Python scripts and catch Python’s outputs.

We’ve achieved this with IronPython and a bit of C# magic.

Even though IronPython is different from CPython (the regular distro), it provides some additional functionality and mainly, it communicates flawlessly with dotNET. Another area that Max is well tied to. So this made for a perfect match! All we needed was a layer, a bridge of some sort, that’d make IronPython play nice with Max and vice versa. What we have right now is a very early Alpha build, very simple, elegant and light, that does just that! Maybe, if Autodesk doesn’t do it for us, we might extend this functionality beyond a simple communication layer and might actually make Python scripts command 3ds Max, so that we will be able to create objects, modify them, manipulate with the scene etc… etc… all directly via Python’s code. But for now, all I need is a two way communication tunnel that bridges the gap between MAXscript and Python. So far, we can run directly Python commands/scripts from within MAXScript code and we can run Python script files stored on the HDD and return results in MAXScript.

Here’s a sample of what we have right now:

Python scripts running directly from MXS

Python scripts running directly from MXS

Python scripts running from a file inside of MXS

We’re working on proper data type wrapping right now. So far, we’ve got INTEGER, FLOAT and STRING types as well as DOUBLE type (naturally) being properly translated between MAXScript and Python. Hopefully I’ll have all the various data types being correctly translated to and from MAXScript and Python by the end of the week.

Also, the beauty of it is that it’s based on dotNET code and it was compiled independent on CPU architecture, which means it runs as fast and fine on both x86 machines and versions of Max as on x64 platforms. The other huge benefit is it is independent of 3ds Max entirely. It only requires dotNET Framework 3.5+ and IronPython libraries, but doesn’t require a recompile if I need it running under Max 9, 2008, 2009, 2010 or any other future versions of Max!

It is obviously not as robust or complex as Blur’s latest Python plugin, but thanks to that, it’s very versatile and flexible, which is great! ;)


  1. aka je/bude vyhoda oproti napojenia cez python od bluru (nezavislost od Bluru?). Kolko ludi v tvojom studiu vyuziva Tactic? oplati sa jeho nasadenie napr. aj pre 3-4 clenny tym?

    Comment by martincg — December 29, 2009 @ 14:46

  2. Martine, vyhoda je hlavne nezavislost od Bluru. Jelikoz BlurPython, presto, ze je mnohem lepsi a komplexnejsi, neni open source a tudiz nad nim nemam zadnou kontrolu. A bejt odkazanej na plugin, bez oficialni podpory, bez podpory verzi Maxe, kterou si ja urcim, je sebevrazda. Proto je pro me lepsi investovat do vlastniho reseni, ktery neni na nicem zavisly.

    Co se Tacticu tyce, tak se vyplati i pro jednoho cloveka :) I presto, ze to nedava moc smysl, jelikoz je to kolaborativni system. Moje studio bude fungovat s cca 4-5 klicovejma lidma v budove + XY freelanceru pres internet. To vsechno bude managovat Tactic centralizovane na mym serveru.

    Comment by loocas — December 29, 2009 @ 16:57

  3. mozno sa dockame pythona priamo v maxovi, bolo by to trochu aj logicke ked ho priamo podporuju aj ostatne 3d softy od autodesku, a taktiez cinema4d a nehovoriac o blenderovi. inac drzim prsty s tou implementaciou pythonu, beh na riadne dlhu trat.

    Comment by martincg — December 30, 2009 @ 22:20

RSS feed for comments on this post. TrackBack URI

Leave a comment

Powered by WordPress | Theme by Roy Tanck